|
Yate
|
Script execution context. More...
#include <yatescript.h>
Public Member Functions | |
| ScriptContext (const char *name=0) | |
| NamedList & | params () |
| const NamedList & | params () const |
| virtual NamedList * | nativeParams () const |
| virtual const String & | toString () const |
| virtual void * | getObject (const String &name) const |
| virtual RefObject * | refObj () |
| virtual ScriptMutex * | mutex ()=0 |
| virtual bool | hasField (ObjList &stack, const String &name, GenObject *context) const |
| virtual NamedString * | getField (ObjList &stack, const String &name, GenObject *context) const |
| virtual void | fillFieldNames (ObjList &names) |
| 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 bool | copyFields (ObjList &stack, const ScriptContext &original, GenObject *context) |
| virtual void | addFields (const NamedList &list, const char *skipPrefix="__") |
| bool | runMatchingField (ObjList &stack, const ExpOperation &oper, GenObject *context) |
| virtual void | createdObj (GenObject *obj) |
| virtual void | deletedObj (GenObject *obj) |
| virtual void | trackObjs (unsigned int track=0) |
| virtual ObjList * | countAllocations () |
Public Member Functions inherited from RefObject | |
| RefObject () | |
| virtual | ~RefObject () |
| virtual bool | alive () const |
| bool | ref () |
| bool | deref () |
| int | refcount () const |
| virtual void | destruct () |
Public Member Functions inherited from GenObject | |
| GenObject () | |
| virtual | ~GenObject () |
| virtual const String & | traceId () const |
| NamedCounter * | getObjCounter () const |
| NamedCounter * | setObjCounter (NamedCounter *counter) |
Public Member Functions inherited from ExpExtender | |
| virtual | ~ExpExtender () |
Static Public Member Functions | |
| static void | fillFieldNames (ObjList &names, const NamedList &list, bool checkDupl=true, const char *skip=0) |
| static void | fillFieldNames (ObjList &names, const HashList &list) |
Static Public Member Functions inherited from RefObject | |
| static bool | alive (const RefObject *obj) |
| static bool | efficientIncDec () |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Additional Inherited Members | |
Protected Member Functions inherited from RefObject | |
| virtual void | zeroRefs () |
| bool | resurrect () |
| virtual void | destroyed () |
Script execution context.
A script execution context, holds global variables and objects
|
inlineexplicit |
Constructor
| name | Name of the context |
Referenced by copyFields(), and JsObject::initialize().
|
virtual |
Add string parameters from list
| list | Parameters list |
| skipPrefix | Skip parameters whose name start with specified prefix |
|
virtual |
Copy all fields from another context
| stack | Evaluation stack in use |
| original | Script context to copy from |
| context | Pointer to context data passed from evaluation methods |
References GenObject::GenObject(), and ScriptContext().
|
inlinevirtual |
Retrieve a list of how many objects were allocated at each line
|
inlinevirtual |
Notification that an object was created in this context Used for object tracking purposes
| obj | The created object |
References GenObject::GenObject().
|
inlinevirtual |
Notification that an object was destroyed in this context Used for object tracking purposes
| obj | The destroyed object |
References GenObject::GenObject().
|
virtual |
Fill a list with the unique names of all fields
| names | List to which key names must be added |
Reimplemented in JsObject.
Fill a list with the unique names from a Hash list
| names | List to which key names must be added |
| list | Hash list whose names are to be added |
|
static |
Fill a list with the unique names of all fields
| names | List to which key names must be added |
| list | List of parameters whose names to be added |
| checkDupl | True to ignore duplicates from the given list |
| skip | Parameters starting with this prefix will not be added |
|
virtual |
Get a pointer to a field in the context
| stack | Evaluation stack in use |
| name | Name of the field to retrieve |
| context | Pointer to arbitrary object passed from evaluation methods |
Reimplemented from ExpExtender.
Reimplemented in JsObject.
References GenObject::GenObject().
|
virtual |
Get a pointer to a derived class given that class name
| name | Name of the class we are asking for |
Reimplemented from RefObject.
Check if a certain field is assigned in context
| stack | Evaluation stack in use |
| name | Name of the field to test |
| context | Pointer to arbitrary object passed from evaluation methods |
Reimplemented from ExpExtender.
Reimplemented in JsObject.
References GenObject::GenObject().
|
pure virtual |
|
inlinevirtual |
Access any native NamedList hold by the context
|
inline |
Access to the NamedList operator
Referenced by JsObject::addConstructor(), JsObject::addObject(), JsObject::clearField(), JsObject::setBoolField(), JsObject::setIntField(), JsObject::setObjField(), and JsObject::setStringField().
|
inline |
Const access to the NamedList operator
|
inlinevirtual |
Retrieve the reference counted object owning this interface
Reimplemented from ExpExtender.
References RefObject::RefObject().
|
virtual |
Try to assign a value to a single field
| stack | Evaluation stack in use |
| oper | Field to assign to, contains the field name and new value |
| context | Pointer to context data passed from evaluation methods |
Reimplemented from ExpExtender.
Reimplemented in JsArray, JsObject, and JsRegExp.
References GenObject::GenObject().
|
virtual |
Try to evaluate a single field in the context
| stack | Evaluation stack in use, field value must be pushed on it |
| oper | Field to evaluate |
| context | Pointer to context data passed from evaluation methods |
Reimplemented from ExpExtender.
Reimplemented in JsArray, and JsObject.
References GenObject::GenObject().
|
virtual |
Try to evaluate a single function in the context
| 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 context data passed from evaluation methods |
Reimplemented from ExpExtender.
Reimplemented in JsObject.
References GenObject::GenObject().
| bool runMatchingField | ( | ObjList & | stack, |
| const ExpOperation & | oper, | ||
| GenObject * | context ) |
Try to evaluate a single field searching for a matching context
| stack | Evaluation stack in use, field value must be pushed on it |
| oper | Field to evaluate |
| context | Pointer to context data passed from evaluation methods |
References GenObject::GenObject().
|
inlinevirtual |
Override GenObject's method to return the internal name of the named list
Reimplemented from GenObject.
Referenced by JsObject::clone().
|
inlinevirtual |
Activate object tracking
| track | O for not enabled, non-zero for enabling it |