An abstract base class for a script interpreter.
More...
#include <WScriptInterpreter.h>
|
virtual | ~WScriptInterpreter () |
| Destructor. More...
|
|
virtual void | initBindings ()=0 |
| Initialize OpenWalnut-bindings. More...
|
|
virtual void | setParameters (std::vector< std::string > const ¶ms)=0 |
| Sets the script parameters. More...
|
|
virtual void | execute (std::string const &line)=0 |
| Execute some code. More...
|
|
virtual void | executeAsync (std::string const &script)=0 |
| Execute a script in a seperate thread. More...
|
|
virtual void | executeFile (std::string const &filename)=0 |
| Execute a file. More...
|
|
virtual void | executeFileAsync (std::string const &filename)=0 |
| Execute a script file in a seperate thread. More...
|
|
virtual std::string const | getName () const =0 |
| Get the name of the language interpreted by this interpreter. More...
|
|
virtual std::string const | getExtension () const =0 |
| Get the default extension for script file belonging to the script interpreter's language. More...
|
|
An abstract base class for a script interpreter.
Definition at line 36 of file WScriptInterpreter.h.
◆ ~WScriptInterpreter()
WScriptInterpreter::~WScriptInterpreter |
( |
| ) |
|
|
virtual |
◆ execute()
virtual void WScriptInterpreter::execute |
( |
std::string const & |
line | ) |
|
|
pure virtual |
Execute some code.
- Parameters
-
line | The code to interpret. |
◆ executeAsync()
virtual void WScriptInterpreter::executeAsync |
( |
std::string const & |
script | ) |
|
|
pure virtual |
Execute a script in a seperate thread.
This function returns immediately.
- Parameters
-
script | The script to execute. |
◆ executeFile()
virtual void WScriptInterpreter::executeFile |
( |
std::string const & |
filename | ) |
|
|
pure virtual |
Execute a file.
- Parameters
-
filename | The script file to execute. |
◆ executeFileAsync()
virtual void WScriptInterpreter::executeFileAsync |
( |
std::string const & |
filename | ) |
|
|
pure virtual |
Execute a script file in a seperate thread.
This function returns immediately.
- Parameters
-
filename | The script file to execute. |
◆ getExtension()
virtual std::string const WScriptInterpreter::getExtension |
( |
| ) |
const |
|
pure virtual |
Get the default extension for script file belonging to the script interpreter's language.
- Returns
- The default file extension.
◆ getName()
virtual std::string const WScriptInterpreter::getName |
( |
| ) |
const |
|
pure virtual |
Get the name of the language interpreted by this interpreter.
- Returns
- The name of the script language.
◆ initBindings()
virtual void WScriptInterpreter::initBindings |
( |
| ) |
|
|
pure virtual |
Initialize OpenWalnut-bindings.
These allow OW-classes to be used via the script interpreter.
◆ setParameters()
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".
- Parameters
-
params | The parameters to the script. In our example, they would be "./myscript.py", "param", "1" and "param2". |
The documentation for this class was generated from the following files: