DataPiece for a single value of type T. The value is stored in DataLayout's fixed size buffer.
More...
#include <DataPieceValue.h>
|
| | DataPieceValue (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) |
| |
| void | setDefault (const T &defaultValue) |
| |
| const T & | getDefault () const |
| |
| void | initToDefault () override |
| | Initialize to default value.
|
| |
| 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 | patchValue (T value) 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 | getPieceIndex () 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 |
| |
|
bool | isMapped () const |
| | Tells if the DataPiece is mapped to another DataPiece in a mapped DataLayout.
|
| |
| virtual bool | stageCurrentValue () |
| |
|
| bool | copyFrom (const DataPiece *original) override |
| | Set or stage value from another piece known to be of the same type.
|
| |
| | DataPiece (string label, DataPieceType type, size_t size) |
| |
|
bool | isMatch (const DataPiece &rhs) const |
| | Match signature only.
|
| |
|
void | setIndexOffset (size_t pieceIndex, size_t offset) |
| |
|
|
const string | label_ |
| |
|
const DataPieceType | pieceType_ |
| |
|
const size_t | fixedSize_ |
| |
|
size_t | pieceIndex_ |
| |
|
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/2]
◆ DataPieceValue() [2/2]
◆ 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.
◆ copyFrom()
template<typename T >
|
|
inlineoverrideprotectedvirtual |
Set or stage value from another piece known to be of the same type.
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()
Get the default value returned by get() when the DataPiece is not mapped.
- Returns
- Default value, or default value for type T.
◆ 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()
◆ initToDefault()
◆ 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.
◆ patchValue()
Patch a value in the mapped DataLayout. This method is named patchValue, because it's meant to edit a DataLayout found in a file, when doing a filter-copy operation.
- Returns
- True if the piece is mapped and the value was set.
◆ 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()
◆ 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. |
The documentation for this class was generated from the following files: