#include <ScriptController.h>
Classes | |
struct | Data |
Public Member Functions | |
LuaArray (T *param) | |
LuaArray (int count) | |
LuaArray (const LuaArray< T > ©) | |
~LuaArray () | |
LuaArray< T > & | operator= (const LuaArray< T > &p) |
void | set (unsigned int index, const T *itemPtr) |
operator T * () const | |
T & | operator[] (int index) |
Stores a Lua parameter of an array/pointer type that is passed from Lua to C. Handles automatic cleanup of any temporary memory associated with the array.
gameplay::ScriptUtil::LuaArray< T >::LuaArray | ( | T * | param | ) |
Creates a LuaArray to store a single pointer value.
gameplay::ScriptUtil::LuaArray< T >::LuaArray | ( | int | count | ) |
Allocates a LuaArray to store an array of values.
Individual items in the array can be set using the set(unsigned int, const T&) method.
count | Number of elements to store in the parameter. |
gameplay::ScriptUtil::LuaArray< T >::LuaArray | ( | const LuaArray< T > & | copy | ) |
Copy constructor.
gameplay::ScriptUtil::LuaArray< T >::~LuaArray | ( | ) |
Destructor.
gameplay::ScriptUtil::LuaArray< T >::operator T * | ( | ) | const |
Conversion operator from LuaArray to T*.
LuaArray<T>& gameplay::ScriptUtil::LuaArray< T >::operator= | ( | const LuaArray< T > & | p | ) |
Assignment operator.
T& gameplay::ScriptUtil::LuaArray< T >::operator[] | ( | int | index | ) |
Overloads [] operator to get/set item value at index.
void gameplay::ScriptUtil::LuaArray< T >::set | ( | unsigned int | index, |
const T * | itemPtr | ||
) |
Copies the value of the object pointed to by itemPtr into the specified index of this LuaArray's array.