Yate
Public Member Functions
ScriptContext Class Reference

Script execution context. More...

#include <yatescript.h>

Inheritance diagram for ScriptContext:
RefObject ExpExtender GenObject JsObject JsFunction

List of all members.

Public Member Functions

 ScriptContext (const char *name=0)
NamedListparams ()
const NamedListparams () const
virtual const StringtoString () const
virtual void * getObject (const String &name) const
virtual RefObjectrefObj ()
virtual Mutexmutex ()=0
virtual bool hasField (ObjList &stack, const String &name, GenObject *context) const
virtual NamedStringgetField (ObjList &stack, const String &name, GenObject *context) const
virtual bool runFunction (ObjList &stack, const ExpOperation &oper, GenObject *context)
virtual bool runField (ObjList &stack, const ExpOperation &oper, GenObject *context)
virtual bool runAssign (ObjList &stack, const ExpOperation &oper, GenObject *context)

Detailed Description

Script execution context.

A script execution context, holds global variables and objects


Constructor & Destructor Documentation

ScriptContext ( const char *  name = 0) [inline, explicit]

Constructor

Parameters:
nameName of the context

Member Function Documentation

virtual NamedString* getField ( ObjList stack,
const String name,
GenObject context 
) const [virtual]

Get a pointer to a field in the context

Parameters:
stackEvaluation stack in use
nameName of the field to retrieve
contextPointer to arbitrary object passed from evaluation methods
Returns:
Pointer to field, NULL if not present

Reimplemented from ExpExtender.

virtual void* getObject ( const String name) const [virtual]

Get a pointer to a derived class given that class name

Parameters:
nameName of the class we are asking for
Returns:
Pointer to the requested class or NULL if this object doesn't implement it

Reimplemented from RefObject.

virtual bool hasField ( ObjList stack,
const String name,
GenObject context 
) const [virtual]

Check if a certain field is assigned in context

Parameters:
stackEvaluation stack in use
nameName of the field to test
contextPointer to arbitrary object passed from evaluation methods
Returns:
True if the field is present

Reimplemented from ExpExtender.

virtual Mutex* mutex ( ) [pure virtual]

Retrieve the Mutex object used to serialize object access, if any

Returns:
Pointer to the mutex or NULL if none applies

Implemented in JsObject.

NamedList& params ( ) [inline]

Access to the NamedList operator

Returns:
Reference to the internal named list
const NamedList& params ( ) const [inline]

Const access to the NamedList operator

Returns:
Reference to the internal named list
virtual RefObject* refObj ( ) [inline, virtual]

Retrieve the reference counted object owning this interface

Returns:
Pointer to this script context

Reimplemented from ExpExtender.

virtual bool runAssign ( ObjList stack,
const ExpOperation oper,
GenObject context 
) [virtual]

Try to assign a value to a single field

Parameters:
stackEvaluation stack in use
operField to assign to, contains the field name and new value
contextPointer to context data passed from evaluation methods
Returns:
True if assignment succeeded

Reimplemented from ExpExtender.

Reimplemented in JsObject.

virtual bool runField ( ObjList stack,
const ExpOperation oper,
GenObject context 
) [virtual]

Try to evaluate a single field in the context

Parameters:
stackEvaluation stack in use, field value must be pushed on it
operField to evaluate
contextPointer to context data passed from evaluation methods
Returns:
True if evaluation succeeded

Reimplemented from ExpExtender.

Reimplemented in JsObject.

virtual bool runFunction ( ObjList stack,
const ExpOperation oper,
GenObject context 
) [virtual]

Try to evaluate a single function in the context

Parameters:
stackEvaluation stack in use, parameters are popped off this stack and results are pushed back on stack
operFunction to evaluate
contextPointer to context data passed from evaluation methods
Returns:
True if evaluation succeeded

Reimplemented from ExpExtender.

Reimplemented in JsObject.

virtual const String& toString ( ) const [inline, virtual]

Override GenObject's method to return the internal name of the named list

Returns:
A reference to the context name

Reimplemented from GenObject.


The documentation for this class was generated from the following file: