24#ifndef _GEMALUA_OBJECT_H_
25#define _GEMALUA_OBJECT_H_
30#include <QAtomicInteger>
46 void ref() { _refCount.ref(); }
74 int gc (lua_State* L);
75 int tostring(lua_State* L);
A proxy class to export object methods to the Lua environment.
Definition gmLuaObject.h:36
const GmLogCategory & _logger
A logger used by the proxy when needed.
Definition gmLuaObject.h:62
virtual QString toString() const
Default method used by the __tostring metamethod to capture the result of tostring() over an object.
Definition gmLuaObject.h:55
virtual void fillMetatable(lua_State *L, int index)=0
Function called by populateMetatable() to fill the metatable with exported methods by derived classes...
void ref()
Increments the object reference count. Use with care.
Definition gmLuaObject.h:46
QVariant ptrToVariant()
Constructs a QVariant storing a POINTER to the current object.
Definition gmLuaObject.h:43
QAtomicInteger< int > _refCount
Lua objects are reference counted to enable sharing them among different states. This is needed to al...
Definition gmLuaObject.h:69
virtual const char * typeName() const =0
Returns the object type as will be stored in the object metatable.
virtual void populateMetatable(lua_State *L, int index)=0
Declaration of the function used to prepare an environment with the core Lua functions.
void setValue(const T &value)