OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 
Operationoperation_
 Last loaded operation.
 

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}
static NullOperation & instance()
Operation * operation_
Last loaded operation.
Definition TestOsal.hh:260
OperationPool * pool_
Used to load operations.
Definition TestOsal.hh:258

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}
virtual void createState(OperationContext &context) const
Operation & operation(const char *name)
virtual TCEString name() const
Definition Operation.cc:93
virtual OperationBehavior & behavior() const
Definition Operation.cc:388
virtual InterpreterContext & context() const
OperationContext & operationContext()
Definition TestOsal.cc:453

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: