![]() |
VRS
A file format for sensor data.
|
Vector of type T and variable size. More...
#include <DataPieceVector.h>
Public Member Functions | |
DataPieceVector (const string &label) | |
DataPieceVector (const MakerBundle &bundle) | |
const string & | getElementTypeName () const override |
size_t | getVariableSize () const override |
size_t | collectVariableData (int8_t *data, size_t bufferSize) override |
const vector< T > & | stagedValues () const |
vector< T > & | stagedValues () |
void | stage (const vector< T > &values) |
void | stage (vector< T > &&values) |
void | stage (const T *values, size_t count) |
template<size_t n> | |
void | stage (const T(&arr)[n]) |
bool | get (vector< T > &outValues) const |
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 | setDefault (vector< T > &&values) |
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 |
bool | stageCurrentValue () override |
unique_ptr< DataPiece > | clone () const override |
void | stage (const string *values, size_t count) |
size_t | getVariableSize () const |
size_t | collectVariableData (int8_t *data, size_t bufferSize) |
bool | get (vector< string > &outValues) const |
void | print (ostream &out, const string &indent) const |
void | printCompact (ostream &out, const string &indent) const |
void | stage (const string *values, size_t count) |
size_t | getVariableSize () const |
size_t | collectVariableData (int8_t *data, size_t bufferSize) |
void | setDefault (const string *defaultValues, size_t count)=delete |
bool | get (vector< string > &outValues) const |
void | print (ostream &out, const string &indent) const |
void | printCompact (ostream &out, const string &indent) const |
![]() | |
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 |
Protected Member Functions | |
bool | stageFrom (const DataPiece *original) 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. | |
Vector of type T and variable size.
Read values are extracted from the DataLayout's buffer, (VRS records reading/decoding). Staged values are stored in the vector<T> member of this class (VRS record creation).
|
inlineexplicit |
label | Name for the DataPiece. |
|
explicit |
bundle | Bundle to reconstruct a DataPieceVector from disk. |
|
inlineoverridevirtual |
Clone data piece.
Implements vrs::DataPiece.
|
virtual |
Copy the staged variable-size to a location.
data | Pointer where to copy the variable-size data. |
bufferSize | Max number of bytes to copy. |
Implements vrs::DataPiece.
|
virtual |
Copy the staged variable-size to a location.
data | Pointer where to copy the variable-size data. |
bufferSize | Max number of bytes to copy. |
Implements vrs::DataPiece.
|
inlineoverridevirtual |
Copy the staged vector to the location given.
data | Pointer where to write the staged values. |
bufferSize | Max number of bytes to write. |
Implements vrs::DataPiece.
|
inline |
Get read values or default values in a vector.
outValues | Reference to a vector<T> for the read or default values. |
|
inline |
Get the default value.
|
inlineoverridevirtual |
Get the name of the element type <T>.
Implements vrs::DataPiece.
|
virtual |
Get the size of variable-size DataPiece staged value.
Implements vrs::DataPiece.
|
virtual |
Get the size of variable-size DataPiece staged value.
Implements vrs::DataPiece.
|
inlineoverridevirtual |
Get the size of the staged vector, if any.
Implements vrs::DataPiece.
|
inlineoverridevirtual |
Tell if the DataPiece is available, directly or mapped successfully.
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.
|
virtual |
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.
|
virtual |
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, 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.
|
virtual |
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.
|
virtual |
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 |
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 the default values.
defaultValues | Pointer to the default values. |
count | Number of default values. |
|
inline |
Set the default values using a C-style fixed size array.
arr | C-style fixed size array of default values. |
|
inline |
Set default values using a vector.
values | Vector of values to use a default. |
|
inline |
Set default values using a vector.
values | Vector of values to use a default. |
|
inline |
Stage an array values.
arr | C-style array. |
count | number of values to stage |
|
inline |
Stage an array of values.
arr | C-style array. |
|
inline |
Stage values you wish to write to disk. Does not modify the read values!
values | Values to stage, to include them in the next record created. |
|
inline |
Stage values you wish to write to disk. Does not modify the read values!
values | Values to stage, to include them in the next record created. |
|
inlineoverridevirtual |
Take the current value of the field, and stage it for writing during record creation.
Reimplemented from vrs::DataPiece.
|
inline |
Set or modify the vector of values you wish to write to disk. Does not modify the read values!
|
inline |
Read-only access to the vector of values you wish to write to disk.
|
inlineoverrideprotectedvirtual |
Stage value from another piece known to be of the same type.
Implements vrs::DataPiece.