#include <script.h>
Public Member Functions | |
| Script (Interpreter *const interpreter, ScriptContainer *const scriptcontainer) | |
| virtual | ~Script () |
| bool | hadException () |
| Exception::Ptr | getException () |
| void | setException (Exception::Ptr e) |
| void | clearException () |
| virtual Kross::Api::Object::Ptr | execute ()=0 |
| virtual const TQStringList & | getFunctionNames ()=0 |
| virtual Kross::Api::Object::Ptr | callFunction (const TQString &name, Kross::Api::List::Ptr args)=0 |
| virtual const TQStringList & | getClassNames ()=0 |
| virtual Kross::Api::Object::Ptr | classInstance (const TQString &name)=0 |
Protected Attributes | |
| Interpreter *const | m_interpreter |
| ScriptContainer *const | m_scriptcontainer |
Detailed Description
Base class for interpreter dependend functionality each script provides.
Each ScriptContainer holds a pointer to a class that implements the Script functionality for the defined Interpreter .
Constructor & Destructor Documentation
◆ Script()
| Script::Script | ( | Interpreter *const | interpreter, |
| ScriptContainer *const | scriptcontainer | ||
| ) |
Constructor.
- Parameters
-
interpreter The Interpreter instance that uses this Script instance. scriptcontainer The ScriptContainer instance this script is associated with.
Definition at line 29 of file script.cpp.
◆ ~Script()
|
virtual |
Destructor.
Definition at line 36 of file script.cpp.
Member Function Documentation
◆ callFunction()
|
pure virtual |
Call a function.
- Exceptions
-
Exception on error.
- Parameters
-
name The name of the function to execute. args Optional arguments passed to the function.
- Returns
- The result of the called function. Could be NULL.
Implemented in Kross::Python::PythonScript, and Kross::Ruby::RubyScript.
◆ classInstance()
|
pure virtual |
Create and return a new class instance.
- Exceptions
-
Exception on error.
- Parameters
-
name The name of the class to create a instance of.
- Returns
- The new classinstance.
Implemented in Kross::Python::PythonScript, and Kross::Ruby::RubyScript.
◆ clearException()
| void Script::clearException | ( | ) |
Clear previous exceptions.
If called hadException() will return false again.
Definition at line 55 of file script.cpp.
◆ execute()
|
pure virtual |
Execute the script.
- Exceptions
-
Exception on error.
- Returns
- The execution result. Could be NULL too.
Implemented in Kross::Python::PythonScript, and Kross::Ruby::RubyScript.
◆ getClassNames()
|
pure virtual |
- Returns
- a list of classnames.
Implemented in Kross::Python::PythonScript, and Kross::Ruby::RubyScript.
◆ getException()
| Exception::Ptr Script::getException | ( | ) |
- Returns
- the Exception the script throwed.
Definition at line 45 of file script.cpp.
◆ getFunctionNames()
|
pure virtual |
- Returns
- a list of callable functionnames this script spends.
Implemented in Kross::Python::PythonScript, and Kross::Ruby::RubyScript.
◆ hadException()
| bool Script::hadException | ( | ) |
- Returns
- true if the script throwed an exception else false.
Definition at line 40 of file script.cpp.
◆ setException()
| void Script::setException | ( | Exception::Ptr | e | ) |
Set a new exception this script throwed.
- Parameters
-
e The Exception .
Definition at line 50 of file script.cpp.
Member Data Documentation
◆ m_interpreter
|
protected |
The Interpreter used to create this Script instance.
◆ m_scriptcontainer
|
protected |
The ScriptContainer associated with this Script.
The documentation for this class was generated from the following files:
