ADTF  3.18.3
DDElement

Utility class for a complete valid data definition of one StructType::Element and its dependencies. More...

Public Types

using Deserialized = dd::datamodel::StructType::DeserializedInfo
 Deserialized definiton for one element.
 
using Serialized = dd::datamodel::StructType::SerializedInfo
 Serialized definiton for one element.
 

Public Member Functions

 DDElement ()=default
 Construct a new DDElement object.
 
 DDElement (DDElement &&)=default
 Construct a new DDElement object.
 
 DDElement (const DDElement &)=default
 Construct a new DDElement object.
 
DDElementoperator= (DDElement &&)=default
 assignment move operator More...
 
DDElementoperator= (const DDElement &)=default
 assignment copy operator More...
 
 ~DDElement ()=default
 Destroy the DDElement object.
 
 DDElement (const std::string &name, const dd::DataType &data_type, const Deserialized &deserialized_info={}, const Serialized &serialized_info={}, const dd::ArraySize &array_size=1, const std::string &description={}, const std::string &comment={}, const dd::BaseUnit &base_unit={}, const std::string &minimum_value={}, const std::string &maximum_value={}, const std::string &default_value={}, const std::string &scale={}, const std::string &offset={})
 Construct a new DDElement object that uses a POD Type (dd::DataType) Use it like: More...
 
 DDElement (const std::string &name, const dd::DataType &data_type, const Deserialized &deserialized_info, const Serialized &serialized_info, const dd::ArraySize &array_size, const std::string &description, const std::string &comment, const DDUnit &unit, const std::string &minimum_value={}, const std::string &maximum_value={}, const std::string &default_value={}, const std::string &scale={}, const std::string &offset={})
 Construct a new DDElement object that uses a POD Type (dd::DataType) Use it like: More...
 
 DDElement (const std::string &name, const DDDataType &data_type, const Deserialized &deserialized_info={}, const Serialized &serialized_info={}, const dd::ArraySize &array_size=1, const std::string &description={}, const std::string &comment={}, const dd::BaseUnit &base_unit={}, const std::string &minimum_value={}, const std::string &maximum_value={}, const std::string &default_value={}, const std::string &scale={}, const std::string &offset={})
 Construct a new DDElement object that uses a POD Type (dd::DataType) Use it like: More...
 
 DDElement (const std::string &name, const DDDataType &data_type, const Deserialized &deserialized_info, const Serialized &serialized_info, const dd::ArraySize &array_size, const std::string &description, const std::string &comment, const DDUnit &unit, const std::string &minimum_value={}, const std::string &maximum_value={}, const std::string &default_value={}, const std::string &scale={}, const std::string &offset={})
 Construct a new DDElement object that uses a POD Type (dd::DataType) Use it like: More...
 
 DDElement (const std::string &name, const DDEnum &enum_type, const Deserialized &deserialized_info={}, const Serialized &serialized_info={}, const dd::ArraySize &array_size=1, const std::string &description={}, const std::string &comment={}, const dd::BaseUnit &base_unit={}, 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={})
 Construct a new DDElement object that uses a Enum Type (dd::EnumType) Use it like: More...
 
 DDElement (const std::string &name, const DDEnum &enum_type, const Deserialized &deserialized_info, const Serialized &serialized_info, const dd::ArraySize &array_size, const std::string &description, const std::string &comment, const DDUnit &unit, 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={})
 Construct a new DDElement object that uses a Enum Type (dd::EnumType) Use it like: More...
 
 DDElement (const std::string &name, const DDStructure &structure_type, const Deserialized &deserialized_info={}, const Serialized &serialized_info={}, const dd::ArraySize &array_size=1, const std::string &description={}, const std::string &comment={})
 Construct a new DDElement object that uses a Enum Type (dd::EnumType) Use it like: More...
 
const dd::StructType::ElementgetElement () const
 Get the Element object. More...
 
const dd::DataDefinitiongetDD () const
 retrieves a valid DataDefinition for the elements datatypes and units. More...
 

Private Attributes

dd::DataDefinition _dd
 
dd::StructType::Element _element
 

Detailed Description

Utility class for a complete valid data definition of one StructType::Element and its dependencies.

This class is for convenience to use it together with ddl::DDStructure .

See also
ddl::DDStructure.

Definition at line 36 of file ddelement.h.

Constructor & Destructor Documentation

◆ DDElement() [1/7]

DDElement ( const std::string &  name,
const dd::DataType data_type,
const Deserialized deserialized_info = {},
const Serialized serialized_info = {},
const dd::ArraySize array_size = 1,
const std::string &  description = {},
const std::string &  comment = {},
const dd::BaseUnit base_unit = {},
const std::string &  minimum_value = {},
const std::string &  maximum_value = {},
const std::string &  default_value = {},
const std::string &  scale = {},
const std::string &  offset = {} 
)

