23#ifndef _GEMA_VALUE_SET_H_
24#define _GEMA_VALUE_SET_H_
28#include <QVarLengthArray>
69 virtual bool init(
int numValues,
bool releaseInfoOnError =
false);
82 void packLayoutUpdated();
85 int numValues()
const { assert(!_vsDataList.isEmpty());
return _vsDataList.first()->numValues(); }
87 bool addValues(
int numAddedValues);
88 void restoreSize(
int oldNumValues);
90 virtual void removeValues(
int index,
int numValues);
99 return accessor(0,
true, desiredUnit, logger, mesh);
107 int numSets()
const {
return _vsDataList.size(); }
128 double stateTime(
int snum)
const {
return _timeList.at(t(snum)); }
134 void setStateTime(
int snum,
double time) { _timeList[t(snum)] = time; }
136#if defined ENABLE_TESTS || defined ENABLE_VALUESET_TESTS
137 virtual void validateInternalStructure();
141 virtual size_t usedMemory()
const;
154 int t(
int index)
const
156 int n = _vsDataList.size();
157 assert(index >= 0 && index < n);
158 return (_info->history() > 0) ? (_currentSet + index) % n : n - index - 1;
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Base interface class for Mesh type plugins.
Definition gmMesh.h:48
The basic interface for a shared buffer storing interleaved data for a group of value sets.
Definition gmPackedBuffer.h:119
Auxiliar class used to store the complete set of simulation data.
Definition gmSimulationData.h:55
Task manager used for handling parallel executions.
Definition gmTaskManager.h:84
Interface class for accessing and setting values from an "indexable" collection of values.
Definition gmValueAccessor.h:60
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition gmValueInfo.h:132
The generic interface implemented by every GmValueSetData object. Its purpose is to provide a base cl...
Definition gmValueSetData.h:58
Auxiliar class used to store the needed information to translate an user function id / user function ...
Definition gmValueSetEvalContext.h:46
Basic class used to store sets of values, bound to a common definition, on behalf of another object (...
Definition gmValueSet.h:54
GmValueSetEvalContext * _evalContext
The context used by accessors to evaluate function values (can be NULL)
Definition gmValueSet.h:164
void setDataChanged(const GmValueSet *vs)
Signal emitted whenever a state was added to the set by saveState in a rolling history scenario or wh...
QList< GmValueSetData * > _vsDataList
The list of value sets. Stores either GmValueSetStoredData or GmValueSetPackedData pointers depending...
Definition gmValueSet.h:167
SaveStateMode
Initialization mode for calls to saveState()
Definition gmValueSet.h:60
@ VS_INIT_VALUES
Values for the new state will be set to the ValueSet default.
Definition gmValueSet.h:62
@ VS_COPY_VALUES
Values for the new state will copy the old current state values.
Definition gmValueSet.h:63
@ VS_NOINIT_VALUES
Values for the new state will be uninitialized.
Definition gmValueSet.h:61
int t(int index) const
Get the index in _vsDataList corresponding to the given state index.
Definition gmValueSet.h:154
int _currentSet
The index of the current set for rolling histories.
Definition gmValueSet.h:170
void setStateTime(int snum, double time)
Updates the time associated to the given state.
Definition gmValueSet.h:134
void releaseInfo()
Releases the value set hold on the info object by setting it to NULL. Use very carefully for error tr...
Definition gmValueSet.h:77
GmValueSetData * valueSetData(int sindex, bool locked) const
Returns the value set data object associated with the given index. If locked == true,...
Definition gmValueSet.h:115
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:97
QList< double > _timeList
A list of times associated to each saved state.
Definition gmValueSet.h:169
GmPackedBuffer * _pack
The packed buffer containing the data vector if the value set belongs to a pack. NULL otherwise.
Definition gmValueSet.h:166
GmValueSetEvalContext * evalContext() const
Returns the function evalution context associated with this value set (will be NULL if the data set d...
Definition gmValueSet.h:122
double stateTime(int snum) const
Returns the time associated to the given state.
Definition gmValueSet.h:128
QStringList _tagList
A list of tag names associated to each saved state
Definition gmValueSet.h:168
GmValueInfo * info() const
Returns the metadata associated with this value set.
Definition gmValueSet.h:72
QString stateTag(int snum) const
Returns the tag associated to the given state.
Definition gmValueSet.h:125
GmValueSetData * vd(int snum) const
Returns the value set data object associated with the given state number.
Definition gmValueSet.h:151
int numSets() const
Returns the number of saved states for this set.
Definition gmValueSet.h:107
GmPackedBuffer * pack() const
Returns the associated packed buffer if this value set is tied to one. Returns NULL otherwise.
Definition gmValueSet.h:80
int numValues() const
Returns the number of values stored in this value set.
Definition gmValueSet.h:85
void setStateTag(int snum, QString tag)
Updates the tag associated to the given state.
Definition gmValueSet.h:131
GmValueInfo * _info
Metadata defining the value set.
Definition gmValueSet.h:163
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
GmLogLevel
Available log levels list.
Definition gmLog.h:36
Declaration of the GmValueSetData interface.
const QChar at(int position) const const