class ScriptContext

Script execution context. More...

Contains pure virtuals
Full nameTelEngine::ScriptContext
Definition#include <libs/yscript/yatescript.h>
InheritsTelEngine::ExpExtender [public ], TelEngine::RefObject [public ]
Inherited byJsArray, JsFunction, JsObject, JsRegExp
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods


Detailed Description

A script execution context, holds global variables and objects

inline explicit  ScriptContext (const char* name = 0)

ScriptContext

Constructor

Parameters:
nameName of the context

inline NamedList&  params ()

params

Access to the NamedList operator

Returns: Reference to the internal named list

inline const NamedList&  params ()

params

[const]

Const access to the NamedList operator

Returns: Reference to the internal named list

NamedList*  nativeParams ()

nativeParams

[const virtual]

Access any native NamedList hold by the context

Returns: Pointer to a native named list

const String&  toString ()

toString

[const virtual]

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

Returns: A reference to the context name

Reimplemented from GenObject.

void*  getObject (const String& name)

getObject

[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.

RefObject*  refObj ()

refObj

[virtual]

Retrieve the reference counted object owning this interface

Returns: Pointer to this script context

Reimplemented from ExpExtender.

Mutex*  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

bool  hasField (ObjList& stack, const String& name, GenObject* context)

hasField

[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.

NamedString*  getField (ObjList& stack, const String& name, GenObject* context)

getField

[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.

void  fillFieldNames (ObjList& names)

fillFieldNames

[virtual]

Fill a list with the unique names of all fields

Parameters:
namesList to which key names must be added

void  fillFieldNames (ObjList& names, const NamedList& list, const char* skip = 0)

fillFieldNames

[static]

Fill a list with the unique names of all fields

Parameters:
namesList to which key names must be added
listList of parameters whose names to be added
skipParameters starting with this prefix will not be added

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

runFunction

[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.

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

runField

[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.

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

runAssign

[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.

bool  copyFields (ObjList& stack, const ScriptContext& original, GenObject* context)

copyFields

[virtual]

Copy all fields from another context

Parameters:
stackEvaluation stack in use
originalScript context to copy from
contextPointer to context data passed from evaluation methods

Returns: True if all fields were copied

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

runMatchingField

Try to evaluate a single field searching for a matching 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


Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.