OpenWalnut  1.4.0
Public Member Functions
WScriptInterpreter Class Reference

An abstract base class for a script interpreter. More...

#include <WScriptInterpreter.h>

List of all members.

Public Member Functions

virtual ~WScriptInterpreter ()
 Destructor.
virtual void initBindings ()=0
 Initialize OpenWalnut-bindings.
virtual void setParameters (std::vector< std::string > const &params)=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.

Detailed Description

An abstract base class for a script interpreter.

Definition at line 36 of file WScriptInterpreter.h.


Constructor & Destructor Documentation

Destructor.

Definition at line 27 of file WScriptInterpreter.cpp.


Member Function Documentation

virtual void WScriptInterpreter::execute ( std::string const &  line) [pure virtual]

Execute some code.

Parameters:
lineThe code to interpret.
virtual void WScriptInterpreter::executeAsync ( std::string const &  script) [pure virtual]

Execute a script in a seperate thread.

This function returns immediately.

Parameters:
scriptThe script to execute.
virtual void WScriptInterpreter::executeFile ( std::string const &  filename) [pure virtual]

Execute a file.

Parameters:
filenameThe 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.

Parameters:
filenameThe 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.

Returns:
The default file extension.
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.
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".

Parameters:
paramsThe 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: