|
Yate
|
Javascript Object. More...
#include <yatescript.h>
Public Member Functions | |
| JsObject (const char *name="Object", Mutex *mtx=0, bool frozen=false) | |
| virtual | ~JsObject () |
| virtual Mutex * | mutex () |
| 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 ExpOperation * | popValue (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) |
Javascript Object.
Javascript Object class, base for all JS objects
Constructor
| name | Name of the object |
| mtx | Pointer to the mutex that serializes this object |
| frozen | True if the object is to be frozen from creation |
| virtual ~JsObject | ( | ) | [virtual] |
Destructor
| 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)
| static void initialize | ( | ScriptContext * | context | ) | [static] |
Initialize the standard global objects in a context
| context | Script context to initialize |
Retrieve the Mutex object used to serialize object access
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
| stack | Evaluation stack to remove the operand from |
| context | Pointer to arbitrary object to be passed to called methods |
| 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
| stack | Evaluation stack in use |
| oper | Field to assign to, contains the field name and new value |
| context | Pointer to arbitrary object passed from evaluation methods |
Reimplemented from ScriptContext.
| virtual bool runField | ( | ObjList & | stack, |
| const ExpOperation & | oper, | ||
| GenObject * | context | ||
| ) | [virtual] |
Try to evaluate a single field
| stack | Evaluation stack in use, field value must be pushed on it |
| oper | Field to evaluate |
| context | Pointer to arbitrary object passed from evaluation methods |
Reimplemented from ScriptContext.
| virtual bool runFunction | ( | ObjList & | stack, |
| const ExpOperation & | oper, | ||
| GenObject * | context | ||
| ) | [virtual] |
Try to evaluate a single method
| stack | Evaluation stack in use, parameters are popped off this stack and results are pushed back on stack |
| oper | Function to evaluate |
| context | Pointer to arbitrary object passed from evaluation methods |
Reimplemented from ScriptContext.
| virtual bool runNative | ( | ObjList & | stack, |
| const ExpOperation & | oper, | ||
| GenObject * | context | ||
| ) | [protected, virtual] |
Try to evaluate a single native method
| stack | Evaluation stack in use, parameters are popped off this stack and results are pushed back on stack |
| oper | Function to evaluate |
| context | Pointer to arbitrary object passed from evaluation methods |
1.7.6.1