![]() |
VRS
A file format for sensor data.
|
Fixed size array of POD values. More...
#include <DataPieceArray.h>
Public Member Functions | |
DataPieceArray (const string &label, size_t count) | |
template<size_t n> | |
DataPieceArray (const string &label, size_t count, const T(&defaultValues)[n]) | |
DataPieceArray (const MakerBundle &bundle) | |
size_t | getArraySize () const |
Get the size of the array. | |
const string & | getElementTypeName () const override |
size_t | getVariableSize () const override |
size_t | collectVariableData (int8_t *, size_t) override |
bool | get (T *outValues, size_t count) const |
bool | get (T &outValue, size_t index) const |
bool | get (vector< T > &outValues) const |
bool | set (const T *values, size_t count) |
bool | set (const T &value, size_t index) |
template<size_t n> | |
bool | set (const T(&arr)[n]) |
bool | set (const vector< T > &values) |
const vector< T > & | getDefault () const |
void | setDefault (const T *defaultValues, size_t count) |
template<size_t n> | |
void | setDefault (const T(&arr)[n]) |
void | setDefault (const vector< T > &values) |
void | setProperty (const string &propertyName, T value) |
bool | getProperty (const string &propertyName, T &outValue) const |
void | setMin (T min) |
void | setMax (T max) |
void | setRange (T min, T max) |
bool | getMin (T &outMin) const |
bool | getMax (T &outMax) const |
bool | isAvailable () const override |
void | print (ostream &out, const string &indent) const override |
void | printCompact (ostream &out, const string &indent) const override |
bool | isSame (const DataPiece *rhs) const override |
void | serialize (JsonWrapper &jsonWrapper, const JsonFormatProfileSpec &profile) override |
unique_ptr< DataPiece > | clone () const override |
![]() | |
const DataLayout & | getDataLayout () const |
const string & | getLabel () const |
DataPieceType | getPieceType () const |
string | getTypeName () const |
size_t | getOffset () const |
bool | hasFixedSize () const |
size_t | getFixedSize () const |
bool | getTag (const string &tagName, string &outTag) const |
void | setTag (const string &tagName, const string &tag) |
bool | getUnit (string &outUnit) const |
void | setUnit (const string &unit) |
bool | getDescription (string &outDescription) const |
void | setDescription (const string &description) |
void | setRequired (bool required=true) |
bool | isRequired () const |
virtual bool | stageCurrentValue () |
Protected Member Functions | |
bool | stageFrom (const DataPiece *) override |
Stage value from another piece known to be of the same type. | |
![]() | |
DataPiece (const string &label, DataPieceType type, size_t size) | |
bool | isMatch (const DataPiece &rhs) const |
Match signature only. | |
void | setOffset (size_t offset) |
Additional Inherited Members | |
![]() | |
const string | label_ |
const DataPieceType | pieceType_ |
const size_t | fixedSize_ |
size_t | offset_ |
DataLayout & | layout_ |
map< string, string > | tags_ |
bool | required_ |
![]() | |
static const string | kUnit = "unit" |
Special tag name to specify a unit of the DataPiece. | |
static const string | kDescription = "description" |
Special tag name to specify a human readable description the DataPiece. | |
static const string | kMinValue = "min" |
Special property name for the minimum value of the DataPiece. | |
static const string | kMaxValue = "max" |
Special property name for the maximum value of the DataPiece. | |
static const string | kMinIncrement = "min_increment" |
Special property name for the minimum increment of the DataPiece. | |
static const string | kMaxIncrement = "max_increment" |
Special property name for the maximum increment of the DataPiece. | |
Fixed size array of POD values.
Array of type T and fixed size. The array is stored in DataLayout's fixed size buffer. The size of the array is defined at construction and may not change.
|
inline |
label | Name for the DataPiece. |
count | Number of elements in the fixes size-array. |
|
inline |
label | Name for the DataPiece. |
count | Number of elements in the fixes size-array. |
defaultValues | Static array of default values. |
|
explicit |
bundle | Bundle to reconstruct a DataPieceArray from disk. |
|
inlineoverridevirtual |
Clone data piece.
Implements vrs::DataPiece.
|
inlineoverridevirtual |
Copy staged variable-size data to a specific location. [doesn't apply].
Implements vrs::DataPiece.
|
inline |
get specific value in the array, by index.
outValue | Reference to a value to set. |
index | Value requested. |
|
inline |
copy a given number of values to a given location. If not enough values are available, default values are written. If not enough default values are available, T's default constructor is used to fill-in.
outValues | Pointer where to write the data. |
count | Number of values requested. |
|
inline |
Get values or default values.
outValues | Vector to set. |
|
inline |
Get the array's default values.
|
inlineoverridevirtual |
Get the name of the element type <T>.
Implements vrs::DataPiece.
|
inline |
Get maximum value for each element of the array.
outMax | Reference to set to the maximum valid value. |
|
inline |
Get minimum value for each element of the array.
outMin | Reference to set to the minimum valid value. |
|
inline |
Get a property
propertyName | Name of the property. |
outValue | Reference to a value to set. |
|
inlineoverridevirtual |
Get variable-size. 0 here, since this is a fixed size DataPiece. [doesn't apply].
Implements vrs::DataPiece.
|
inlineoverridevirtual |
Tell if a DataPiece value is available.
Implements vrs::DataPiece.
|
overridevirtual |
Compare two DataPiece objects for their equivalence. Note: the values are not compared, all the other properties are (type, name, tags, etc).
rhs | Other DataPiece to compare to. |
Reimplemented from vrs::DataPiece.
|
overridevirtual |
Print the DataPiece to the out stream, with many details, using indent text at the start of each line of output.
out | Output stream to print to. |
indent | Text to insert at the beginning of each output line, for indentation purposes. |
Implements vrs::DataPiece.
|
overridevirtual |
Print the DataPiece to the out stream in compact form, using indent text at the start of each line of output.
out | Output stream to print to. |
indent | Text to insert at the beginning of each output line, for indentation purposes. |
Implements vrs::DataPiece.
|
overridevirtual |
Export the DataPiece as json, using a specific profile.
jsonWrapper | Wrapper around a json type (to isolate any 3rd party library dependency). |
profile | Profile describing what information needs to be exported as json. |
Reimplemented from vrs::DataPiece.
|
inline |
Set one value of the array.
value | Reference to the value to write. |
index | Index of the array element to set. |
|
inline |
Set array values.
values | pointer to values to write. |
count | Number of values to write. |
|
inline |
Set array values.
arr | C-style array. |
|
inline |
Set array values.
values | Vector of values to write. |
|
inline |
Set the array's default values.
defaultValues | Pointer to the first default value. |
count | Number of default values to use. Note: if fewer default values are passed that the size of the array, T's default constructor is used to have the exact count of default values. |
|
inline |
Set the array's default values.
arr | C-style array ot default values. Note: if fewer default values are passed that the size of the array, T's default constructor is used to have the exact count of default values. |
|
inline |
Set the array's default values.
defaultValues | Vector of default values. Note: if fewer default values are passed that the size of the array, T's default constructor is used to have the exact count of default values. |
|
inline |
Set the maximum valid value for each element of the array.
max | Maximum valid value. Note: max checking is a sanity check operation only. Nothing prevents users of the API to set the values of the array any way they want. |
|
inline |
Set the minimum valid value for each element of the array.
min | Minimum valid value. Note: min checking is a sanity check operation only. Nothing prevents users of the API to set the values of the array any way they want. |
|
inline |
Set a property.
propertyName | Name of the property. |
value | Value of the property. |
|
inline |
Set the min & max valid values for each element of the array.
min | Minimum valid value. |
max | Maximum valid value. Note: min/max checking is a sanity check operation only. Nothing prevents users of the API to set the values of the array any way they want. |
|
inlineoverrideprotectedvirtual |
Stage value from another piece known to be of the same type.
Implements vrs::DataPiece.