OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
OsalInterpreter Class Reference

#include <TestOsal.hh>

Inheritance diagram for OsalInterpreter:
Inheritance graph
Collaboration diagram for OsalInterpreter:
Collaboration graph

Public Member Functions

 OsalInterpreter ()
 
virtual ~OsalInterpreter ()
 
Operationoperation (const std::string &name)
 
- Public Member Functions inherited from SimpleScriptInterpreter
 SimpleScriptInterpreter ()
 
virtual ~SimpleScriptInterpreter ()
 
virtual void initialize (int argc, char *argv[], InterpreterContext *context, LineReader *reader)
 
virtual void setVariableToInterpreter (const std::string &name, const DataObject &value)
 
virtual DataObject variable (const std::string &name)
 
virtual bool interpret (const std::string &commandLine)
 
virtual void setResultToInterpreter (const DataObject &value)
 
virtual InterpreterContextcontext () const
 
- Public Member Functions inherited from ScriptInterpreter
 ScriptInterpreter ()
 
virtual ~ScriptInterpreter ()
 
virtual void addCustomCommand (CustomCommand *command)
 
virtual void removeCustomCommand (const std::string &commandName)
 
virtual CustomCommandcustomCommand (const std::string &commandName)
 
virtual void setResult (DataObject *result)
 
virtual void setResult (const std::string &result)
 
virtual void setResult (int result)
 
virtual void setResult (double result)
 
virtual std::string result ()
 
virtual void setError (bool state)
 
virtual void setError (std::string errorMessage)
 
virtual bool error () const
 
virtual void setVariable (const std::string &interpreterVariableName, const std::string &value)
 
virtual void setVariable (const std::string &interpreterVariableName, int value)
 
virtual std::string variableStringValue (const std::string &interpreterVariableName)
 
virtual int variableIntegerValue (const std::string &interpreterVariableName)
 
virtual bool processScriptFile (const std::string &scriptFileName)
 
virtual void finalize ()
 
virtual void setLineReader (LineReader *reader)
 
virtual LineReaderlineReader () const
 
std::vector< std::string > customCommandsSortedByName ()
 

Private Attributes

OperationPoolpool_
 Used to load operations. More...
 
Operationoperation_
 Last loaded operation. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SimpleScriptInterpreter
virtual void addCustomCommandToInterpreter (const CustomCommand &command)
 
virtual void removeCustomCommandFromInterpreter (const CustomCommand &command)
 

Detailed Description

Interpreter for test_osal.

Definition at line 249 of file TestOsal.hh.

Constructor & Destructor Documentation

◆ OsalInterpreter()

OsalInterpreter::OsalInterpreter ( )

Constructor.

Definition at line 369 of file TestOsal.cc.

370  pool_ = new OperationPool();
372 }

References NullOperation::instance(), operation_, and pool_.

Here is the call graph for this function:

◆ ~OsalInterpreter()

OsalInterpreter::~OsalInterpreter ( )
virtual

Destructor.

Definition at line 377 of file TestOsal.cc.

377  {
378  delete pool_;
379 }

References pool_.

Member Function Documentation

◆ operation()

Operation & OsalInterpreter::operation ( const std::string &  name)

Loads an operation and return a reference to it.

Parameters
nameThe name of the operation.
Returns
The reference to operation.

Definition at line 388 of file TestOsal.cc.

388  {
389 
391  operation_->name() != name) {
392  operation_ = &(pool_->operation(name.c_str()));
393  }
394 
395  TesterContext& testCont = *dynamic_cast<TesterContext*>(&context());
396  OperationContext& opContext = testCont.operationContext();
399  beh.createState(opContext);
400  }
401 
402  return *operation_;
403 }

References Operation::behavior(), SimpleScriptInterpreter::context(), OperationBehavior::createState(), NullOperation::instance(), Operation::name(), OperationPool::operation(), operation_, TesterContext::operationContext(), and pool_.

Referenced by CmdTrigger::execute(), and CmdReset::execute().

Here is the call graph for this function:

Member Data Documentation

◆ operation_

Operation* OsalInterpreter::operation_
private

Last loaded operation.

Definition at line 260 of file TestOsal.hh.

Referenced by operation(), and OsalInterpreter().

◆ pool_

OperationPool* OsalInterpreter::pool_
private

Used to load operations.

Definition at line 258 of file TestOsal.hh.

Referenced by operation(), OsalInterpreter(), and ~OsalInterpreter().


The documentation for this class was generated from the following files:
OperationPool::operation
Operation & operation(const char *name)
Definition: OperationPool.cc:99
OperationContext
Definition: OperationContext.hh:56
OsalInterpreter::operation_
Operation * operation_
Last loaded operation.
Definition: TestOsal.hh:260
SimpleScriptInterpreter::context
virtual InterpreterContext & context() const
Definition: SimpleScriptInterpreter.cc:185
NullOperation::instance
static NullOperation & instance()
Operation::name
virtual TCEString name() const
Definition: Operation.cc:93
OperationBehavior::createState
virtual void createState(OperationContext &context) const
Definition: OperationBehavior.cc:127
TesterContext
Definition: TestOsal.hh:212
TesterContext::operationContext
OperationContext & operationContext()
Definition: TestOsal.cc:453
OsalInterpreter::pool_
OperationPool * pool_
Used to load operations.
Definition: TestOsal.hh:258
OperationBehavior
Definition: OperationBehavior.hh:53
Operation::behavior
virtual OperationBehavior & behavior() const
Definition: Operation.cc:388
SimpleScriptInterpreter::SimpleScriptInterpreter
SimpleScriptInterpreter()
Definition: SimpleScriptInterpreter.cc:48
OperationPool
Definition: OperationPool.hh:52