GemaLuaCoreLib
The GeMA Lua Core library
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GmLuaValueInfo Class Reference

A proxy class to export GmValueInfo methods to the Lua environment. More...

#include <gmLuaValueInfo.h>

Inheritance diagram for GmLuaValueInfo:
Inheritance graph
[legend]
Collaboration diagram for GmLuaValueInfo:
Collaboration graph
[legend]

Public Member Functions

 GmLuaValueInfo (GmValueInfo *info, const GmLogCategory &logger, bool ownership=false)
 Constructor. Receives the ValueInfo to be wrapped.
 
virtual ~GmLuaValueInfo ()
 Destructor.
 
virtual const char * typeName () const
 Returns the object type as will be stored in the object metatable.
 
virtual QString toString () const
 Default method used by the __tostring metamethod to capture the result of tostring() over an object.
 
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 GmValueInfo object.
 
GmValueInfoinfo () const
 Returns a pointer to the internal info object.
 
bool ownership () const
 Returns true if the info object is owned by the proxy object.
 
void takeOwnership ()
 Takes the info ownership from the proxy object.
 
- Public Member Functions inherited from GmLuaObject
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.
 

Private Member Functions

int id (lua_State *L)
 Returns the value id.
 
int description (lua_State *L)
 Returns the value description.
 
int unit (lua_State *L)
 Returns the value unit.
 
int kind (lua_State *L)
 Returns the value kind (see values returned by GmValueInfo::kindStr() for possible values)
 
int isNodeBased (lua_State *L)
 Returns true if the value kind is a node based kind, false otherwise.
 
int storageType (lua_State *L)
 Returns a string describing the data storage type ('double', 'float', 'int32', ...)
 
int dimType (lua_State *L)
 Returns a string describing the dimension type ('scalar', 'vector' or 'matrix')
 
int size (lua_State *L)
 Returns the size (nlin * ncol) of the value type.
 
int nlin (lua_State *L)
 Returns the number of lines in the value.
 
int ncol (lua_State *L)
 Returns the number of columns in the value.
 
int isScalar (lua_State *L)
 Returns true if the value is a scalar value.
 
int defValue (lua_State *L)
 Returns the default value for this value type. This can be a single value, a table or a string (if the default is a function)
 
int canStoreFunctions (lua_State *L)
 Returns true if this value type can store functions.
 
int allocMode (lua_State *L)
 Returns the allocation mode ('sparse', 'full' or 'auto')
 
int allocStrategy (lua_State *L)
 Returns the allocation strategy ('hash', 'linked' 'rle' or 'auto')
 
int affectedNodes (lua_State *L)
 Returns a string describing the affected nodes for node avalues ('geometry', 'ghost' or 'both')
 
int history (lua_State *L)
 Returns false if the object has no history, true for unlimited history and a number for a rolling history.
 
int setHistory (lua_State *L)
 Defines the history mode that this value is bound to. The mode value can be set to false if the object has no history, true for unlimited history and a number for a rolling history.
 
int ruleSet (lua_State *L)
 Returns the integration rule set that this object is bound to if this is a GM_GAUSS_ATTRIBUTE object. Returns nil otherwise.
 
int setRuleSet (lua_State *L)
 Defines the integration rule set that this value is bound to. Used only by values with kind == GM_GAUSS_ATTRIBUTE.
 
int format (lua_State *L)
 Returns the format string applied to this value (in the format width.prec[f|g])
 
int setFormat (lua_State *L)
 Updates the format string used to define how values of this type are printed. Returns true on success.
 
int constMap (lua_State *L)
 Returns a table with the const mapping or nil if none is available.
 
int print (lua_State *L)
 Prints the value info data.
 

Private Attributes

GmValueInfo_info
 The wrapped value info object.
 
bool _ownsInfo
 Are we the owner of _info?
 

Additional Inherited Members

- Protected Member Functions inherited from GmLuaObject
 GmLuaObject (const GmLogCategory &logger)
 Construtor protegido. Somente classes derivadas devem ser instanciadas.
 
- Protected Attributes inherited from GmLuaObject
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.
 

Detailed Description

A proxy class to export GmValueInfo methods to the Lua environment.


The documentation for this class was generated from the following files: