![]() |
VRS
A file format for sensor data.
|
DataPiece map container, with string keys and values of type T. More...
#include <DataPieceStringMap.h>
Public Member Functions | |
DataPieceStringMap (const string &label) | |
DataPieceStringMap (const MakerBundle &bundle) | |
const string & | getElementTypeName () const override |
size_t | getVariableSize () const override |
size_t | collectVariableData (int8_t *data, size_t bufferSize) override |
const map< string, T > & | stagedValues () const |
map< string, T > & | stagedValues () |
void | stage (const map< string, T > &values) |
void | stage (map< string, T > &&values) |
bool | get (map< string, T > &outValues) const |
const map< string, T > & | getDefault () const |
void | setDefault (const map< string, T > &values) |
void | setDefault (map< string, 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 | 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. | |
DataPiece map container, with string keys and values of type T.
Read values are extracted from the DataLayout's buffer, (VRS records reading/decoding). Staged values are stored in the map<string, T> member of this class (VRS record creation).
|
inlineexplicit |
label | Name for the DataPiece. |
|
explicit |
bundle | Bundle to reconstruct a DataPieceStringMap from disk. |
|
inlineoverridevirtual |
Clone data piece.
Implements vrs::DataPiece.
|
overridevirtual |
Copy the staged map to the location given.
data | Pointer where to write the staged values. |
bufferSize | Max number of bytes to write. |
Implements vrs::DataPiece.
bool vrs::DataPieceStringMap< T >::get | ( | map< string, T > & | outValues | ) | const |
Get read values or default values in a map.
outValues | Reference to a map<string, T> for the read or default values. |
|
inline |
Get the default value.
|
inlineoverridevirtual |
Get the name of the element type <T>.
Implements vrs::DataPiece.
|
overridevirtual |
Get the size of the staged map, 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.
|
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.
|
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 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 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 map of values you wish to write to disk. Does not modify the read values!
|
inline |
Read-only access to the map of values you wish to write to disk.
|
inlineoverrideprotectedvirtual |
Stage value from another piece known to be of the same type.
Implements vrs::DataPiece.