DUECA/DUSIME
|
Interaction with the scripting language. More...
#include <ScriptInterpret.hxx>
Public Member Functions | |
size_t | getNumInitFunctions () const |
Get the number of current init functions. | |
void | runCode (const char *code) |
Run a piece of code in the interpreter. | |
ObjectType | getObjectType () const |
Tell that we are a part of the DUECA core. | |
Public Member Functions inherited from dueca::NamedObject | |
const std::string | getEntity () const |
Returns the "entity" part of the name. | |
const std::string | getClass () const |
Returns the "class" part of the name. | |
const std::string | getPart () const |
Returns the sub-entity or "part" part of the name. | |
const NameSet & | getNameSet () const |
This returns the complete name set. | |
const GlobalId & | getId () const |
This returns the id. | |
Static Public Member Functions | |
static ScriptInterpret * | single (ScriptHelper *helper=NULL) |
Return the singleton. | |
static DO_NOT_DOCUMENT void | addInitFunction (voidfunc ifunct) |
static void | addInitFunction (const char *name, const char *parent, voidfunc ifunct) |
Add a new function to the script language. | |
static void | addInitFunction (const InitFunction *ifunct) |
Add a new init function to the script language. | |
Friends | |
class | Environment |
class | NodeManager |
struct | PythonScripting |
struct | SetScriptInitFunction |
void | scheme_inner_main (void *closure, int argc, char **argv) |
void | init_module_dueca () |
Additional Inherited Members | |
Protected Member Functions inherited from dueca::NamedObject | |
NamedObject (const GlobalId &id) | |
Reserve for AssociateObject. | |
NamedObject (const NameSet &ns) | |
Normal constructor, protected, because it has no use to create a NamedObject by itself. | |
virtual | ~NamedObject () |
Destructor. | |
Interaction with the scripting language.
Start and handle scripting in DUECA, either Scheme or Python currently. The ScriptInterpret singleton iss created by the main dueca program. It takes care of appending the configuration information (from a local file) and model information, sent by dueca, or from a local file on node 0, onto a file which is read and interpreted.
This class is used mostly internally by DUECA, however client modules can add init functions (for python scripting) and have the interpreter run pieces of code.
|
static |
ifunct | A void function |
|
static |
Add a new function to the script language.
Anyone can add one, this is the way to make the script extensible with new commands.
name | A descriptive name for the function, used in error messages. |
parent | Parent class, if name is a class, NULL, if no parent. |
ifunct | A void function |
Run a piece of code in the interpreter.
Only do this from the priority 0 thread!
code | Code to run |
boost::python::error_already_set | if a problem occurs. |
|
inlinevirtual |
Tell that we are a part of the DUECA core.
Implements dueca::NamedObject.