Yate
Public Member Functions | Static Public Member Functions | Protected Member Functions
JsObject Class Reference

Javascript Object. More...

#include <yatescript.h>

Inheritance diagram for JsObject:
ScriptContext RefObject ExpExtender GenObject JsFunction

List of all members.

Public Member Functions

 JsObject (const char *name="Object", Mutex *mtx=0, bool frozen=false)
virtual ~JsObject ()
virtual Mutexmutex ()
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)
virtual ExpOperationpopValue (ObjList &stack, GenObject *context=0)
bool frozen () const
void freeze ()

Static Public Member Functions

static void initialize (ScriptContext *context)

Protected Member Functions

virtual bool runNative (ObjList &stack, const ExpOperation &oper, GenObject *context)

Detailed Description

Javascript Object.

Javascript Object class, base for all JS objects


Constructor & Destructor Documentation

JsObject ( const char *  name = "Object",
Mutex mtx = 0,
bool  frozen = false 
)

Constructor

Parameters:
nameName of the object
mtxPointer to the mutex that serializes this object
frozenTrue if the object is to be frozen from creation
virtual ~JsObject ( ) [virtual]

Destructor


Member Function Documentation

void freeze ( ) [inline]

Freeze the Javascript object preventing external changes to it

bool frozen ( ) const [inline]

Retrieve the object frozen status (cannot modify attributes or methods)

Returns:
True if the object is frozen
static void initialize ( ScriptContext context) [static]

Initialize the standard global objects in a context

Parameters:
contextScript context to initialize
virtual Mutex* mutex ( ) [inline, virtual]

Retrieve the Mutex object used to serialize object access

Returns:
Pointer to the mutex of the context this object belongs to

Implements ScriptContext.

virtual ExpOperation* popValue ( ObjList stack,
GenObject context = 0 
) [virtual]

Pops and evaluate the value of an operand off an evaluation stack, does not pop a barrier

Parameters:
stackEvaluation stack to remove the operand from
contextPointer to arbitrary object to be passed to called methods
Returns:
Value removed from stack, NULL if stack underflow or field not evaluable
virtual bool runAssign ( ObjList stack,
const ExpOperation oper,
GenObject context 
) [virtual]

Try to assign a value to a single field if object is not frozen

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

Reimplemented from ScriptContext.

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

Try to evaluate a single field

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

Reimplemented from ScriptContext.

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

Try to evaluate a single method

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

Reimplemented from ScriptContext.

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

Try to evaluate a single native method

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

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