25#ifndef _GEMALUA_VALUE_ACCESSOR_H_
26#define _GEMALUA_VALUE_ACCESSOR_H_
69 bool evalFunctions, defAsNil;
76 void parseCoord (lua_State* L,
int stackPos,
QString fname,
GmVector& coord);
77 void parseOptions(lua_State* L,
int stackPos,
Options& opt);
78 void pushResult (lua_State* L,
const double* val);
84 int size (lua_State* L);
85 int info (lua_State* L);
86 int isScalar (lua_State* L);
87 int unit (lua_State* L);
88 int valueSize(lua_State* L);
89 int defValue (lua_State* L);
101template <
class T,
class I>
118 int isDefValue (lua_State* L);
119 int isFunction (lua_State* L);
120 int setValue (lua_State* L);
121 int setValueAsDef(lua_State* L);
122 int functionId (lua_State* L);
133 virtual const char*
typeName()
const {
return "valueAccessor"; }
141 int value (lua_State* L);
142 int valueStr(lua_State* L);
145 virtual int parseIndex(lua_State* L,
int stackPos,
QString fname)
const;
155 virtual const char*
typeName()
const {
return "nodeValueAccessor"; }
163 int adjustLinearIndex(lua_State* L);
166 virtual int parseIndex(lua_State* L,
int stackPos,
QString fname)
const;
179 virtual const char*
typeName()
const {
return "cellAccessor"; }
187 int value (lua_State* L);
188 int valueStr(lua_State* L);
191 virtual const GmCell* parseIndex(lua_State* L,
int stackPos,
QString fname)
const;
201 virtual const char*
typeName()
const {
return "gaussAccessor"; }
212 I parseIndex(lua_State* L,
int stackPos,
QString fname)
const;
214 int numPoints (lua_State* L);
215 int isDefValue (lua_State* L);
216 int isFunction (lua_State* L);
217 int value (lua_State* L);
218 int setValue (lua_State* L);
219 int setValueAsDef(lua_State* L);
220 int valueStr (lua_State* L);
221 int functionId (lua_State* L);
232template <
class T,
class B>
239 int isDefValue (lua_State* L);
240 int isFunction (lua_State* L);
241 int setValue (lua_State* L);
242 int setValueAsDef(lua_State* L);
243 int functionId (lua_State* L);
248 int parseIndex1(lua_State* L,
int stackPos,
QString fname)
const;
263 virtual const char*
typeName()
const {
return "bcAccessor"; }
274 I parseIndex2(lua_State* L,
int stackPos,
QString fname)
const;
276 int value (lua_State* L);
277 int valueStr(lua_State* L);
289 virtual const char*
typeName()
const {
return "contactBcAccessor"; }
298 typedef struct {
int ci;
int bci;
int li; }
I;
300 I parseIndex3(lua_State* L,
int stackPos,
QString fname)
const;
302 int value (lua_State* L);
303 int valueStr(lua_State* L);
313 virtual const char*
typeName()
const {
return "discontinuityAccessor"; }
321 int value(lua_State* L);
322 int valueStr(lua_State* L);
A helper class for implementing the common behaviour between GmLuaValueAccessor, GmLuaCellAccessor,...
Definition gmLuaValueAccessor.h:53
bool _owner
Do we own the accessor?
Definition gmLuaValueAccessor.h:81
T * accessor() const
Returns the wrapped accessor.
Definition gmLuaValueAccessor.h:62
T * _ac
The wrapped value accessor object.
Definition gmLuaValueAccessor.h:80
A helper class for implementing the common behaviour between GmLuaValueAccessor, GmLuaCellAccessor an...
Definition gmLuaValueAccessor.h:103
virtual I parseIndex(lua_State *L, int stackPos, QString fname) const =0
Returns the value used as index in accessor calls (either an int, a CmCell* or a GmDiscontinuity*)
A proxy class to export to the Lua environment the common methods between a GmBoundaryConditionAccess...
Definition gmLuaValueAccessor.h:234
const B * _bc
The boundary conditions object used to validate indices in parseIndexX()
Definition gmLuaValueAccessor.h:250
A proxy class to export GmBoundaryConditionAccessor methods to the Lua environment.
Definition gmLuaValueAccessor.h:256
QPair< int, int > I
Type for an object index. Makes the implementation follow closer the one in GmLuaAccessorIndex.
Definition gmLuaValueAccessor.h:272
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaValueAccessor.h:263
GmLuaBoundaryConditionAccessor(GmBoundaryConditionAccessor *ac, const GmBoundaryCondition *bc, const GmLogCategory &logger, bool ownership=true)
Constructor. See comments on the base class.
Definition gmLuaValueAccessor.h:259
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmGaussAccessor object.
Definition gmLuaValueAccessor.h:266
A proxy class to export GmCellAccessor methods to the Lua environment.
Definition gmLuaValueAccessor.h:174
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaValueAccessor.h:179
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmValueAccessor object.
Definition gmLuaValueAccessor.h:182
A proxy class to export GmDiscontinuityAccessor methods to the Lua environment.
Definition gmLuaValueAccessor.h:308
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaValueAccessor.h:313
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmValueAccessor object.
Definition gmLuaValueAccessor.h:316
A proxy class to export GmGaussAccessor methods to the Lua environment.
Definition gmLuaValueAccessor.h:196
GmElementMesh * _mesh
The associated mesh. Used by parseIndex to validate integration points.
Definition gmLuaValueAccessor.h:223
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaValueAccessor.h:201
QPair< const GmCell *, int > I
Type for an object index. Makes the implementation follow closer the one in GmLuaAccessorIndex.
Definition gmLuaValueAccessor.h:210
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmGaussAccessor object.
Definition gmLuaValueAccessor.h:204
A proxy class to export GmValueAccessor methods to the Lua environment with added support for ghost n...
Definition gmLuaValueAccessor.h:150
bool _isGhostAc
Flags stating if the current accessor accepts ghost indices or not.
Definition gmLuaValueAccessor.h:169
const GmMesh * _mesh
Mesh used to convert node idx.
Definition gmLuaValueAccessor.h:168
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaValueAccessor.h:155
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmNodeValueAccessor object.
Definition gmLuaValueAccessor.h:158
A proxy class to export object methods to the Lua environment.
Definition gmLuaObject.h:36
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...
A proxy class to export GmValueAccessor methods to the Lua environment. Use by property sets only.
Definition gmLuaValueAccessor.h:128
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmValueAccessor object.
Definition gmLuaValueAccessor.h:136
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition gmLuaValueAccessor.h:133
Declaration of the GmLuaObject class.
Options for valueStr()
Definition gmLuaValueAccessor.h:68