![]() |
Lua Utils
Biblioteca utilitária para facilitar a integração de Lua com C++
|
#include <luaProxy.h>
Public Member Functions | |
LuaSimplePtrProxy (T *obj) | |
virtual | ~LuaSimplePtrProxy () |
Destructor. | |
T * | get () |
void | release () |
Deletes the object stored by this proxy. Further calls to get will return NULL. | |
void * | getClassMetatableID () |
void | populateMetatable (lua_State *L, int index) |
Static Private Member Functions | |
static int | l___gc (lua_State *L) |
Método de coleta de lixo. Deleta o proxy. | |
Private Attributes | |
T * | _obj |
Objeto encapsulado. | |
A class with simmilar semantics as LuaSimpleProxy but storing a pointer to an object that will be DELETED when the Lua object is garbage collected.
|
inline |
Encapsulates the supplied object in a Lua proxy.
|
inline |
|
inlinevirtual |
A scriptable object should return here a unique ID for its class. This will be used to identify the class's metatable once it has been created.
Implements LuaProxy::Base.
|
inlinevirtual |
The value at index in the Lua stack is guaranteed to be a table (which may or may not be empty; see below). This method must fill it with events/metamethods (set functions and tables in the table using strings as keys) so that userdata representing objects of this class will behave appropriately.
For convenience, the metatable will already have an "__index" event set to an empty table, so you can start filling that out immediately.
Hint: Design your classes so that the first thing in the method's body being an invocation of __super::populateMetatable() ensures proper inheritance.
Implements LuaProxy::Base.
Reimplemented in LuaSimpleTypedPtrProxy< T, typeName >.