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

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

#include <gmLuaValueAccessor.h>

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

Public Member Functions

 GmLuaBoundaryConditionAccessor (GmBoundaryConditionAccessor *ac, const GmBoundaryCondition *bc, const GmLogCategory &logger, bool ownership=true)
 Constructor. See comments on the base class.
 
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 GmGaussAccessor object.
 
virtual void fillMetatable (lua_State *L, int index)
 Prepares the object metatable for calling methods.
 
- Public Member Functions inherited from GmLuaAccessorBase< GmBoundaryConditionAccessor >
virtual ~GmLuaAccessorBase ()
 Destructor.
 
virtual QString toString () const
 Default method used by the __tostring metamethod to capture the result of tostring() over an object.
 
GmBoundaryConditionAccessoraccessor () 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.
 

Private Types

typedef QPair< int, int > I
 Type for an object index. Makes the implementation follow closer the one in GmLuaAccessorIndex.
 

Private Member Functions

I parseIndex2 (lua_State *L, int stackPos, QString fname) const
 Parses and checks an index based on a bcIndex + listIndex number.
 
int value (lua_State *L)
 Returns the scalar, vector or matrix value at the specified index, calculated at the specified coordinate, if available and the value is a function that requires an element coordinate. More...
 
int valueStr (lua_State *L)
 Returns the value at the given index converted to a string (even for multivalued values). More...
 

Additional Inherited Members

- Protected Member Functions inherited from GmLuaBCAccessor< GmBoundaryConditionAccessor, GmBoundaryCondition >
 GmLuaBCAccessor (GmBoundaryConditionAccessor *ac, const GmBoundaryCondition *bc, const GmLogCategory &logger, bool ownership)
 Constructor. Receives the BoundaryConditionAccessor or ContactBoundaryConditionAccessor to be wrapped. More...
 
int parseIndex1 (lua_State *L, int stackPos, QString fname) const
 Parses and checks an index based on boundary condition index.
 
- Protected Member Functions inherited from GmLuaAccessorBase< GmBoundaryConditionAccessor >
 GmLuaAccessorBase (GmBoundaryConditionAccessor *ac, const GmLogCategory &logger, bool ownership)
 Constructor. Receives the ValueAccessor to be wrapped. More...
 
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. More...
 
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 inherited from GmLuaBCAccessor< GmBoundaryConditionAccessor, GmBoundaryCondition >
const GmBoundaryCondition_bc
 The boundary conditions object used to validate indices in parseIndexX()
 
- Protected Attributes inherited from GmLuaAccessorBase< GmBoundaryConditionAccessor >
GmBoundaryConditionAccessor_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.
 

Detailed Description

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

Member Function Documentation

◆ value()

int GmLuaBoundaryConditionAccessor::value ( lua_State *  L)
private

Returns the scalar, vector or matrix value at the specified index, calculated at the specified coordinate, if available and the value is a function that requires an element coordinate.

Stack parameters: index (bcIndex + listIndex), optional coordinate (either a table or an object).

IMPORTANT: Following Lua spirit, the boundary condition indices are ONE based (and not zero based as in C)

The coordinate value is optional. If present it can be a lua table or a vector object.

The returned value can be a single number for scalar values or a vector/matrix object for other value types.

◆ valueStr()

int GmLuaBoundaryConditionAccessor::valueStr ( lua_State *  L)
private

Returns the value at the given index converted to a string (even for multivalued values).

Stack parameters: index(bcIndex + listIndex), optional coord (either a table or an object), optional options table. IMPORTANT: Following Lua spirit, the boundary condition indices ares ONE based (and not zero based as in C)

The options table can have the following optional fields: evalFunctions – Should we evaluate functions or do we print its name? Default = false defNil – Should we print default values as 'nil'? Default = false format – Printf like format string (ex: '12.4f')


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