CANCapture Scripting
Public Member Functions | List of all members
asIScriptArray Class Referenceabstract

The interface for a script array object.

Public Member Functions

virtual asIScriptEngineGetEngine () const =0
 Return the script engine. More...
 
virtual int AddRef ()=0
 Increase reference counter. More...
 
virtual int Release ()=0
 Decrease reference counter. More...
 
virtual int GetArrayTypeId ()=0
 Returns the type id of the array object. More...
 
virtual int GetElementTypeId ()=0
 Returns the type id of the contained elements. More...
 
virtual asUINT GetElementCount ()=0
 Returns the size of the array. More...
 
virtual void * GetElementPointer (asUINT index)=0
 Returns a pointer to the element referenced by index. More...
 
virtual void Resize (asUINT size)=0
 Resizes the array. More...
 
virtual int CopyFrom (asIScriptArray *other)=0
 Copies the elements from another array, overwriting the current content. More...
 

Member Function Documentation

virtual int asIScriptArray::AddRef ( )
pure virtual
Returns
The number of references to this object.

Call this method when storing an additional reference to the object.

virtual int asIScriptArray::CopyFrom ( asIScriptArray other)
pure virtual
Parameters
[in]otherA pointer to the source array.
Returns
A negative value on error.
Return values
asINVALID_ARGThe argument is null.
asINVALID_TYPEThe other array is of different type.

This method copies the contents of the other object to this one.

virtual int asIScriptArray::GetArrayTypeId ( )
pure virtual
Returns
The type id of the array object.
virtual asUINT asIScriptArray::GetElementCount ( )
pure virtual
Returns
The number of elements in the array.
virtual void* asIScriptArray::GetElementPointer ( asUINT  index)
pure virtual
Parameters
[in]indexThe element index.
Returns
A pointer to the element value.

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.

virtual int asIScriptArray::GetElementTypeId ( )
pure virtual
Returns
The type id of the array elements.
virtual asIScriptEngine* asIScriptArray::GetEngine ( ) const
pure virtual
Returns
The script engine.
virtual int asIScriptArray::Release ( )
pure virtual
Returns
The number of references to this object.

Call this method when you will no longer use the references that you own.

virtual void asIScriptArray::Resize ( asUINT  size)
pure virtual
Parameters
[in]sizeThe new size of the array.

This method allows the application to resize the array.