ADTF
|
observable DataDefinition object class for a Element of a StructType. More...
Public Member Functions | |
Element () | |
default CTOR | |
Element (const Element &other) | |
copy CTOR | |
Element (Element &&other) | |
move CTOR | |
Element & | operator= (const Element &other) |
copy assignment operator More... | |
Element & | operator= (Element &&other) |
move assignment operator More... | |
Element (const std::string &name, const std::string &type_name, const DeserializedInfo &deserialized_info, const SerializedInfo &serialized_info, const dd::ArraySize &array_size={}, const std::string &description={}, const std::string &comment={}, const std::string &unit_name={}, const std::string &value={}, const std::string &minimum_value={}, const std::string &maximum_value={}, const std::string &default_value={}, const std::string &scale={}, const std::string &offset={}) | |
CTOR. More... | |
Element (const std::string &name, const std::string &type_name, const DeserializedInfo &deserialized_info, const SerializedInfo &serialized_info, const dd::ArraySize &array_size, const std::string &description, const std::string &comment, const std::string &unit_name, const std::string &value, const std::string &minimum_value, const std::string &maximum_value, const std::string &default_value, const std::string &scale, const std::string &offset, const std::string &valid_element_count) | |
CTOR. More... | |
bool | operator== (const Element &other) const |
equality operator. More... | |
bool | operator!= (const Element &other) const |
non equality operator. More... | |
const std::string & | getName () const |
Get the Name. More... | |
void | setName (const std::string &name) |
Set the Name. More... | |
const std::string & | getTypeName () const |
Get the Type Name. More... | |
void | setTypeName (const std::string &type_name) |
Set the Type Name. More... | |
const std::string & | getDescription () const |
Get the Description. More... | |
void | setDescription (const std::string &description) |
Set the Description. More... | |
const std::string & | getComment () const |
Get the Comment. More... | |
void | setComment (const std::string &comment) |
Set the Comment object. More... | |
const ArraySize & | getArraySize () const |
Get the Array Size. More... | |
void | setArraySize (const ArraySize &array_size) |
Set the Array Size. More... | |
const std::string & | getValidElementCount () const |
Get the Valid Element Count element name. More... | |
void | setValidElementCount (const std::string &valid_element_count) |
Set the Valid Element Count element name. More... | |
const std::string & | getUnitName () const |
Get the Unit Name. More... | |
void | setUnitName (const std::string &unit_name) |
Set the Unit Name. More... | |
const std::string & | getValue () const |
Get the value. More... | |
void | setValue (const std::string &value) |
Set the Value This is only valid if the data type is set to an enum type where this constant value is part of. More... | |
const std::string & | getMin () const |
Get the Min (for information only). More... | |
void | setMin (const std::string &minimum_value) |
Set the Min (for information only). More... | |
const std::string & | getMax () const |
Get the Max (for information only). More... | |
void | setMax (const std::string &maximum_value) |
Set the Max (for information only). More... | |
const std::string & | getDefault () const |
Get the Default object. More... | |
void | setDefault (const std::string &default_value) |
Set the Default Value. More... | |
const std::string & | getScale () const |
Get the Scale (for information only) More... | |
void | setScale (const std::string &scale) |
Set the Scale (for information only) More... | |
const std::string & | getOffset () const |
Get the Offset (for information only) More... | |
void | setOffset (const std::string &offset) |
Set the Offset (for information only) More... | |
Public Member Functions inherited from StructType::SerializedInfo | |
SerializedInfo () | |
default CTOR. | |
SerializedInfo (const SerializedInfo &)=default | |
copy CTOR | |
SerializedInfo (SerializedInfo &&)=default | |
move CTOR | |
SerializedInfo & | operator= (const SerializedInfo &)=default |
copy assignment operator More... | |
SerializedInfo & | operator= (SerializedInfo &&)=default |
move assignment operator More... | |
virtual | ~SerializedInfo ()=default |
DTOR. | |
SerializedInfo (OptionalSize byte_pos, ByteOrder byte_order=ByteOrderDefault::getPlatformDefault(), OptionalSize bit_pos={}, OptionalSize num_bits={}) | |
CTOR. More... | |
SerializedInfo (const std::initializer_list< size_t > &intializer) | |
CTOR with string list initializing. More... | |
bool | operator== (const SerializedInfo &other) const |
equality operator. More... | |
OptionalSize | getBytePos () const |
Get the Byte Pos. More... | |
void | setBytePos (OptionalSize byte_pos, bool prevent_notification=false) |
Set the Byte Pos. More... | |
OptionalSize | getBitPos () const |
Get the Bit Pos (if set) More... | |
void | setBitPos (OptionalSize bit_pos, bool prevent_notification=false) |
Sets the Bit Pos. More... | |
OptionalSize | getNumBits () const |
Get the Num Bits (if set) More... | |
void | setNumBits (OptionalSize num_bits) |
Set the Num Bits. More... | |
ByteOrder | getByteOrder () const |
Get the Byte Order. More... | |
void | setByteOrder (ByteOrder byte_order) |
Set the Byte Order. More... | |
Public Member Functions inherited from StructType::DeserializedInfo | |
DeserializedInfo () | |
Default CTOR. | |
DeserializedInfo (const DeserializedInfo &)=default | |
copy CTOR | |
DeserializedInfo (DeserializedInfo &&)=default | |
move CTOR | |
DeserializedInfo & | operator= (const DeserializedInfo &)=default |
copy assignment operator More... | |
DeserializedInfo & | operator= (DeserializedInfo &&)=default |
move assignment operator More... | |
virtual | ~DeserializedInfo ()=default |
DTOR. | |
DeserializedInfo (size_t alignment) | |
CTOR. More... | |
DeserializedInfo (const std::initializer_list< size_t > &intializer) | |
CTOR. More... | |
bool | operator== (const DeserializedInfo &other) const |
equality operator. More... | |
virtual size_t | getAlignment () const |
Get the Alignment. More... | |
void | setAlignment (size_t alignment) |
Set the Alignment. More... | |
Public Member Functions inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T > | |
ModelSubjectUtility ()=default | |
CTOR. | |
ModelSubjectUtility (const ModelSubjectUtility &) | |
copy CTOR which removes the observers in case of! | |
ModelSubjectUtility & | operator= (const ModelSubjectUtility &) |
copy assignment operator which removes the observers in case of! More... | |
virtual | ~ModelSubjectUtility ()=default |
DTOR. | |
void | attachObserver (observer_type *observer) |
adda a observer to notify. More... | |
void | detachObserver (observer_type *observer) |
remove a observer if in list. More... | |
Public Member Functions inherited from InfoMap | |
InfoMap ()=default | |
CTOR. | |
InfoMap (const InfoMap &) | |
copy CTOR More... | |
InfoMap (InfoMap &&) | |
move CTOR More... | |
InfoMap & | operator= (const InfoMap &) |
copy assignment operator More... | |
InfoMap & | operator= (InfoMap &&) |
move assignment operator More... | |
template<typename INFO_T > | |
const INFO_T * | getInfo () const |
Get the Info Pointer. More... | |
template<typename INFO_T > | |
INFO_T * | getInfo () |
Get the Info Pointer. More... | |
template<typename INFO_T > | |
void | setInfo (const std::shared_ptr< INFO_T > &info) |
Set the Info object as shared pointer. More... | |
Private Member Functions | |
void | notifyChangeSerialized (const std::string &additional_info) override |
notification forwarding of serialized information to the StructType::Element object. More... | |
void | notifyChangeDeserialized (const std::string &additional_info) override |
Forwarding the notification. More... | |
Private Attributes | |
std::string | _name |
std::string | _type_name |
std::string | _description |
std::string | _unit_name |
std::string | _comment |
ArraySize | _array_size = 1 |
std::string | _value |
std::string | _minimum_value |
std::string | _maximum_value |
std::string | _default_value |
std::string | _scale |
std::string | _offset |
Additional Inherited Members | |
Public Types inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T > | |
typedef EVENT_CODE_T | event_code_type |
local definition of the event code type | |
typedef MODEL_SUBJECT_T | subject_type |
local definition of the subject type | |
typedef ModelObserverUtility< MODEL_SUBJECT_T, EVENT_CODE_T > | observer_type |
local definition of the observer type to notify | |
Protected Member Functions inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T > | |
void | notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info) |
helper utility function to notify the current observers More... | |
observable DataDefinition object class for a Element of a StructType.
Definition at line 734 of file datamodel_types.h.
Element | ( | const std::string & | name, |
const std::string & | type_name, | ||
const DeserializedInfo & | deserialized_info, | ||
const SerializedInfo & | serialized_info, | ||
const dd::ArraySize & | array_size = {} , |
||
const std::string & | description = {} , |
||
const std::string & | comment = {} , |
||
const std::string & | unit_name = {} , |
||
const std::string & | value = {} , |
||
const std::string & | minimum_value = {} , |
||
const std::string & | maximum_value = {} , |
||
const std::string & | default_value = {} , |
||
const std::string & | scale = {} , |
||
const std::string & | offset = {} |
||
) |
CTOR.
name | name of the element |
type_name | type name of the element (datatype, enumtype or structtype) |
deserialized_info | the deserialized info (default is a alignment of 1) |
serialized_info | serialized info (default is LE, bytepos will be calculated automatically in typeinfo model) |
array_size | array size of the element (default is 1) for setting dynamic use a string with a valid previous element name |
description | description of the element |
comment | comment of the element |
unit_name | the unit name of the element |
value | a constant value of the element (only valid if the type is set to a enumtype and this value is part of the enumtype elements) |
minimum_value | minimum value (for information only) |
maximum_value | maximum value (for information only) |
default_value | default value can be set for POD types (supported is a interger or a float/double value) |
scale | scale value (for information only) |
offset | offset value (for information only) |
Element | ( | const std::string & | name, |
const std::string & | type_name, | ||
const DeserializedInfo & | deserialized_info, | ||
const SerializedInfo & | serialized_info, | ||
const dd::ArraySize & | array_size, | ||
const std::string & | description, | ||
const std::string & | comment, | ||
const std::string & | unit_name, | ||
const std::string & | value, | ||
const std::string & | minimum_value, | ||
const std::string & | maximum_value, | ||
const std::string & | default_value, | ||
const std::string & | scale, | ||
const std::string & | offset, | ||
const std::string & | valid_element_count | ||
) |
CTOR.
name | name of the element |
type_name | type name of the element (datatype, enumtype or structtype) |
deserialized_info | the deserialized info (default is a alignment of 1) |
serialized_info | serialized info (default is LE, bytepos will be calculated automatically in typeinfo model) |
array_size | array size of the element (default is 1) for setting dynamic use a string with a valid previous element name |
description | description of the element |
comment | comment of the element |
unit_name | the unit name of the element |
value | a constant value of the element (only valid if the type is set to a enumtype and this value is part of the enumtype elements) |
minimum_value | minimum value (for information only) |
maximum_value | maximum value (for information only) |
default_value | default value can be set for POD types (supported is a interger or a float/double value) |
scale | scale value (for information only) |
offset | offset value (for information only) |
valid_element_count | name of the valid element count element name (for arrays) |
const ArraySize& getArraySize | ( | ) | const |
Get the Array Size.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getComment | ( | ) | const |
Get the Comment.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getDefault | ( | ) | const |
Get the Default object.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getDescription | ( | ) | const |
Get the Description.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getMax | ( | ) | const |
Get the Max (for information only).
This was introduced in DDL 3.0.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getMin | ( | ) | const |
Get the Min (for information only).
This was introduced in DDL 3.0.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getName | ( | ) | const |
Get the Name.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getOffset | ( | ) | const |
Get the Offset (for information only)
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getScale | ( | ) | const |
Get the Scale (for information only)
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getTypeName | ( | ) | const |
Get the Type Name.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getUnitName | ( | ) | const |
Get the Unit Name.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getValidElementCount | ( | ) | const |
Get the Valid Element Count element name.
std::string() | if not set |
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
const std::string& getValue | ( | ) | const |
Get the value.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
|
overrideprivatevirtual |
Forwarding the notification.
param std::string string additional_info - the additional info of the item changed notification.
Reimplemented from StructType::DeserializedInfo.
|
overrideprivatevirtual |
notification forwarding of serialized information to the StructType::Element object.
param std::string string additional_info - The name of the additional info in the notification to forward.
Reimplemented from StructType::SerializedInfo.
bool operator!= | ( | const Element & | other | ) | const |
non equality operator.
other | the other element to compare to. |
bool operator== | ( | const Element & | other | ) | const |
equality operator.
other | the other element to compare to. |
void setArraySize | ( | const ArraySize & | array_size | ) |
Set the Array Size.
array_size | the arraysize to set |
void setComment | ( | const std::string & | comment | ) |
Set the Comment object.
comment | the comment to set |
void setDefault | ( | const std::string & | default_value | ) |
Set the Default Value.
This is only valid if the default value is convertable to the datatype used.
default_value | the value for the default. |
void setDescription | ( | const std::string & | description | ) |
Set the Description.
description | the description |
void setMax | ( | const std::string & | maximum_value | ) |
Set the Max (for information only).
maximum_value | the maximum value |
void setMin | ( | const std::string & | minimum_value | ) |
Set the Min (for information only).
minimum_value | the minimum value |
void setName | ( | const std::string & | name | ) |
Set the Name.
name | the name to set |
this | may throw if a element with the same name already exists in the container this element is part of. |
void setOffset | ( | const std::string & | offset | ) |
Set the Offset (for information only)
offset | the offset to set |
void setScale | ( | const std::string & | scale | ) |
Set the Scale (for information only)
scale | the scale factor |
void setTypeName | ( | const std::string & | type_name | ) |
Set the Type Name.
type_name | the type name to set ((POD) datatype, enumtype, structtype). |
void setUnitName | ( | const std::string & | unit_name | ) |
void setValidElementCount | ( | const std::string & | valid_element_count | ) |
void setValue | ( | const std::string & | value | ) |
Set the Value This is only valid if the data type is set to an enum type where this constant value is part of.
value | the constant value to set |