OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
InfoIunitsCommand Class Reference
Inheritance diagram for InfoIunitsCommand:
Inheritance graph
Collaboration diagram for InfoIunitsCommand:
Collaboration graph

Public Member Functions

 InfoIunitsCommand (SimControlLanguageCommand &parentCommand)
 
virtual ~InfoIunitsCommand ()
 
virtual bool execute (const std::vector< DataObject > &arguments)
 
- Public Member Functions inherited from SimControlLanguageSubCommand
 SimControlLanguageSubCommand (SimControlLanguageCommand &parentCommand)
 
virtual ~SimControlLanguageSubCommand ()
 
virtual SimControlLanguageCommandparent ()
 

Detailed Description

Implementation of "info iunits".

Definition at line 359 of file InfoCommand.cc.

Constructor & Destructor Documentation

◆ InfoIunitsCommand()

InfoIunitsCommand::InfoIunitsCommand ( SimControlLanguageCommand parentCommand)
inline

Constructor.

Definition at line 364 of file InfoCommand.cc.

◆ ~InfoIunitsCommand()

virtual InfoIunitsCommand::~InfoIunitsCommand ( )
inlinevirtual

Destructor.

Definition at line 371 of file InfoCommand.cc.

371 {
372 }

Member Function Documentation

◆ execute()

virtual bool InfoIunitsCommand::execute ( const std::vector< DataObject > &  arguments)
inlinevirtual

Executes the "info iunits" command.

"info iunits" prints the names of all the immediate units in the machine.

Parameters
argumentsNo arguments should be given.
Returns
Always true.

Implements SimControlLanguageSubCommand.

Definition at line 383 of file InfoCommand.cc.

383 {
384
385 const int argumentCount = arguments.size() - 2;
386
387 if (!parent().checkArgumentCount(argumentCount, 0, 0)) {
388 return false;
389 }
390 if (!parent().checkMachineLoaded()) {
391 return false;
392 }
393 const TTAMachine::Machine& mach =
397 std::string result = "";
398 bool isFirst = true;
399 for (int i = 0; i < nav.count(); ++i) {
400 if (!isFirst)
401 result += "\n";
402 result += nav.item(i)->name();
403 isFirst = false;
404 }
405 parent().interpreter()->setResult(result);
406 return true;
407 }
ScriptInterpreter * interpreter() const
virtual void setResult(DataObject *result)
virtual SimControlLanguageCommand & parent()
const TTAMachine::Machine & machine() const
ComponentType * item(int index) const
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition Machine.cc:416

References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::immediateUnitNavigator(), CustomCommand::interpreter(), TTAMachine::Machine::Navigator< ComponentType >::item(), SimulatorFrontend::machine(), SimControlLanguageSubCommand::parent(), ScriptInterpreter::setResult(), and SimControlLanguageCommand::simulatorFrontend().

Here is the call graph for this function:

The documentation for this class was generated from the following file: