DField contains one or more values that are part of a DProtocol. Each value in the DField has the same base type, for example integers or strings. We can specify the number of expected values with setFieldRange, which lets the DProtocol verify that the number of values in received messages is correct.
Create a new DField with the specified name and type. The name is used by DProtocol to refer to this DField. type specifies the type of variable this DField contains. It's one of the following values from the libdasyne::FieldType enumeration:
Unsigned integers: DA_UINT8_T DA_UINT16_T DA_UINT32_T DA_UINT64_T Signed integers: DA_INT8_T DA_INT16_T DA_INT32_T DA_INT64_T Floating-point: DA_FLOAT DA_DOUBLE Variable-length: DA_STRING DA_DBUFFER
Each of the integer types specifies the number of bits in the variable.
Creates a new DField that's a copy of source.
Sets this DField to be a copy of source.
Each of these functions appends newValue to the DField. addDBuffer and addString should be called if the DField type is DA_DBUFFER or DA_STRING, otherwise addValue should be used. If you'd like to add more than one value, call setFieldRange first.
Removes all values from this DField.
These functions set theValue to the value from the specified index. They throw an exception if index is out of bounds.
Returns this DField's unique name, set in the constructor.
Normally, a DField contains exactly one value. setFieldRange lets us create a field that can hold multiple values (maxEntries > 1) or a field that is optional (minEntries == 0).
Returns the number of values currently stored in this field.