![]() |
Lua Utils
Biblioteca utilitária para facilitar a integração de Lua com C++
|
#include <luaProxy.h>
Public Member Functions | |
virtual void * | getClassMetatableID ()=0 |
virtual void | populateMetatable (lua_State *L, int index)=0 |
Objects may derive from this interface to indicate that they are capable of being added to and manipulated by a Lua state.
|
pure virtual |
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.
Implemented in LuaSimplePtrProxy< T >, and LuaSimpleProxy< T >.
|
pure virtual |
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.
Implemented in LuaSimpleTypedPtrProxy< T, typeName >, LuaSimplePtrProxy< T >, and LuaSimpleProxy< T >.