lib

Kross::Api::Script Class Reference

#include <script.h>

Inheritance diagram for Kross::Api::Script:

Kross::Python::PythonScript Kross::Ruby::RubyScript List of all members.

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]

Destructor.

Definition at line 36 of file script.cpp.


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 (  ) 

Returns:
the Exception the script throwed.

Definition at line 45 of file script.cpp.

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

The Interpreter used to create this Script instance.

Definition at line 128 of file script.h.

The ScriptContainer associated with this Script.

Definition at line 130 of file script.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys