nidas v1.2.3
|
A VariableIndex associates a Variable pointer with it's index into it's SampleTag. More...
#include <VariableIndex.h>
Public Member Functions | |
VariableIndex () | |
Default constructor creates an invalid VariableIndex: the Variable pointer is null and the index is -1. | |
VariableIndex (Variable *var, int index) | |
Construct a VariableIndex with the given Variable and index. | |
VariableIndex (const VariableIndex &rhs) | |
The copy constructor copies the pointer and index of the given VariableIndex. | |
VariableIndex & | operator= (const VariableIndex &rhs) |
Assign the pointer and index of the given VariableIndex to this instance. | |
bool | operator== (const VariableIndex &rhs) const |
Variable * | variable () |
int | index () |
float | get (float *fdata, float dflt) |
Return the data value at this variable's index into fdata . | |
void | set (float *fdata, float value) |
Set value at this variable's index into fdata . | |
bool | operator! () const |
bool | valid () const |
Private Attributes | |
Variable * | _variable |
int | _index |
A VariableIndex associates a Variable pointer with it's index into it's SampleTag.
Sensor classes can use this to keep a pointer to a Variable and locate the Variable's data in the samples with it's SampleTag. See DSMSensor::findVariableIndex().
A variable's index into the sample tag is not necessarily the same as the offset to the variable's data inside a sample, since the preceding variables may have lengths greater than 1. So this may be a good place to store the data offset also, and then sensor code could be modified to use this class and the offset rather than using simple integer index directly.
This functionality could be rolled into the Variable class, but it would be up to the SampleTag to update the index of all the Variable's whenever the Variable list changes. For now, this class at least allows managing a Variable pointer and index after the SampleTag is finished.
|
inline |
Default constructor creates an invalid VariableIndex: the Variable pointer is null and the index is -1.
Construct a VariableIndex with the given Variable and index.
|
inline |
The copy constructor copies the pointer and index of the given VariableIndex.
Return the data value at this variable's index into fdata
.
If this variable does not have a valid index, then return dflt
.
References _index, and nidas::core::getSample().
Referenced by nidas::dynld::isff::CSI_IRGA_Sonic::process().
|
inline |
References _index.
Referenced by nidas::dynld::isff::NCAR_TRH::convertVariable(), and nidas::dynld::isff::NCAR_TRH::ifanFilter().
|
inline |
Assign the pointer and index of the given VariableIndex to this instance.
|
inline |
Set value
at this variable's index into fdata
.
If this variable does not have a valid index, then nothing is changed.
References _index.
Referenced by nidas::dynld::isff::CSI_IRGA_Sonic::process().
|
inline |
References _index, and _variable.
Referenced by nidas::dynld::isff::NCAR_TRH::convertVariable(), nidas::dynld::isff::NCAR_TRH::ifanFilter(), and nidas::dynld::isff::NCAR_TRH::validate().
|
inline |
References _variable.
Referenced by nidas::dynld::isff::NCAR_TRH::convertVariable(), and nidas::dynld::isff::NCAR_TRH::validate().
|
private |
Referenced by get(), index(), operator!(), operator=(), operator==(), set(), and valid().
|
private |
Referenced by operator!(), operator=(), operator==(), valid(), and variable().