OpenASIP  2.0
Public Member Functions | List of all members
InfoRegFilesCommand Class Reference
Inheritance diagram for InfoRegFilesCommand:
Inheritance graph
Collaboration diagram for InfoRegFilesCommand:
Collaboration graph

Public Member Functions

 InfoRegFilesCommand (SimControlLanguageCommand &parentCommand)
 
virtual ~InfoRegFilesCommand ()
 
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 regfiles".

Definition at line 305 of file InfoCommand.cc.

Constructor & Destructor Documentation

◆ InfoRegFilesCommand()

InfoRegFilesCommand::InfoRegFilesCommand ( SimControlLanguageCommand parentCommand)
inline

Constructor.

Definition at line 310 of file InfoCommand.cc.

310  :
311  SimControlLanguageSubCommand(parentCommand) {
312  }

◆ ~InfoRegFilesCommand()

virtual InfoRegFilesCommand::~InfoRegFilesCommand ( )
inlinevirtual

Destructor.

Definition at line 317 of file InfoCommand.cc.

317  {
318  }

Member Function Documentation

◆ execute()

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

Executes the "info regfiles" command.

"info regfiles" prints the names of all the register files in the machine.

Parameters
argumentsNo arguments should be given.
Returns
Always true.

Implements SimControlLanguageSubCommand.

Definition at line 329 of file InfoCommand.cc.

329  {
330 
331  const int argumentCount = arguments.size() - 2;
332 
333  if (!parent().checkArgumentCount(argumentCount, 0, 0)) {
334  return false;
335  }
336  if (!parent().checkMachineLoaded()) {
337  return false;
338  }
339  const TTAMachine::Machine& mach =
342  mach.registerFileNavigator();
343  std::string result = "";
344  bool isFirst = true;
345  for (int i = 0; i < nav.count(); ++i) {
346  if (!isFirst)
347  result += "\n";
348  result += nav.item(i)->name();
349  isFirst = false;
350  }
351  parent().interpreter()->setResult(result);
352  return true;
353  }

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

Here is the call graph for this function:

The documentation for this class was generated from the following file:
SimControlLanguageSubCommand::parent
virtual SimControlLanguageCommand & parent()
Definition: SimControlLanguageCommand.cc:842
SimControlLanguageSubCommand::SimControlLanguageSubCommand
SimControlLanguageSubCommand(SimControlLanguageCommand &parentCommand)
Definition: SimControlLanguageCommand.cc:824
SimulatorFrontend::machine
const TTAMachine::Machine & machine() const
Definition: SimulatorFrontend.cc:263
TTAMachine::Machine::Navigator::count
int count() const
CustomCommand::interpreter
ScriptInterpreter * interpreter() const
ScriptInterpreter::setResult
virtual void setResult(DataObject *result)
Definition: ScriptInterpreter.cc:128
TTAMachine::Machine::registerFileNavigator
virtual RegisterFileNavigator registerFileNavigator() const
Definition: Machine.cc:450
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
SimControlLanguageCommand::simulatorFrontend
SimulatorFrontend & simulatorFrontend()
Definition: SimControlLanguageCommand.cc:214
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
TTAMachine::Machine
Definition: Machine.hh:73