OpenWalnut
1.4.0
|
An abstract base class for a script interpreter. More...
#include <WScriptInterpreter.h>
Public Member Functions | |
virtual | ~WScriptInterpreter () |
Destructor. | |
virtual void | initBindings ()=0 |
Initialize OpenWalnut-bindings. | |
virtual void | setParameters (std::vector< std::string > const ¶ms)=0 |
Sets the script parameters. | |
virtual void | execute (std::string const &line)=0 |
Execute some code. | |
virtual void | executeAsync (std::string const &script)=0 |
Execute a script in a seperate thread. | |
virtual void | executeFile (std::string const &filename)=0 |
Execute a file. | |
virtual void | executeFileAsync (std::string const &filename)=0 |
Execute a script file in a seperate thread. | |
virtual std::string const | getName () const =0 |
Get the name of the language interpreted by this interpreter. | |
virtual std::string const | getExtension () const =0 |
Get the default extension for script file belonging to the script interpreter's language. |
An abstract base class for a script interpreter.
Definition at line 36 of file WScriptInterpreter.h.
WScriptInterpreter::~WScriptInterpreter | ( | ) | [virtual] |
Destructor.
Definition at line 27 of file WScriptInterpreter.cpp.
virtual void WScriptInterpreter::execute | ( | std::string const & | line | ) | [pure virtual] |
Execute some code.
line | The code to interpret. |
virtual void WScriptInterpreter::executeAsync | ( | std::string const & | script | ) | [pure virtual] |
Execute a script in a seperate thread.
This function returns immediately.
script | The script to execute. |
virtual void WScriptInterpreter::executeFile | ( | std::string const & | filename | ) | [pure virtual] |
Execute a file.
filename | The script file to execute. |
virtual void WScriptInterpreter::executeFileAsync | ( | std::string const & | filename | ) | [pure virtual] |
Execute a script file in a seperate thread.
This function returns immediately.
filename | The script file to execute. |
virtual std::string const WScriptInterpreter::getExtension | ( | ) | const [pure virtual] |
Get the default extension for script file belonging to the script interpreter's language.
virtual std::string const WScriptInterpreter::getName | ( | ) | const [pure virtual] |
Get the name of the language interpreted by this interpreter.
virtual void WScriptInterpreter::initBindings | ( | ) | [pure virtual] |
Initialize OpenWalnut-bindings.
These allow OW-classes to be used via the script interpreter.
virtual void WScriptInterpreter::setParameters | ( | std::vector< std::string > const & | params | ) | [pure virtual] |
Sets the script parameters.
These are the parameters you would normally call your script with, e.g. "./myscript.py param 1 param2".
params | The parameters to the script. In our example, they would be "./myscript.py", "param", "1" and "param2". |