![]() |
GemaLuaCoreLib
The GeMA Lua Core library
|
A proxy class to export GmPropertySet methods to the Lua environment. More...
#include <gmLuaPropertySet.h>
Public Member Functions | |
GmLuaPropertySet (GmPropertySet *ps, const GmLogCategory &logger) | |
Constructor. Receives the property set to be wrapped. | |
virtual | ~GmLuaPropertySet () |
Destructor. | |
virtual const char * | typeName () const |
Returns the object type as will be stored in the object metatable. | |
virtual void | fillMetatable (lua_State *L, int index) |
Prepares the object metatable for calling methods. | |
virtual void * | getClassMetatableID () |
Returns an unique identifier to identify an user object as a GmLuaPropertySet object. | |
![]() | |
virtual | ~GmLuaObject () |
Destrutor. | |
virtual void | populateMetatable (lua_State *L, int index) |
Fills the object metatable to allow for the proxy to export its methods. | |
QVariant | ptrToVariant () |
Constructs a QVariant storing a POINTER to the current object. | |
void | ref () |
Increments the object reference count. Use with care. | |
Protected Attributes | |
GmPropertySet * | _ps |
The property set 'wrapped' by this proxy object. | |
![]() | |
const GmLogCategory & | _logger |
A logger used by the proxy when needed. | |
QAtomicInteger< int > | _refCount |
Lua objects are reference counted to enable sharing them among different states. This is needed to allow for passing objects as parameters in a parallel call. The garbage collection method releases memory only for the last reference. | |
Private Member Functions | |
int | id (lua_State *L) |
Returns the property set id. | |
int | numProperties (lua_State *L) |
Returns the number of properties (columns) stored in the set. | |
int | numValues (lua_State *L) |
Returns the number of propertty values (lines) stored in the set. | |
int | propertyIds (lua_State *L) |
Returns a table storing a list with property ids stored in this property set. | |
int | valueIds (lua_State *L) |
Returns a table storing a list with value ids stored in this property set, ordered by line order in the table. | |
int | propertyInfo (lua_State *L) |
Returns a GmLuaValueInfo object with information about the requested property. Returns nil if the requeste value does not exist. More... | |
int | propertyAccessor (lua_State *L) |
Returns an accessor object for querying property values or nil on error. More... | |
int | valueIndex (lua_State *L) |
Returns the line index of the named line in the property set or nil if the name is invalid. More... | |
int | addValues (lua_State *L) |
Add lines to the property set table, optionaly providing their ids. More... | |
Additional Inherited Members | |
![]() | |
GmLuaObject (const GmLogCategory &logger) | |
Construtor protegido. Somente classes derivadas devem ser instanciadas. | |
virtual QString | toString () const |
Default method used by the __tostring metamethod to capture the result of tostring() over an object. | |
A proxy class to export GmPropertySet methods to the Lua environment.
|
private |
Add lines to the property set table, optionaly providing their ids.
Receives as stack parameter the number of added lines and, optionaly, a table with line ids. if present, this table should have size equal to the number of added lines.
Returns the index of the first included property line or nil on errors.
|
private |
Returns an accessor object for querying property values or nil on error.
Receives as stack parameter the name of the desired property and an optional unit in which values should be returned.
|
private |
Returns a GmLuaValueInfo object with information about the requested property. Returns nil if the requeste value does not exist.
Receives as stack parameter the name of the desired property
|
private |
Returns the line index of the named line in the property set or nil if the name is invalid.
Receives as stack parameter the name of the desired property set line