|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator
Classes | Public Member Functions
gameplay::ScriptUtil::LuaArray< T > Class Template Reference

`#include <ScriptController.h>`

List of all members.

## Classes

struct | Data

## Public Member Functions

| LuaArray (T *param)
| LuaArray (int count)
| LuaArray (const LuaArray< T > &copy)
| ~LuaArray ()
LuaArray< T > & | operator= (const LuaArray< T > &p)
void | set (unsigned int index, const T *itemPtr)
| operator T * () const
T & | operator[] (int index)

## Detailed Description

### template<typename T>
class gameplay::ScriptUtil::LuaArray< T >

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.

## Constructor & Destructor Documentation

template<typename T >

gameplay::ScriptUtil::LuaArray< T >::LuaArray | ( | T * | param | ) |

Creates a LuaArray to store a single pointer value.

template<typename T >

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.

Parameters:

  count | Number of elements to store in the parameter.

template<typename T >

gameplay::ScriptUtil::LuaArray< T >::LuaArray | ( | const LuaArray< T > & | copy | ) |

Copy constructor.

template<typename T >

gameplay::ScriptUtil::LuaArray< T >::~LuaArray | ( |  | ) |

Destructor.

## Member Function Documentation

template<typename T >

gameplay::ScriptUtil::LuaArray< T >::operator T * | ( |  | ) | const

Conversion operator from LuaArray to T*.

template<typename T >

LuaArray<T>& gameplay::ScriptUtil::LuaArray< T >::operator= | ( | const LuaArray< T > & | p | ) |

Assignment operator.

template<typename T >

T& gameplay::ScriptUtil::LuaArray< T >::operator[] | ( | int | index | ) |

Overloads [] operator to get/set item value at index.

template<typename T >

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.

All Classes Functions Variables Typedefs Enumerations Enumerator