ADTF
Loading...
Searching...
No Matches
ddl::DDElement Class Reference

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 . More...

#include <ddelement.h>

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
 
DDElementoperator= (const DDElement &)=default
 assignment copy operator
 
 ~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:
 
 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:
 
 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:
 
 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:
 
 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:
 
 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:
 
 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:
 
const dd::StructType::ElementgetElement () const
 Get the Element object.
 
const dd::DataDefinitiongetDD () const
 retrieves a valid DataDefinition for the elements datatypes and units.
 

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.

Constructor & Destructor Documentation

◆ DDElement() [1/7]

ddl::DDElement::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:57
Generator template to create DataType for the plain c-types.
Definition dd_predefined_datatypes.h:38
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]

ddl::DDElement::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.
Definition dd_predefined_units.h:33
Generator template to create UnitPrefix.
Definition dd_predefined_units.h:45
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]

ddl::DDElement::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. (i.e. Units!)
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]

ddl::DDElement::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]

ddl::DDElement::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]

ddl::DDElement::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]

ddl::DDElement::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 & ddl::DDElement::getDD ( ) const

retrieves a valid DataDefinition for the elements datatypes and units.

Returns
const dd::DataDefinition&

◆ getElement()

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

Get the Element object.

Returns
const dd::StructType::Element&

◆ operator=() [1/2]

DDElement & ddl::DDElement::operator= ( const DDElement & )
default

assignment copy operator

Returns
DDElement& reference

◆ operator=() [2/2]

DDElement & ddl::DDElement::operator= ( DDElement && )
default

assignment move operator

Returns
DDElement& reference

The documentation for this class was generated from the following file: