class JsArray

Javascript Array. More...

Full nameTelEngine::JsArray
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 Array class, implements arrays of items

 JsArray (Mutex* mtx = 0)

JsArray

Constructor

Parameters:
mtxPointer to the mutex that serializes this object

inline  JsArray (Mutex* mtx, const char* name, bool frozen = false)

JsArray

Constructor for an empty array

Parameters:
mtxPointer to the mutex that serializes this object
nameFull name of the object
frozenTrue if the object is to be frozen from creation

inline int32_t  length ()

length

[const]

Retrieve the length of the array

Returns: Number of numerically indexed objects in array

inline void  setLength (int32_t len)

setLength

Set the internal length to a specific value

Parameters:
lenLength of array to set

void  push (ExpOperation* item)

push

Add an item at the end of the array

Parameters:
itemItem to add to array

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  runAssign (ObjList& stack, const ExpOperation& oper, GenObject* context)

runAssign

[virtual]

Try to assign a value to a single field if object is not frozen and update array length. Reimplemented from JsObject

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

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

runField

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

JsObject*  clone (const char* name)

clone

[protected const virtual]

Clone and rename method

Parameters:
nameName of the cloned object

Returns: New object instance

Reimplemented from JsObject.

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

runNative

[protected]

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.