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);
101 template <
class T,
class I>
115 virtual I parseIndex(lua_State* L,
int stackPos,
QString fname)
const = 0;
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 adjustLinearIndex(lua_State* L);
142 int value (lua_State* L);
143 int valueStr (lua_State* L);
158 virtual const char*
typeName()
const {
return "cellAccessor"; }
166 int value (lua_State* L);
167 int valueStr(lua_State* L);
180 virtual const char*
typeName()
const {
return "gaussAccessor"; }
191 I parseIndex(lua_State* L,
int stackPos,
QString fname)
const;
193 int numPoints (lua_State* L);
194 int isDefValue (lua_State* L);
195 int isFunction (lua_State* L);
196 int value (lua_State* L);
197 int setValue (lua_State* L);
198 int setValueAsDef(lua_State* L);
199 int valueStr (lua_State* L);
200 int functionId (lua_State* L);
211 template <
class T,
class B>
218 int isDefValue (lua_State* L);
219 int isFunction (lua_State* L);
220 int setValue (lua_State* L);
221 int setValueAsDef(lua_State* L);
222 int functionId (lua_State* L);
227 int parseIndex1(lua_State* L,
int stackPos,
QString fname)
const;
242 virtual const char*
typeName()
const {
return "bcAccessor"; }
253 I parseIndex2(lua_State* L,
int stackPos,
QString fname)
const;
255 int value (lua_State* L);
256 int valueStr(lua_State* L);
268 virtual const char*
typeName()
const {
return "contactBcAccessor"; }
277 typedef struct {
int ci;
int bci;
int li; }
I;
279 I parseIndex3(lua_State* L,
int stackPos,
QString fname)
const;
281 int value (lua_State* L);
282 int valueStr(lua_State* L);
292 virtual const char*
typeName()
const {
return "discontinuityAccessor"; }
300 int value(lua_State* L);
301 int valueStr(lua_State* L);
T * accessor() const
Returns the wrapped accessor.
Definition: gmLuaValueAccessor.h:62
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition: gmLuaValueAccessor.h:242
A proxy class to export GmGaussAccessor methods to the Lua environment.
Definition: gmLuaValueAccessor.h:174
Declaration of the GmLuaObject class.
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*)
T * _ac
The wrapped value accessor object.
Definition: gmLuaValueAccessor.h:80
virtual void fillMetatable(lua_State *L, int index)
Prepares the object metatable for calling methods.
Definition: gmLuaValueAccessor.cpp:98
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmValueAccessor object.
Definition: gmLuaValueAccessor.h:295
A helper class for implementing the common behaviour between GmLuaValueAccessor, GmLuaCellAccessor an...
Definition: gmLuaValueAccessor.h:102
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmGaussAccessor object.
Definition: gmLuaValueAccessor.h:245
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmValueAccessor object.
Definition: gmLuaValueAccessor.h:161
virtual void fillMetatable(lua_State *L, int index)
Prepares the object metatable for calling methods.
Definition: gmLuaValueAccessor.cpp:260
A proxy class to export GmValueAccessor methods to the Lua environment.
Definition: gmLuaValueAccessor.h:127
Options for valueStr()
Definition: gmLuaValueAccessor.h:68
A proxy class to export GmDiscontinuityAccessor methods to the Lua environment.
Definition: gmLuaValueAccessor.h:286
QPair< int, int > I
Type for an object index. Makes the implementation follow closer the one in GmLuaAccessorIndex.
Definition: gmLuaValueAccessor.h:251
GmLuaBoundaryConditionAccessor(GmBoundaryConditionAccessor *ac, const GmBoundaryCondition *bc, const GmLogCategory &logger, bool ownership=true)
Constructor. See comments on the base class.
Definition: gmLuaValueAccessor.h:238
A proxy class to export to the Lua environment the common methods between a GmBoundaryConditionAccess...
Definition: gmLuaValueAccessor.h:212
virtual void fillMetatable(lua_State *L, int index)=0
Function called by populateMetatable() to fill the metatable with exported methods by derived classes...
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition: gmLuaValueAccessor.h:180
A proxy class to export GmBoundaryConditionAccessor methods to the Lua environment.
Definition: gmLuaValueAccessor.h:234
QPair< const GmCell *, int > I
Type for an object index. Makes the implementation follow closer the one in GmLuaAccessorIndex.
Definition: gmLuaValueAccessor.h:189
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition: gmLuaValueAccessor.h:133
virtual void fillMetatable(lua_State *L, int index)
Prepares the object metatable for calling methods.
Definition: gmLuaValueAccessor.cpp:1022
bool _isGhostAc
Flags stating if the current accessor accepts ghost indices or not.
Definition: gmLuaValueAccessor.h:148
GmElementMesh * _mesh
The associated mesh. Used by parseIndex to validate integration points.
Definition: gmLuaValueAccessor.h:202
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmValueAccessor object.
Definition: gmLuaValueAccessor.h:136
const B * _bc
The boundary conditions object used to validate indices in parseIndexX()
Definition: gmLuaValueAccessor.h:229
bool _owner
Do we own the accessor?
Definition: gmLuaValueAccessor.h:81
virtual QString toString() const
Default method used by the __tostring metamethod to capture the result of tostring() over an object.
Definition: gmLuaObject.h:55
A proxy class to export object methods to the Lua environment.
Definition: gmLuaObject.h:35
virtual void * getClassMetatableID()
Returns an unique identifier to identify an user object as a GmGaussAccessor object.
Definition: gmLuaValueAccessor.h:183
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition: gmLuaValueAccessor.h:292
A helper class for implementing the common behaviour between GmLuaValueAccessor, GmLuaCellAccessor,...
Definition: gmLuaValueAccessor.h:52
A proxy class to export GmCellAccessor methods to the Lua environment.
Definition: gmLuaValueAccessor.h:152
virtual const char * typeName() const
Returns the object type as will be stored in the object metatable.
Definition: gmLuaValueAccessor.h:158