Custom command that executes the trigger command of last loaded operation.
Definition at line 58 of file TestOsal.hh.
bool CmdTrigger::execute |
( |
const std::vector< DataObject > & |
arguments | ) |
|
|
virtual |
Executes the trigger command of an operation.
- Parameters
-
arguments | The arguments for the command. |
- Returns
- True if the command is executed succesfully, otherwise false.
- Exceptions
-
Implements CustomCommand.
Definition at line 90 of file TestOsal.cc.
96 if (arguments.size() < 2) {
102 string opName = arguments[1].stringValue();
115 obj->
setString(
"unknown operation \"" + opName +
"\"");
121 vector<DataObject> inputs;
122 for (
size_t i = 2; i < arguments.size(); i++) {
123 inputs.push_back(arguments[i]);
126 vector<SimValue*> args;
135 if (!simulator.
simulateTrigger(*op, inputs, args, opContext, result)) {
136 for (
unsigned int i = 0; i < args.size(); i++) {
147 string output =
context.toOutputFormat(current);
151 if (i < op->numberOfOutputs() - 1) {
157 for (
unsigned int i = 0; i < args.size(); i++) {
References assert, CustomCommand::context(), SimpleScriptInterpreter::context(), Exception::errorMessage(), OperationSimulator::instance(), NullOperation::instance(), CustomCommand::interpreter(), Operation::numberOfInputs(), Operation::numberOfOutputs(), OsalInterpreter::operation(), OperationContext::programCounter(), OperationContext::returnAddress(), OperationContext::saveReturnAddress(), ScriptInterpreter::setResult(), DataObject::setString(), and OperationSimulator::simulateTrigger().