Construct a new DDElement object that uses a POD Type (dd::DataType) Use it like:

ddl::DDStructure dd_struct("StructType");
dd_struct.addElement(ddl::DDElement("element_name", ddl::DataType<uint32_t>()));
Utility class for a complete valid data definition of one StructType::Element and its dependencies.
Definition: ddelement.h:36
Utility class for a complete valid data definition of one StructType and its dependencies.
Definition: ddstructure.h:55
Generator template to create DataType for the plain c-types.
Parameters
nameName of the element.
data_typeData Type of the element. Use dd::DataType template.
deserialized_infodeserialized information (will be set by default to the alignment of data_type).
serialized_infoserialized information of this element (will be set automatically to the next valid bytepos depending on previous elements).
array_sizearray size of the element
descriptiondescription of the element
commentcomment of the element
base_unitbase_unit of the element to use
minimum_valueminimum value of the element
maximum_valuemaximum value of the element
default_valuedefault value (mind! should fit to the data_type)
scalescale of the element
offsetoffset of the value

◆ DDElement() [2/7]

DDElement ( const std::string &  name,
const dd::DataType data_type,
const Deserialized deserialized_info,
const Serialized serialized_info,
const dd::ArraySize array_size,
const std::string &  description,
const std::string &  comment,
const DDUnit unit,
const std::string &  minimum_value = {},
const std::string &  maximum_value = {},
const std::string &  default_value = {},
const std::string &  scale = {},
const std::string &  offset = {} 
)

Construct a new DDElement object that uses a POD Type (dd::DataType) Use it like:

