![]() |
Lua Utils
Biblioteca utilitária para facilitar a integração de Lua com C++
|
#include <luaProxy.h>
Classes | |
class | Base |
Static Public Member Functions | |
static void | pushObject (lua_State *L, Base *obj) |
static void | pushMetatable (lua_State *L, Base *obj) |
static bool | isObject (lua_State *L, int index) |
static Base * | toObject (lua_State *L, int index) |
template<typename T > | |
static T * | toObjectOfClass (lua_State *L, int index) |
template<typename T > | |
static T * | toObjectOfClass (const QVariant &v) |
template<typename T > | |
static T * | checkObjectOfClass (lua_State *L, int index) |
This class provides static methods to ease exporting Objects to Lua
|
inlinestatic |
If the Lua value at index is a full userdata of type T, uses
toObjectOfClass<T>() to return the object converted to T. If not, emits an error in the same way as those emitted by luaL_checkxxxx()functions.
|
static |
Objects that have been added to the Lua state with pushObject() can be identified with this method.
|
static |
Takes an object pointer and pushes it's metatable onto the Lua stack.
If the object does not have a metattable yet, create's one.
|
static |
Takes an object pointer and pushes it onto the Lua stack as a full userdata with a metatable associated.
|
static |
If the Lua value at index is a full userdata that was added with pushObject(), this method will convert it back into a C++ pointer.
|
inlinestatic |
If the Lua value at index is a full userdata that was added with pushObject(), this template method attempts to convert it back into a C++ pointer of the specified type.
|
inlinestatic |
Converts a QVariant value that contains a LuaProxy::Base* to ano object of class T