![]() |
GemaCoreLib
The GeMA Core library
|
The value set data object for packed data with function support. Very similar to GmFVectorValueSetStoredData. See that class comments for an explanation of the nan box way of storing functions. More...
#include <gmValueSetPackedData.h>


Public Member Functions | |
| GmFValueSetPackedData (GmPackedBuffer *pack, GmValueInfo *info, int state, GmValueSetEvalContext *evalContext) | |
| Constructor. The given pack MUST be an instance of GmPackedBufferImpl<Vector>. It is given as a base class pointer as a convenience for the Value Set class that stores a GmPackedBuffer pointer. Info is the info object for the stored data. State is the state index of this data set in the pack (for data with an associated history). evalContext is a function evaluator. Needed when the default value is a function. | |
| virtual GmTrackedValueAccessor * | accessor (const GmLogCategory &logger, UnitConverter *conv, QString desiredUnit, bool atomic=false) |
| 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. | |
Public Member Functions inherited from GmNoFValueSetPackedData< double, Vector > | |
| GmNoFValueSetPackedData (GmPackedBuffer *pack, GmValueInfo *info, int state) | |
| Constructor. The given pack MUST be an instance of GmPackedBufferImpl<Vector>. It is given as a base class pointer as a convenience for the Value Set class that stores a GmPackedBuffer pointer. Info is the info object for the stored data. State is the state index of this data set in the pack (for data with an associated history) | |
| virtual | ~GmNoFValueSetPackedData () |
| Destructor. | |
| virtual void | packLayoutUpdated () |
| Updates internal pointers to match a layout update inside the pack. | |
| virtual GmPackedBuffer * | pack () const |
| Returns the associated pack object;. | |
| virtual GmValueInfo * | info () const |
| Returns a pointer to the associated value info object. | |
| virtual bool | isDual () const |
| Returns true if the underlying data storage is a dual vector, false if not. | |
| virtual int | numValues () const |
| Returns the number of values stored in this value set. | |
| virtual int | storedItemSize () const |
| 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 size_t | usedMemory () const |
| Memory usage is accounted by the pack and not by the value set data. | |
Public Member Functions inherited from GmValueSetPackedData | |
Public Member Functions inherited from GmValueSetData | |
| virtual | ~GmValueSetData () |
| Virtual destructor. | |
Protected Member Functions | |
| const GmNanBoxedValue * | nanBoxPtr (int index) const |
| Returns a pointer to the index data inside the pack converted to a Nan Box. | |
| GmNanBoxedValue * | nanBoxPtr (int index) |
| Non-const overload to return a pointer to the index data inside the pack converted to a Nan Box. | |
| virtual bool | isDefValue (int index) const |
| Returns true if the indexed value is the default value for the set. | |
| virtual GmValueSetData::StoredValueType | storedValueType (int index) const |
| Returns the type (number, function definition/evaluator) of the stored value for the given index. | |
| virtual const double * | value (int index) const |
| 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) |
| 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 |
| 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, GmValueSetData::StoredValueType type, void *functionObj) |
| Overload of setValue() storing a user function definition. | |
Protected Member Functions inherited from GmNoFValueSetPackedData< double, Vector > | |
| const double * | iptr (int index) const |
| Returns a pointer to the index data inside the pack. | |
| double * | iptr (int index) |
| Non-const overload to return a pointer to the index data inside the pack. | |
Protected Member Functions inherited from GmValueSetData | |
| virtual bool | allValuesAreDef () const |
| Checks that all stored values are equal to the default. | |
Private Attributes | |
| GmUserFunction * | _defFunction |
| The default user function if the default value is a function, NULL otherwise. | |
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... | |
Protected Attributes inherited from GmNoFValueSetPackedData< double, Vector > | |
| GmPackedBufferImpl< Vector > * | _pack |
| The pack that contains the data for this object. | |
| GmValueInfo * | _info |
| The info object describing this set contents. | |
| int | _state |
| The state index number if _info->history() > 0, 0 otherwise. | |
| int | _dim |
| Value dimension. Equal to _info->size();. | |
| char * | _ptr |
| The pointer to the first entry of our data in the pack WHEN Vector is a single vector. | |
| int | _strideOrIndex |
| The "distance" between data entries for Single Vector or the value set index in the pack for Dual vector. | |
| GmTLBuffer< double, GM_VALUESET_ALIGNED_BUFFERS > * | _convBuffer |
| The buffer used to store data returned by value() when T is not double. | |
The value set data object for packed data with function support. Very similar to GmFVectorValueSetStoredData. See that class comments for an explanation of the nan box way of storing functions.
|
virtual |
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.
Reimplemented from GmNoFValueSetPackedData< double, Vector >.
|
protectedvirtual |
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.
Reimplemented from GmNoFValueSetPackedData< double, Vector >.
|
protectedvirtual |
Returns true if the indexed value is the default value for the set.
Reimplemented from GmNoFValueSetPackedData< double, Vector >.
|
protectedvirtual |
Overload of setValue() storing a user function definition.
Receives as parameters the value index, its type (function definition/evaluator) and a pointer to the stored function object (should be either a GmUserFunction or a GmUserFunctionEvaluator object).
Returns false if the data could not be set.
Reimplemented from GmNoFValueSetPackedData< double, Vector >.
|
protectedvirtual |
Updates the value stored at the given index with a numeric value (converted to the correct type if needed)
Returns false if the data could not be set.
Reimplemented from GmNoFValueSetPackedData< double, Vector >.
|
protectedvirtual |
Returns the type (number, function definition/evaluator) of the stored value for the given index.
Reimplemented from GmNoFValueSetPackedData< double, Vector >.
|
protectedvirtual |
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.
VERY IMPORTANT: Since data conversion might be necessary (when the stored data is not in double format), the contents of the pointer returned by value is VALID only until the next call. This behaviour is COMPATIBLE with the general accessor behaviour.
Reimplemented from GmNoFValueSetPackedData< double, Vector >.