ddl::DDUnit km("Kilometre", "1", "1", "0",
ddl::DDStructure dd_struct("StructType");
dd_struct.addElement(ddl::DDElement("element_name", ddl::DataType<uint32_t>(), {}, {}, 1, {},
{}, km));
The DDRefunit class holding a reference to its complete DD (references to baseunit and prefix)
Definition: ddunit.h:31
The unit class holding a reference to its complete DD (references to baseunits and prefixes)
Definition: ddunit.h:92
Generator template to create baseunits.
Generator template to create UnitPrefix.
Parameters
nameName of the element.
data_typeData Type of the element. Use ddl::DataType template.
deserialized_infodeserialized information (will be set by default to the alignment of data_type).
serialized_infoserialized information of this element (will be set automatically to the next valid bytepos depending on previous elements).
array_sizearray size of the element
descriptiondescription of the element
commentcomment of the element
unitunit of the element
minimum_valueminimum value of the element
maximum_valuemaximum value of the element
default_valuedefault value (mind! should fit to the data_type)
scalescale of the element
offsetoffset of the value

◆ DDElement() [3/7]

DDElement ( const std::string &  name,
const DDDataType data_type,
const Deserialized deserialized_info = {},
const Serialized serialized_info = {},
const dd::ArraySize array_size = 1,
const std::string &  description = {},
const std::string &  comment = {},
const dd::BaseUnit base_unit = {},
const std::string &  minimum_value = {},
const std::string &  maximum_value = {},
const std::string &  default_value = {},
const std::string &  scale = {},
const std::string &  offset = {} 
)

Construct a new DDElement object that uses a POD Type (dd::DataType) Use it like:

ddl::DDDataType custom_type("custom", 1);
ddl::DDStructure dd_struct("StructType");
dd_struct.addElement(ddl::DDElement("element_name", custom_type));
A DataType class holding the DD for a Datatype with dependencies.
Definition: dddatatype.h:30
Parameters
nameName of the element.
data_typeData Type of the element. Use ddl::DataType template.
deserialized_infodeserialized information (will be set by default to the alignment of data_type).
serialized_infoserialized information of this element (will be set automatically to the next valid bytepos depending on previous elements).
array_sizearray size of the element
descriptiondescription of the element
commentcomment of the element
base_unitthe base unit name of the element
minimum_valueminimum value of the element
maximum_valuemaximum value of the element
default_valuedefault value (mind! should fit to the data_type)
scalescale of the element
offsetoffset of the value

◆ DDElement() [4/7]

DDElement ( const std::string &  name,
const DDDataType data_type,
const Deserialized deserialized_info,
const Serialized serialized_info,
const dd::ArraySize array_size,
const std::string &  description,
const std::string &  comment,
const DDUnit unit,
const std::string &  minimum_value = {},
const std::string &  maximum_value = {},
const std::string &  default_value = {},
const std::string &  scale = {},
const std::string &  offset = {} 
)

Construct a new DDElement object that uses a POD Type (dd::DataType) Use it like:

ddl::DDDataType custom_type("custom", 1);
ddl::DDUnit km("Kilometre", "1", "1", "0",
ddl::DDStructure dd_struct("StructType");
dd_struct.addElement(ddl::DDElement("element_name", custom_type, {}, {}, 1, {}, {}, km));
Parameters
nameName of the element.
data_typeData Type of the element. Use ddl::DataType template.
deserialized_infodeserialized information (will be set by default to the alignment of data_type).
serialized_infoserialized information of this element (will be set automatically to the next valid bytepos depending on previous elements).
array_sizearray size of the element
descriptiondescription of the element
commentcomment of the element
unitthe unit of the element
minimum_valueminimum value of the element
maximum_valuemaximum value of the element
default_valuedefault value (mind! should fit to the data_type)
scalescale of the element
offsetoffset of the value

◆ DDElement() [5/7]

DDElement ( const std::string &  name,
const DDEnum enum_type,
const Deserialized deserialized_info = {},
const Serialized serialized_info = {},
const dd::ArraySize array_size = 1,
const std::string &  description = {},
const std::string &  comment = {},
const dd::BaseUnit base_unit = {},
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 = {} 
)

Construct a new DDElement object that uses a Enum Type (dd::EnumType) Use it like:

ddl::DDEnum dd_enum("EnumType",
{ {"val1", "1" }, { "val2", "2"} });
ddl::DDStructure dd_struct("StructType");
dd_struct.addElement(ddl::DDElement("element_enum", dd_enum));
Utility class for a complete valid data definition of one EnumType and its dependencies.
Definition: ddenum.h:29
Parameters
nameName of the element.
enum_typeEnum Type of the element. Use ddl::DDEnum class.
deserialized_infodeserialized information (will be set by default to the alignment of data_type).
serialized_infoserialized information of this element (will be set automatically to the next valid bytepos depending on previous elements).
array_sizearray size of the element
descriptiondescription of the element
commentcomment of the element
base_unitthe base unit of the element
valueconstant value name of the element (mind! this constant should exists in given enum_type!)
minimum_valueminimum value of the element
maximum_valuemaximum value of the element
default_valuedefault value (mind! should fit to the enum_types data_type)
scalescale of the element
offsetoffset of the value

◆ DDElement() [6/7]

DDElement ( const std::string &  name,
const DDEnum enum_type,
const Deserialized deserialized_info,
const Serialized serialized_info,
const dd::ArraySize array_size,
const std::string &  description,
const std::string &  comment,
const DDUnit unit,
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 = {} 
)

Construct a new DDElement object that uses a Enum Type (dd::EnumType) Use it like:

ddl::DDUnit km("Kilometre", "1", "1", "0",
ddl::DDEnum dd_enum("EnumType",
{ {"val1", "1" }, { "val2", "2"} });
ddl::DDStructure dd_struct("StructType");
dd_struct.addElement(ddl::DDElement("element_enum", dd_enum{}, {}, 1, {}, {}, km));
Parameters
nameName of the element.
enum_typeEnum Type of the element. Use ddl::DDEnum class.
deserialized_infodeserialized information (will be set by default to the alignment of data_type).
serialized_infoserialized information of this element (will be set automatically to the next valid bytepos depending on previous elements).
array_sizearray size of the element
descriptiondescription of the element
commentcomment of the element
unitthe unit name of the element
valueconstant value name of the element (mind! this constant should exists in given enum_type!)
minimum_valueminimum value of the element
maximum_valuemaximum value of the element
default_valuedefault value (mind! should fit to the enum_types data_type)
scalescale of the element
offsetoffset of the value

◆ DDElement() [7/7]

DDElement ( const std::string &  name,
const DDStructure structure_type,
const Deserialized deserialized_info = {},
const Serialized serialized_info = {},
const dd::ArraySize array_size = 1,
const std::string &  description = {},
const std::string &  comment = {} 
)

Construct a new DDElement object that uses a Enum Type (dd::EnumType) Use it like:

ddl::DDEnum dd_enum("EnumType", ddl::DataType<uint32_t>(), { {"val1", "1" }, { "val2",
"2"} }); ddl::DDStructure dd_struct("StructType");
dd_struct.addElement(ddl::DDElement("element_enum", dd_enum));
Parameters
nameName of the element.
structure_typeDDStructure Type of the element. Use ddl::DDStructure class.
deserialized_infodeserialized information (will be set by default to the alignment of data_type).
serialized_infoserialized information of this element (will be set automatically to the next valid bytepos depending on previous elements).
array_sizearray size of the element
descriptiondescription of the element
commentcomment of the element

Member Function Documentation

◆ getDD()

const dd::DataDefinition& getDD ( ) const

retrieves a valid DataDefinition for the elements datatypes and units.

Returns
const dd::DataDefinition&

◆ getElement()

const dd::StructType::Element& getElement ( ) const

Get the Element object.

Returns
const dd::StructType::Element&

◆ operator=() [1/2]

DDElement& operator= ( const DDElement )
default

assignment copy operator

Returns
DDElement& reference

◆ operator=() [2/2]

DDElement& operator= ( DDElement &&  )
default

assignment move operator

Returns
DDElement& reference