# class JsArray | Javascript Array. More...
Full name | `TelEngine::JsArray`
Definition | `#include <libs/yscript/yatescript.h>`
Inherits | TelEngine::JsObject [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- JsArray (Mutex* mtx = 0)
- inline JsArray (Mutex* mtx, const char* name, bool frozen = false)
- inline int32_t length () const
- inline void setLength (int32_t len)
- void push (ExpOperation* item)
- virtual JsObject* copy (Mutex* mtx) const
- virtual bool runAssign (ObjList& stack, const ExpOperation& oper, GenObject* context)
- virtual bool runField (ObjList& stack, const ExpOperation& oper, GenObject* context)

#### Protected Methods

- virtual JsObject* clone (const char* name) const
- bool runNative (ObjList& stack, const ExpOperation& oper, GenObject* context)

## Detailed Description

Javascript Array class, implements arrays of items

JsArray (Mutex* mtx = 0) | ### JsArray

Constructor

Parameters:

mtx | Pointer to the mutex that serializes this object

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

Constructor for an empty array

Parameters:

mtx | Pointer to the mutex that serializes this object
name | Full name of the object
frozen | True 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:

len | Length of array to set

void push (ExpOperation* item) | ### push

Add an item at the end of the array

Parameters:

item | Item to add to array

JsObject* copy (Mutex* mtx) | ### copy

[const virtual]

Deep copy method

Parameters:

mtx | Pointer 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:

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

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:

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

Returns: True if evaluation succeeded

Reimplemented from JsObject.

JsObject* clone (const char* name) | ### clone

[protected const virtual]

Clone and rename method

Parameters:

name | Name 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:

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

Returns: True if evaluation succeeded

Reimplemented from JsObject.

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