class JsFunction

Javascript Function. More...

Full nameTelEngine::JsFunction
Definition#include <libs/yscript/yatescript.h>
InheritsTelEngine::JsObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

Javascript Function class, implements user defined functions

 JsFunction (Mutex* mtx = 0)

JsFunction

Constructor

Parameters:
mtxPointer to the mutex that serializes this object

 JsFunction (Mutex* mtx, const char* name, ObjList* args = 0, long int lbl = 0, ScriptCode* code = 0)

JsFunction

Constructor with function name

Parameters:
mtxPointer to the mutex that serializes this object
nameName of the function
argsOptional list of formal parameter names, will be emptied
lblNumber of the entry point label
codeThe script code to be used while running the function

bool  runDefined (ObjList& stack, const ExpOperation& oper, GenObject* context, JsObject* thisObj = 0)

runDefined

[virtual]

Try to evaluate a single user defined 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
thisObjObject that should act as "this" for the function call

Returns: True if evaluation succeeded

inline const ExpFunction*  getFunc ()

getFunc

[const]

Retrieve the ExpFunction matching this Javascript function

Returns: Pointer to ExpFunction representation

inline const String&  firstName ()

firstName

[const]

Retrieve the first name assigned to this function

Returns: The name of the property towhich this function was first assigned

inline void  firstName (const char* name)

firstName

Set the name of this function if still empty

Parameters:
nameName to set as first assigned name

inline const String*  formalName (unsigned int index)

formalName

[const]

Retrieve the name of the N-th formal argument

Parameters:
indexIndex of the formal argument

Returns: Pointer to formal argument name, NULL if index too large

inline long int  label ()

label

[const]

Retrieve the entry label of the code for this function

Returns: Number of the entry point label, zero if no code defined

JsObject*  copy (Mutex* mtx)

copy

[const virtual]

Deep copy method

Parameters:
mtxPointer to the mutex that serializes the copied array

Returns: New object instance, does not keep references to old array

Reimplemented from JsObject.

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

runNative

[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

Reimplemented from JsObject.


Generated by: paulc on bussard on Sun Oct 20 21:06:06 2013, using kdoc 2.0a54.