GemaLuaCoreLib
The GeMA Lua Core library
Loading...
Searching...
No Matches
GmLuaNodeValueAccessor Class Reference

A proxy class to export GmValueAccessor methods to the Lua environment with added support for ghost nodes. Used for mesh node accessors. More...

#include <gmLuaValueAccessor.h>

Inheritance diagram for GmLuaNodeValueAccessor:
Collaboration diagram for GmLuaNodeValueAccessor:

Public Member Functions

 GmLuaNodeValueAccessor (GmValueAccessor *ac, const GmMesh *mesh, const GmLogCategory &logger, bool ownership=true)
 Constructor.
 
virtual const char * typeName () const
 Returns the object type as will be stored in the object metatable.
 
virtual void * getClassMetatableID ()
 Returns an unique identifier to identify an user object as a GmNodeValueAccessor object.
 
virtual void fillMetatable (lua_State *L, int index)
 Prepares the object metatable for calling methods.
 
- Public Member Functions inherited from GmLuaValueAccessor
 GmLuaValueAccessor (GmValueAccessor *ac, const GmLogCategory &logger, bool ownership=true)
 Constructor.
 
- Public Member Functions inherited from GmLuaAccessorIndex< GmValueAccessor, int >
- Public Member Functions inherited from GmLuaAccessorBase< GmValueAccessor >
virtual ~GmLuaAccessorBase ()
 Destructor.
 
virtual QString toString () const
 Default method used by the __tostring metamethod to capture the result of tostring() over an object.
 
GmValueAccessoraccessor () const
 Returns the wrapped accessor.
 
- 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.
 
- Public Member Functions inherited from LuaProxy::Base

Protected Member Functions

virtual int parseIndex (lua_State *L, int stackPos, QString fname) const
 Parses and checks an int index.
 
- Protected Member Functions inherited from GmLuaValueAccessor
- Protected Member Functions inherited from GmLuaAccessorIndex< GmValueAccessor, int >
 GmLuaAccessorIndex (GmValueAccessor *ac, const GmLogCategory &logger, bool ownership)
 Constructor. Receives the ValueAccessor to be wrapped.
 
- Protected Member Functions inherited from GmLuaAccessorBase< GmValueAccessor >
 GmLuaAccessorBase (GmValueAccessor *ac, const GmLogCategory &logger, bool ownership)
 Constructor. Receives the ValueAccessor to be wrapped.
 
void parseCoord (lua_State *L, int stackPos, QString fname, GmVector &coord)
 An auxiliary function used to parse a coordinate table / object from the lua stack.
 
void parseOptions (lua_State *L, int stackPos, Options &opt)
 Aux function to parse print options for the valueStr() call if the object at stackPos is a table.
 
void pushResult (lua_State *L, const double *val)
 Pushes an accessor result on the stack. Value can be pushed as a number (scalar) or as a matrix.
 
- Protected Member Functions inherited from GmLuaObject
 GmLuaObject (const GmLogCategory &logger)
 Construtor protegido. Somente classes derivadas devem ser instanciadas.
 

Protected Attributes

const GmMesh_mesh
 Mesh used to convert node idx.
 
bool _isGhostAc
 Flags stating if the current accessor accepts ghost indices or not.
 
- Protected Attributes inherited from GmLuaAccessorBase< GmValueAccessor >
GmValueAccessor_ac
 The wrapped value accessor object.
 
bool _owner
 Do we own the accessor?
 
- 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.
 

Private Member Functions

int adjustLinearIndex (lua_State *L)
 Returns the adjusted linear index when working with accessors for ghost only data sets.
 

Detailed Description

A proxy class to export GmValueAccessor methods to the Lua environment with added support for ghost nodes. Used for mesh node accessors.

Member Function Documentation

◆ adjustLinearIndex()

int GmLuaNodeValueAccessor::adjustLinearIndex ( lua_State * L)
private

Returns the adjusted linear index when working with accessors for ghost only data sets.

Parameters are the original index and the mesh or the original index and the index of the first mesh ghost node.

Returns nil if the linear index is out of the accessor range (a ghost index for a geometry only accessor or a geometry index for a ghost only accessor).

◆ fillMetatable()

void GmLuaNodeValueAccessor::fillMetatable ( lua_State * L,
int index )
virtual

Prepares the object metatable for calling methods.

Reimplemented from GmLuaValueAccessor.

◆ getClassMetatableID()

virtual void * GmLuaNodeValueAccessor::getClassMetatableID ( )
inlinevirtual

Returns an unique identifier to identify an user object as a GmNodeValueAccessor object.

Reimplemented from GmLuaValueAccessor.

◆ parseIndex()

int GmLuaNodeValueAccessor::parseIndex ( lua_State * L,
int stackPos,
QString fname ) const
protectedvirtual

Parses and checks an int index.

Reimplemented from GmLuaValueAccessor.

◆ typeName()

virtual const char * GmLuaNodeValueAccessor::typeName ( ) const
inlinevirtual

Returns the object type as will be stored in the object metatable.

Reimplemented from GmLuaValueAccessor.


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