lib
Kross::Api::Script Class Reference
#include <script.h>
Inheritance diagram for Kross::Api::Script:

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 .
Definition at line 45 of file 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 QStringList & | getFunctionNames ()=0 |
virtual Kross::Api::Object::Ptr | callFunction (const QString &name, Kross::Api::List::Ptr args)=0 |
virtual const QStringList & | getClassNames ()=0 |
virtual Kross::Api::Object::Ptr | classInstance (const QString &name)=0 |
Protected Attributes | |
Interpreter *const | m_interpreter |
ScriptContainer *const | m_scriptcontainer |
Constructor & Destructor Documentation
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::~Script | ( | ) | [virtual] |
Member Function Documentation
virtual Kross::Api::Object::Ptr Kross::Api::Script::callFunction | ( | const QString & | name, | |
Kross::Api::List::Ptr | args | |||
) | [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.
virtual Kross::Api::Object::Ptr Kross::Api::Script::classInstance | ( | const QString & | name | ) | [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.
void Script::clearException | ( | ) |
Clear previous exceptions.
If called hadException() will return false again.
Definition at line 55 of file script.cpp.
virtual Kross::Api::Object::Ptr Kross::Api::Script::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.
virtual const QStringList& Kross::Api::Script::getClassNames | ( | ) | [pure virtual] |
- Returns:
- a list of classnames.
Implemented in Kross::Python::PythonScript, and Kross::Ruby::RubyScript.
Exception::Ptr Script::getException | ( | ) |
virtual const QStringList& Kross::Api::Script::getFunctionNames | ( | ) | [pure virtual] |
- Returns:
- a list of callable functionnames this script spends.
Implemented in Kross::Python::PythonScript, and Kross::Ruby::RubyScript.
bool Script::hadException | ( | ) |
- Returns:
- true if the script throwed an exception else false.
Definition at line 40 of file script.cpp.
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
Interpreter* const Kross::Api::Script::m_interpreter [protected] |
ScriptContainer* const Kross::Api::Script::m_scriptcontainer [protected] |
The documentation for this class was generated from the following files: