23 #ifndef _GEMA_VALUE_SET_H_ 24 #define _GEMA_VALUE_SET_H_ 30 #include <QVarLengthArray> 69 bool init(
int numValues,
bool releaseInfoOnError =
false);
75 int numValues()
const { assert(!_vsDataList.isEmpty());
return _vsDataList.first()->numValues(); }
77 bool addValues(
int numAddedValues);
78 void restoreSize(
int oldNumValues);
80 virtual void removeValues(
int index,
int numValues);
89 return accessor(0,
true, desiredUnit, logger, mesh);
94 virtual bool saveState(SaveStateMode mode,
const GmLogCategory& logger);
97 int numSets()
const {
return _vsDataList.size(); }
116 double stateTime(
int snum)
const {
return _timeList.at(t(snum)); }
122 void setStateTime(
int snum,
double time) { _timeList[t(snum)] = time; }
124 #if defined ENABLE_TESTS || defined ENABLE_VALUESET_TESTS 125 virtual void validateInternalStructure();
129 virtual size_t usedMemory()
const;
142 int t(
int index)
const 144 int n = _vsDataList.size();
145 assert(index >= 0 && index < n);
146 return (_info->history() > 0) ? (_currentSet + index) % n : n - index - 1;
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition: gmValueInfo.h:126
QStringList _tagList
A list of tag names associated to each saved state.
Definition: gmValueSet.h:155
Declaration of the GmValueSetData family of classes.
GmValueSetData * vd(int snum) const
Returns the value set data object associated with the given state number.
Definition: gmValueSet.h:139
Values for the new state will copy the old current state values.
Definition: gmValueSet.h:63
GmValueAccessor * accessor(const Unit &desiredUnit, const GmLogCategory &logger, const GmMesh *mesh=NULL)
Returns a locked accessor to the current value set using the desired parameters. Equivalent to callin...
Definition: gmValueSet.h:87
Basic class used to store sets of values, bound to a common definition, on behalf of another object (...
Definition: gmValueSet.h:53
QList< double > _timeList
A list of times associated to each saved state.
Definition: gmValueSet.h:156
void setStateTag(int snum, QString tag)
Updates the tag associated to the given state.
Definition: gmValueSet.h:119
Declaration of usefull configuration definitions for the Core library.
Declaration of the GmValueInfo class.
GmValueInfo * info() const
Returns the metadata associated with this value set.
Definition: gmValueSet.h:72
Values for the new state will be uninitialized.
Definition: gmValueSet.h:61
GmValueSetEvalContext * evalContext() const
Returns the function evalution context associated with this value set (will be NULL if the data set d...
Definition: gmValueSet.h:110
Interface class for accessing and setting values from an "indexable" collection of values.
Definition: gmValueAccessor.h:59
Values for the new state will be set to the ValueSet default.
Definition: gmValueSet.h:62
Auxiliar class used to store the complete set of simulation data.
Definition: gmSimulationData.h:51
QString stateTag(int snum) const
Returns the tag associated to the given state.
Definition: gmValueSet.h:113
int _currentSet
The index of the current set for rolling histories.
Definition: gmValueSet.h:157
GmValueSetData * valueSetData(int sindex, bool locked) const
Returns the value set data object associated with the given index. If locked == true,...
Definition: gmValueSet.h:103
double stateTime(int snum) const
Returns the time associated to the given state.
Definition: gmValueSet.h:116
int numValues() const
Returns the number of values stored in this value set.
Definition: gmValueSet.h:75
GmValueInfo * _info
Metadata defining the value set.
Definition: gmValueSet.h:151
GmValueSetEvalContext * _evalContext
The context used by accessors to evaluate function values (can be NULL)
Definition: gmValueSet.h:152
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
The generic interface implemented by every GmValueSetData object. Its purpose is to provide a base cl...
Definition: gmValueSetData.h:65
int numSets() const
Returns the number of saved states for this set.
Definition: gmValueSet.h:97
GmLogLevel
Available log levels list.
Definition: gmLog.h:36
Auxiliar class used to store the needed information to translate an user function id / user function ...
Definition: gmValueSetEvalContext.h:45
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
SaveStateMode
Initialization mode for calls to saveState()
Definition: gmValueSet.h:59
const QChar at(int position) const const
int t(int index) const
Get the index in _vsDataList corresponding to the given state index.
Definition: gmValueSet.h:142
QList< GmValueSetData * > _vsDataList
The list of value sets.
Definition: gmValueSet.h:154
void setStateTime(int snum, double time)
Updates the time associated to the given state.
Definition: gmValueSet.h:122
Base interface class for Mesh type plugins.
Definition: gmMesh.h:44