DataPiece for a single value of type T. The value is stored in DataLayout's fixed size buffer.
More...
#include <DataPieceValue.h>
|
| DataPieceValue (const string &label) |
|
| DataPieceValue (const string &label, T defaultValue) |
|
| DataPieceValue (const MakerBundle &bundle) |
|
const string & | getElementTypeName () const override |
|
size_t | getVariableSize () const override |
|
size_t | collectVariableData (int8_t *, size_t) override |
|
T | get () const |
|
bool | get (T &outValue) const |
|
bool | set (const T &value) |
|
T | getDefault () const |
|
bool | getDefault (T &outDefault) const |
|
void | setDefault (const T &defaultValue) |
|
bool | getProperty (const string &propertyName, T &outValue) const |
|
void | setProperty (const string &propertyName, T value) |
|
bool | getMin (T &outMin) const |
|
bool | getMax (T &outMax) const |
|
bool | getMinIncrement (T &outMinIncrement) const |
|
bool | getMaxIncrement (T &outMaxIncrement) const |
|
void | setMin (T min) |
|
void | setMax (T max) |
|
void | setRange (T min, T max) |
|
void | setMinIncrement (T minIncrement) |
|
void | setMaxIncrement (T maxIncrement) |
|
void | setIncrement (T minIncrement, T maxIncrement) |
|
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 () |
|
|
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) |
|
|
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.
|
|
template<typename T>
class vrs::DataPieceValue< T >
DataPiece for a single value of type T. The value is stored in DataLayout's fixed size buffer.
◆ DataPieceValue() [1/3]
◆ DataPieceValue() [2/3]
◆ DataPieceValue() [3/3]
◆ clone()
Clone data piece.
- Returns
- A clone of the data piece, with the same label and same type. All the other data piece properties (default value and properties) are not cloned.
Implements vrs::DataPiece.
◆ collectVariableData()
Copy staged variable-size data to a specific location. [doesn't apply].
Implements vrs::DataPiece.
◆ get() [1/2]
- Returns
- Value or mapped value, or default value if any, or default value for type T.
◆ get() [2/2]
Get value or mapped value, or default value if any, or default value for type T.
- Parameters
-
outValue | Reference to a variable to set. |
- Returns
- True if outValue was set to the value or the mapped value.
◆ getDefault() [1/2]
Get default value.
- Returns
- Default value, or default value for type T.
◆ getDefault() [2/2]
Get default value.
- Parameters
-
reference | Reference to a default value to set. |
- Returns
- True if the value was set to default value.
◆ getElementTypeName()
◆ getMax()
Get maximum value.
- Parameters
-
outMax | Reference to set to the maximum valid value. |
- Returns
- True if there is maximum value & outMax was set.
◆ getMaxIncrement()
Get maximum increment for this value, between two successive records.
- Parameters
-
outMaxIncrement | Reference to set to the maximum increment value. |
- Returns
- True if there is maximum increment value & outMaxIncrement was set.
◆ getMin()
Get minimum value.
- Parameters
-
outMin | Reference to set to the minimum valid value. |
- Returns
- True if there is minimum value & outMin was set.
◆ getMinIncrement()
Get minimum increment for this value, between two successive records.
- Parameters
-
outMinIncrement | Reference to set to the minimum increment value. |
- Returns
- True if there is minimum increment value & outMinIncrement was set.
◆ getProperty()
Get a property
- Parameters
-
propertyName | Name of the property. |
outValue | Reference to a value to set. |
- Returns
- True if the property exists and outValue was set, false otherwise.
◆ getVariableSize()
◆ isAvailable()
◆ isSame()
Compare two DataPiece objects for their equivalence. Note: the values are not compared, all the other properties are (type, name, tags, etc).
- Parameters
-
- Returns
- True if the DataPiece objects are considered the same.
Reimplemented from vrs::DataPiece.
◆ print()
Print the DataPiece to the out stream, with many details, using indent text at the start of each line of output.
- Parameters
-
out | Output stream to print to. |
indent | Text to insert at the beginning of each output line, for indentation purposes. |
Implements vrs::DataPiece.
◆ printCompact()
Print the DataPiece to the out stream in compact form, using indent text at the start of each line of output.
- Parameters
-
out | Output stream to print to. |
indent | Text to insert at the beginning of each output line, for indentation purposes. |
Implements vrs::DataPiece.
◆ serialize()
Export the DataPiece as json, using a specific profile.
- Parameters
-
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.
◆ set()
Set value in fixed size buffer.
- Parameters
-
- Returns
- False if the DataLayout is mapped, but this DataPiece is not mapped.
◆ setDefault()
Set default value.
- Parameters
-
defaultValue | Value to use as default. |
◆ setIncrement()
Set the min & max increment values, between two successive records.
- Parameters
-
minIncrement | Minimum increment value. |
maxIncrement | Maximum increment value. Note: min & max increment checking is a sanity check operation only. This won't prevents users of the API to set the values any way they want. |
◆ setMax()
Set the maximum valid value.
- Parameters
-
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. |
◆ setMaxIncrement()
Set the maximum increment value, between two successive records.
- Parameters
-
maxIncrement | Maximum increment value. Note: max increment checking is a sanity check operation only. This won't prevents users of the API to set the values any way they want. |
◆ setMin()
Set the minimum valid value.
- Parameters
-
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. |
◆ setMinIncrement()
Set the minimum increment value, between two successive records.
- Parameters
-
minIncrement | Minimum increment value. Note: min increment checking is a sanity check operation only. This won't prevents users of the API to set the values any way they want. |
◆ setProperty()
Set a property.
- Parameters
-
propertyName | Name of the property. |
value | Value of the property. |
◆ setRange()
Set the min & max valid values.
- Parameters
-
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. |
◆ stageFrom()
template<typename T >
|
inlineoverrideprotectedvirtual |
Stage value from another piece known to be of the same type.
Implements vrs::DataPiece.
The documentation for this class was generated from the following files: