15#ifndef DDSTRUCTURE_H_INCLUDED
16#define DDSTRUCTURE_H_INCLUDED
108 const uint32_t struct_version = 1,
110 const std::string& comment = {},
111 const dd::Version& ddl_version = {});
125 const std::string& xml_string,
146 size_t array_size = 1);
167 size_t array_size = 1);
234 size_t array_size = 1);
256 size_t array_size = 1);
325 template <
typename PREDEF_DATA_TYPE>
327 size_t array_size = 1,
328 const std::string& special_type_name = {})
330 if (special_type_name.empty()) {
334 addElement(element_name, DataType<PREDEF_DATA_TYPE>(special_type_name), array_size);
359 template <
typename PREDEF_DATA_TYPE>
361 size_t array_size = 1,
362 const std::string& special_type_name = {})
364 if (special_type_name.empty()) {
369 element_name, DataType<PREDEF_DATA_TYPE>(special_type_name), array_size);
394 template <
typename PREDEF_DATA_TYPE>
398 const std::string& special_type_name = {})
400 if (special_type_name.empty()) {
405 element_name, DataType<PREDEF_DATA_TYPE>(special_type_name), array_size, alignment);
431 template <
typename PREDEF_DATA_TYPE>
435 const std::string& special_type_name = {})
437 if (special_type_name.empty()) {
442 element_name, DataType<PREDEF_DATA_TYPE>(special_type_name), array_size, alignment);
466 const std::string& constant_value = {});
488 const std::string& constant_value = {});
512 const std::string& constant_value = {});
536 const std::string& constant_value = {});
556 const std::string& constant_value = {});
576 const std::string& constant_value = {});
600 size_t array_size = 1);
624 size_t array_size = 1);
739 return _struct_type->getElements().cbegin();
748 return _struct_type->getElements().cend();
757 return _struct_type->getElements().begin();
766 return _struct_type->getElements().end();
849 const std::string& description = {},
850 const std::string& comment = {},
851 const std::string& value = {},
852 const std::string& minimum_value = {},
853 const std::string& maximum_value = {},
854 const std::string& default_value = {},
855 const std::string& scale = {},
856 const std::string& offset = {});
890 template <
typename T,
bool align_with_padding>
891 friend class DDStructureGenerator;
893 void popLastElement();
896 std::shared_ptr<dd::StructType> _struct_type;
A DataType class holding the DD for a Datatype with dependencies. (i.e. Units!)
Definition dddatatype.h:30
Utility class for a complete valid data definition of one StructType::Element and its dependencies....
Definition ddelement_ref.h:35
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 EnumType and its dependencies....
Definition ddenum.h:29
DDStructure(const std::string &name, const uint32_t struct_version=1, dd::OptionalSize alignment={}, const std::string &comment={}, const dd::Version &ddl_version={})
Construct a new DDStructure object.
DDElementRef createElement(const DDElement &element)
Creates one element to the struct using the convenience class DDElement.
DDStructure & addElement(const std::string &element_name, size_t array_size, size_t alignment, const std::string &special_type_name={})
Adds one element to the struct using a (POD) DataType.
Definition ddstructure.h:395
DDElementRef createElement(const std::string &element_name, const DDEnum &enum_type, size_t array_size, const std::string &constant_value={})
Creates one element to the struct using the convenience class DDEnum.
DDStructure & addElement(const std::string &element_name, const DDStructure &struct_type, size_t array_size=1)
Adds one element to the struct using the convenience class DDStructure.
DDElementRef createElement(const std::string &element_name, size_t array_size, size_t alignment, const std::string &special_type_name={})
Creates one element to the struct using a (POD) DataType.
Definition ddstructure.h:432
DDElementRef createElement(const std::string &element_name, const dd::DataType &data_type, size_t array_size, size_t alignment)
Creates one element to the struct using a (POD) DataType.
void setStructInfo(const std::string &comment)
Set additional struct information like comment. This is important to create additional info in type r...
DDStructure & addElement(const std::string &element_name, const DDDataType &data_type, size_t array_size=1)
Adds one element to the struct using a (POD) DataType.
DDStructure & addElement(const std::string &element_name, const dd::DataType &data_type, size_t array_size, size_t alignment)
Adds one element to the struct using a (POD) DataType.
DDElementRef createElement(const std::string &element_name, const DDStructure &struct_type, size_t array_size, size_t alignment)
Creates one element to the struct using the convenience class DDStructure.
DDStructure & addElements(const std::vector< DDElement > &elements)
Adds a list of element to the struct using the convenience class DDElement.
void setElementInfo(const std::string &element_name, const std::string &description={}, const std::string &comment={}, 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={})
Set additional element information to the given element_name.
bool isCompatible(const DDStructure &other) const
binary compares the structs
DDStructure & operator=(const DDStructure &other)
copy assignment operator
std::string getStructDescription() const
Gets the Struct Data Description as XML String.
dd::datamodel::StructType::Elements::const_iterator const_iterator
iterator to iterate the elements of the struct
Definition ddstructure.h:730
const_iterator cbegin() const
returns the first elements iterator.
Definition ddstructure.h:737
const_iterator begin() const
returns the first elenents iterator for range based iterations.
Definition ddstructure.h:755
size_t getAlignment() const
Retrieves the current evaluated alignment of the structure.
DDStructure(const DDStructure &other)
Construct a new DDStructure object.
bool isEqual(const DDStructure &other) const
equal in names and descriptions
DDStructure & addElement(const std::string &element_name, const DDEnum &enum_type, size_t array_size, const std::string &constant_value={})
Adds one element to the struct using the convenience class DDEnum.
DDStructure & addElement(const DDElement &element)
Adds one element to the struct using the convenience class DDElement.
DDElementRef createElement(const std::string &element_name, const DDEnum &enum_type, size_t array_size, size_t alignment, const std::string &constant_value={})
Creates one element to the struct using the convenience class DDEnum.
DDStructure()=delete
Construct a new DDStructure object.
DDElementRef createElement(const std::string &element_name, const DDStructure &struct_type, size_t array_size=1)
Creates one element to the struct using the convenience class DDStructure.
DDElementRef createElement(const std::string &element_name, const dd::DataType &data_type, size_t array_size=1)
Creates one element to the struct using a (POD) DataType.
std::string getStructName() const
Gets the Struct Name.
DDStructure & addElement(const std::string &element_name, const DDEnum &enum_type, const std::string &constant_value={})
Adds one element to the struct using the convenience class DDEnum.
DDElementRef createElement(const std::string &element_name, const DDEnum &enum_type, const std::string &constant_value={})
Creates one element to the struct using the convenience class DDEnum.
DDElementRef createElement(const std::string &element_name, size_t array_size=1, const std::string &special_type_name={})
Create one element to the struct using a (POD) DataType.
Definition ddstructure.h:360
DDElementRef getElement(const std::string &element_name)
Gets a element reference to the element with name element_name owned by the DDStructure.
DDStructure & addElement(const std::string &element_name, const DDEnum &enum_type, size_t array_size, size_t alignment, const std::string &constant_value={})
Adds one element to the struct using the convenience class DDEnum.
void setElementUnit(const std::string &element_name, const DDUnit &unit)
Sets additional element unit information to the given element_name.
DDStructure & operator=(DDStructure &&other)
move assignment operator
DDElementRef createElement(const std::string &element_name, const DDDataType &data_type, size_t array_size=1)
Creates one element to the struct using a (POD) DataType.
DDStructure & addElement(const std::string &element_name, const DDStructure &struct_type, size_t array_size, size_t alignment)
Adds one element to the struct using the convenience class DDStructure.
const_iterator cend() const
returns the end elements iterator.
Definition ddstructure.h:746
DDStructure & addElement(const std::string &element_name, size_t array_size=1, const std::string &special_type_name={})
Adds one element to the struct using a (POD) DataType.
Definition ddstructure.h:326
const dd::StructType & getStructType() const
Get the Struct Type object.
~DDStructure()=default
Destroy the DDStructure object.
DDStructure & addElement(const std::string &element_name, const dd::DataType &data_type, size_t array_size=1)
Adds one element to the struct using a (POD) DataType.
DDStructure(const std::string &name, const std::string &xml_string, const dd::Version &ddl_xml_file_version_to_parse=dd::Version(0, 0))
Construct a new DDStructure object.
DDElementRef createElement(const std::string &element_name, const DDDataType &data_type, size_t array_size, size_t alignment)
Creates one element to the struct using a (POD) DataType.
const dd::DataDefinition & getDD() const
returns a valid DDL.
const_iterator end() const
returns the end elements iterator.
Definition ddstructure.h:764
DDStructure & addElement(const std::string &element_name, const DDDataType &data_type, size_t array_size, size_t alignment)
Adds one element to the struct using a (POD) DataType.
size_t getSize() const
Retrieves the current evaluated deserialized size (in bytes) of the structure.
void setElementUnit(const std::string &element_name, const dd::BaseUnit &base_unit)
Sets additional element base unit information to the given element_name. Any other unit information w...
DDStructure(DDStructure &&other)
Construct a new DDStructure object.
The unit class holding a reference to its complete DD (references to baseunits and prefixes)
Definition ddunit.h:92
Generator template to create DataType for the plain c-types.
Definition dd_predefined_datatypes.h:38
The Data Definiton class uses the validation model to keep a Data Definition datamodel (ddl::dd::data...
Definition dd.h:92
DDL Version.
Definition dd_common_types.h:203
datamodel::DataType DataType
Definition dd.h:51
datamodel::StructType StructType
Definition dd.h:59
utility::Optional< size_t > OptionalSize
Optional Size Type.
Definition dd_common_types.h:38
datamodel::BaseUnit BaseUnit
Definition dd.h:39
definiton of the unit namespace
Definition dd_predefined_units.h:55
definition of the ddl namespace
Definition codec.h:21