![]() |
GemaCoreLib
The GeMA Core library
|
The generic GmValueSetData interface for classes that do store their own data. More...
#include <gmValueSetStoredData.h>


Public Member Functions | |
| virtual bool | init (int numValues)=0 |
| Initilizes the value set allocating space. | |
| virtual bool | addValues (int numAddedValues)=0 |
| Adds numAddedValues to the set, initializing them to the default value. Returns true on success, false on error. On errors previous values are kept. | |
| virtual void | restoreSize (int oldNumValues)=0 |
| Restores the size of the set to the previous size before addValues. Can be called with the current size if addValues was not called. | |
| virtual void | removeValues (int index, int numValues)=0 |
| Removes numValues from the set, starting from (and including) index. | |
| virtual void | clear ()=0 |
| Clears the value set, restoring its size to 0. | |
Public Member Functions inherited from GmValueSetData | |
| virtual | ~GmValueSetData () |
| Virtual destructor. | |
| virtual GmValueInfo * | info () const =0 |
| Returns a pointer to the associated value info object. | |
| virtual bool | isDual () const =0 |
| Returns true if the underlying data storage is a dual vector, false if not. | |
| virtual int | numValues () const =0 |
| Returns the number of values stored in this value set. | |
| virtual int | storedItemSize () const =0 |
| Returns the size in bytes of a value set item. It is usually equal to the data dimension (info()->size()) times the size of the data type (info()->sizeofStorageType()), but can be different if the underlying vector type is different from the requested storage type (when function support is requested, for example, all data is stored as double). | |
| virtual GmTrackedValueAccessor * | accessor (const GmLogCategory &logger, UnitConverter *conv, QString desiredUnit, bool atomic=false)=0 |
| Returns an accessor for the stored data. The atomic flag can be used by the caller to request that a protected version of the accessor is needed for multi-threaded cases. | |
| virtual size_t | usedMemory () const =0 |
| Returns an estimative of the memory used by the data set in bytes. | |
Protected Member Functions | |
| virtual int | numDumpBuffers () const =0 |
| Returns the number of internal buffers used by this implementation to hold the data. This buffer(s) can be used for direct dumping / loading the value set data. Returns 0 if the buffer concept is not supported by this class. | |
| virtual char * | dumpBuffer (int i) const =0 |
| Returns the i'th internal buffer, i from 0 to numDumpBuffers()-1. | |
| virtual size_t | dumpBufferSize (int i) const =0 |
| Returns the size in bytes of the i'th internal buffer returned by dumpBuffer(i) | |
Protected Member Functions inherited from GmValueSetData | |
| virtual bool | isDefValue (int index) const =0 |
| Returns true if the indexed value is the default value for the set. | |
| virtual bool | allValuesAreDef () const |
| Checks that all stored values are equal to the default. | |
| virtual StoredValueType | storedValueType (int index) const =0 |
| Returns the type (number, function definition/evaluator) of the stored value for the given index. | |
| virtual const double * | value (int index) const =0 |
| Returns the numeric value stored at the given index (converted to a double if needed) Must be called only for indices storing numeric data. Does NOT evaluate functions. | |
| virtual bool | setValue (int index, const double *values)=0 |
| Updates the value stored at the given index with a numeric value (converted to the correct type if needed) | |
| virtual void * | functionValue (int index) const =0 |
| Returns a pointer to the stored function object. Return will be either a GmUserFunction* or a GmUserFunctionEvaluator* depending on the type returned by storedValueType(index). Must be called only for indices storing data of those types. | |
| virtual bool | setFunctionValue (int index, StoredValueType type, void *functionObj)=0 |
| Overload of setValue() storing a user function definition. | |
Friends | |
| class | GmStateDumpValueSetDataItem |
| class | GmXdmfHdf5 |
| class | GmHdf5ModelWriter |
| class | GmHdf5ModelReader |
Additional Inherited Members | |
Public Types inherited from GmValueSetData | |
| enum | StoredValueType { GM_SVT_NUMBER , GM_SVT_FUNCTION , GM_SVT_FUNCTION_EVAL } |
| Enumeration to detect the type of stored data for an index. More... | |
The generic GmValueSetData interface for classes that do store their own data.
|
pure virtual |
Adds numAddedValues to the set, initializing them to the default value. Returns true on success, false on error. On errors previous values are kept.
Implemented in GmDefValueValueSetStoredData, GmVectorValueSetStoredData< T, Vector >, and GmVectorValueSetStoredData< double, Vector >.
|
pure virtual |
Clears the value set, restoring its size to 0.
Implemented in GmDefValueValueSetStoredData, GmVectorValueSetStoredData< T, Vector >, and GmVectorValueSetStoredData< double, Vector >.
|
protectedpure virtual |
Returns the i'th internal buffer, i from 0 to numDumpBuffers()-1.
Implemented in GmDefValueValueSetStoredData, GmVectorValueSetStoredData< T, Vector >, and GmVectorValueSetStoredData< double, Vector >.
|
protectedpure virtual |
Returns the size in bytes of the i'th internal buffer returned by dumpBuffer(i)
Implemented in GmDefValueValueSetStoredData, GmVectorValueSetStoredData< T, Vector >, and GmVectorValueSetStoredData< double, Vector >.
|
pure virtual |
Initilizes the value set allocating space.
Implemented in GmDefValueValueSetStoredData, GmVectorValueSetStoredData< T, Vector >, and GmVectorValueSetStoredData< double, Vector >.
|
protectedpure virtual |
Returns the number of internal buffers used by this implementation to hold the data. This buffer(s) can be used for direct dumping / loading the value set data. Returns 0 if the buffer concept is not supported by this class.
Implemented in GmDefValueValueSetStoredData, GmVectorValueSetStoredData< T, Vector >, and GmVectorValueSetStoredData< double, Vector >.
|
pure virtual |
Removes numValues from the set, starting from (and including) index.
Implemented in GmDefValueValueSetStoredData, GmVectorValueSetStoredData< T, Vector >, and GmVectorValueSetStoredData< double, Vector >.
|
pure virtual |
Restores the size of the set to the previous size before addValues. Can be called with the current size if addValues was not called.
Implemented in GmDefValueValueSetStoredData, GmVectorValueSetStoredData< T, Vector >, and GmVectorValueSetStoredData< double, Vector >.