class asIScriptArray { public: // Memory management int AddRef(); int Release(); // Array type int GetArrayTypeId(); // Elements int GetElementTypeId(); asUINT GetElementCount(); void * GetElementPointer(asUINT index); void Resize(asUINT size); int CopyFrom(asIScriptArray *other); };
int AddRef();
This method increases the internal reference counter of the object and returns the count. The returned value shouldn't be used for anything else but debugging.
Call AddRef() each time you assign a reference to a new variable.
The internal reference counter.
int Release();
Decreases the internal reference counter and returns the count. If the counter reaches 0 the object is deleted and the memory is freed.
After calling Release() don't forget to set your reference to 0 so that you don't mistakenly try to use the reference again.
The internal reference counter.
int GetArrayTypeId();
Returns the type id of the script array.
The type id.
int GetElementTypeId();
Use this method to determine the type of the elements and how to handle the pointer returned by GetElementPointer().
The type id of the elements.
asUINT GetElementCount();
Use this method to determine how many elements there are in the array.
The size of the array.
void *GetElementPointer(asUINT index);
The method returns a pointer to the memory location for the element. Use the type id for the element to determine the content of the pointer, and how to handle it.
index |
The zero based index of the element of interest. |
A pointer to the element, or null if out of range.
void Resize(asUINT size);
This method allows the application to resize the array.
size |
The new size of the array. |
int CopyFrom(asIScriptArray *other);
This method copies the contents of the other object to this one.
other |
A pointer to the other array object. |
A negative value on error.