Dev Essential  1.8.1
Loading...
Searching...
No Matches
datamodel_types.h
Go to the documentation of this file.
1
14
15#ifndef DD_DATA_MODEL_TYPES_H_INCLUDED
16#define DD_DATA_MODEL_TYPES_H_INCLUDED
17
24
25#include <string>
26#include <vector>
27
28namespace ddl {
29
30namespace dd {
31
32class TypeInfo;
33class ElementTypeInfo;
34
35namespace datamodel {
36
41class TypeBase {
42public:
47 TypeBase() = default;
52 TypeBase(const TypeBase&) = default;
57 TypeBase(TypeBase&&) = default;
63 TypeBase& operator=(const TypeBase&) = default;
75 TypeBase(std::string name);
80 virtual ~TypeBase() = default;
81
88 virtual TypeOfType getTypeOfType() const = 0;
96 virtual void setName(const std::string& name);
102 const std::string& getName() const;
103
104protected:
106 std::string _name;
107};
108
113class DataType : public TypeBase,
114 public ModelSubject<DataType>,
115 public utility::TypeAccessMapSubject<DataType>,
116 public InfoMap {
117public:
127 DataType(const DataType&) = default;
132 DataType(DataType&&) = default;
138 DataType& operator=(const DataType&) = default;
160 DataType(std::string name,
161 size_t bit_size,
162 std::string description = {},
163 OptionalSize array_size = {},
164 std::string unit_name = {},
165 std::string minimum_value = {},
166 std::string maximum_value = {},
167 OptionalSize default_type_alignment = {});
168
182 DataType(const std::initializer_list<std::string>& initializer);
187 virtual ~DataType() = default;
196 bool operator==(const DataType& other) const;
205 bool operator!=(const DataType& other) const;
206
210 TypeOfType getTypeOfType() const override;
214 void setName(const std::string& name) override;
215
221 size_t getBitSize() const;
227 void setBitSize(size_t size);
228
240 void setArraySize(OptionalSize array_size);
241
247 const std::string& getUnitName() const;
253 void setUnitName(const std::string& unit_name);
254
261 const std::string& getMin() const;
268 void setMin(const std::string& minimum_value);
269
276 const std::string& getMax() const;
283 void setMax(const std::string& maximum_value);
284
290 const std::string& getDescription() const;
296 void setDescription(const std::string& description);
297
304
305private:
306 void notify(const std::string& additional_info);
307 size_t _bit_size = 0;
308 std::string _description = {};
309 OptionalSize _array_size = {};
310 std::string _unit_name = {};
311 std::string _minimum_value = {};
312 std::string _maximum_value = {};
313 OptionalSize _default_type_alignment = {};
314
315public:
320 const TypeInfo* getTypeInfo() const noexcept
321 {
322 return _type_info.get();
323 }
324
328 TypeInfo* getTypeInfo() noexcept
329 {
330 return _type_info.get();
331 }
332
336 void setTypeInfo(std::shared_ptr<TypeInfo> info) noexcept
337 {
338 _type_info.set(std::move(info));
339 }
340
341private:
343 InfoSlot<TypeInfo> _type_info;
344};
345
350class EnumType : public TypeBase,
351 public ModelSubject<EnumType>,
352 public utility::TypeAccessMapSubject<EnumType>,
353 public InfoMap {
354public: // types
366 friend Elements;
368
369public:
374 EnumType() = delete;
391 EnumType(const EnumType& other);
406 EnumType(const std::string& name,
407 const std::string& data_type_name,
408 const std::vector<Element>& elements = {});
413 virtual ~EnumType() = default;
421 bool operator==(const EnumType& other) const;
429 bool operator!=(const EnumType& other) const;
430
436 const Elements& getElements() const;
443
447 TypeOfType getTypeOfType() const override;
451 void setName(const std::string& name) override;
452
458 const std::string& getDataTypeName() const;
464 void setDataTypeName(const std::string& data_type_name);
465
466private:
467 void notify(ModelEventCode code,
469 const std::string& additional_info);
470 bool validateContains(const Elements::access_type& element_name) const;
471 void notifyChangedMapContent(utility::TypeAccessMapEventCode code,
472 Elements::access_type& element,
473 const std::string& additional_info);
474
475 std::string _data_type_name = {};
476 Elements _elements;
477
478public:
483 const TypeInfo* getTypeInfo() const noexcept
484 {
485 return _type_info.get();
486 }
487
491 TypeInfo* getTypeInfo() noexcept
492 {
493 return _type_info.get();
494 }
495
499 void setTypeInfo(std::shared_ptr<TypeInfo> info) noexcept
500 {
501 _type_info.set(std::move(info));
502 }
503
504private:
506 InfoSlot<TypeInfo> _type_info;
507};
508
513class StructType : public TypeBase,
514 public ModelSubject<StructType>,
515 public utility::TypeAccessMapSubject<StructType>,
516 public InfoMap {
517public:
522 StructType() = delete;
527 StructType(StructType&& other) noexcept;
539 StructType(const StructType& other) noexcept;
546 StructType& operator=(const StructType& other) noexcept;
551 virtual ~StructType() = default;
552
557 public:
589 virtual ~SerializedInfo() = default;
590
601 OptionalSize bit_pos = {},
602 OptionalSize num_bits = {});
619 SerializedInfo(const std::initializer_list<size_t>& intializer);
627 bool operator==(const SerializedInfo& other) const;
628
643 void setBytePos(OptionalSize byte_pos, bool prevent_notification = false);
644
659 void setBitPos(OptionalSize bit_pos, bool prevent_notification = false);
660
672 void setNumBits(OptionalSize num_bits);
673
685 void setByteOrder(ByteOrder byte_order);
686
687 protected:
695 virtual void notifyChangeSerialized(const std::string&){};
696
697 private:
698 OptionalSize _byte_pos = {};
699 OptionalSize _bit_pos = {};
700 OptionalSize _num_bits = {};
701 ByteOrder _byte_order = e_le;
702 };
703
708 public:
740 virtual ~DeserializedInfo() = default;
741
747 DeserializedInfo(size_t alignment);
753 DeserializedInfo(const std::initializer_list<size_t>& intializer);
754
762 bool operator==(const DeserializedInfo& other) const;
763
769 virtual size_t getAlignment() const;
777 void setAlignment(size_t alignment);
778
779 protected:
786 virtual void notifyChangeDeserialized(const std::string&){};
787
788 private:
789 size_t _alignment = Alignment::e_invalid;
790 };
791
796 class Element : public SerializedInfo,
797 public DeserializedInfo,
798 public utility::TypeAccessListSubject<Element>,
799 public InfoMap {
800 public:
810 Element(const Element& other) noexcept;
815 Element(Element&& other) noexcept;
826 Element& operator=(const Element& other);
834
857 Element(std::string name,
858 std::string type_name,
859 DeserializedInfo deserialized_info,
860 SerializedInfo serialized_info,
861 dd::ArraySize array_size = {},
862 std::string description = {},
863 std::string comment = {},
864 std::string unit_name = {},
865 std::string value = {},
866 std::string minimum_value = {},
867 std::string maximum_value = {},
868 std::string default_value = {},
869 std::string scale = {},
870 std::string offset = {}) noexcept;
871
895 Element(std::string name,
896 std::string type_name,
897 DeserializedInfo deserialized_info,
898 SerializedInfo serialized_info,
899 dd::ArraySize array_size,
900 std::string description,
901 std::string comment,
902 std::string unit_name,
903 std::string value,
904 std::string minimum_value,
905 std::string maximum_value,
906 std::string default_value,
907 std::string scale,
908 std::string offset,
909 std::string valid_element_count) noexcept;
910
918 bool operator==(const Element& other) const;
926 bool operator!=(const Element& other) const;
927
933 const std::string& getName() const;
942 void setName(const std::string& name);
943
949 const std::string& getTypeName() const;
956 void setTypeName(const std::string& type_name);
957
963 const std::string& getDescription() const;
970 void setDescription(const std::string& description);
971
977 const std::string& getComment() const;
984 void setComment(const std::string& comment);
985
991 const ArraySize& getArraySize() const;
998 void setArraySize(const ArraySize& array_size);
999
1007 const std::string& getValidElementCount() const noexcept;
1017 void setValidElementCount(const std::string& valid_element_count);
1018
1024 const std::string& getUnitName() const;
1031 void setUnitName(const std::string& unit_name);
1032
1038 const std::string& getValue() const;
1048 void setValue(const std::string& value);
1049
1056 const std::string& getMin() const;
1063 void setMin(const std::string& minimum_value);
1064
1071 const std::string& getMax() const;
1078 void setMax(const std::string& maximum_value);
1079
1085 const std::string& getDefault() const;
1093 void setDefault(const std::string& default_value);
1094
1100 const std::string& getScale() const;
1107 void setScale(const std::string& scale);
1108
1114 const std::string& getOffset() const;
1121 void setOffset(const std::string& offset);
1122
1123 private:
1124 void notifyChangeSerialized(const std::string& additional_info) override;
1125 void notifyChangeDeserialized(const std::string& additional_info) override;
1126
1127 private:
1128 std::string _name;
1129 std::string _type_name;
1130 std::string _description;
1131 std::string _unit_name;
1132 std::string _comment;
1133 ArraySize _array_size = 1;
1134 std::string _value;
1135 std::string _minimum_value;
1136 std::string _maximum_value;
1137 std::string _default_value;
1138 std::string _scale;
1139 std::string _offset;
1140 std::string _valid_element_count;
1141
1142 public:
1148 const ElementTypeInfo* getElementTypeInfo() const noexcept
1149 {
1150 return _element_type_info.get();
1151 }
1152
1157 ElementTypeInfo* getElementTypeInfo() noexcept
1158 {
1159 return _element_type_info.get();
1160 }
1161
1165 void setElementTypeInfo(std::shared_ptr<ElementTypeInfo> info) noexcept
1166 {
1167 _element_type_info.set(std::move(info));
1168 }
1169
1170 private:
1172 InfoSlot<ElementTypeInfo> _element_type_info;
1173 };
1174
1187 StructType(const std::string& name,
1188 const std::string& struct_version = "1",
1189 OptionalSize alignment = {},
1190 const std::string& comment = {},
1191 dd::Version ddl_version = dd::Version(0, 0),
1192 const std::vector<Element>& elements = {});
1200 bool operator==(const StructType& other) const;
1208 bool operator!=(const StructType& other) const;
1209
1213 TypeOfType getTypeOfType() const override;
1217 void setName(const std::string& name) override;
1218
1232
1238 const std::string& getComment() const;
1245 void setComment(const std::string& comment);
1246
1252 const std::string& getVersion() const;
1258 void setVersion(const std::string& struct_version);
1259
1273 void setLanguageVersion(const Version& ddl_version);
1274
1275public:
1281 friend Elements;
1283
1288 const Elements& getElements() const;
1295
1296private:
1297 void notify(ModelEventCode code,
1299 const std::string& additional_info);
1300 bool validateContains(const Elements::access_type& element_name) const;
1301 void notifyChangedListContent(utility::TypeAccessListEventCode code,
1302 Elements::access_type& element,
1303 const std::string& additional_info);
1304
1305 std::string _struct_version;
1306 dd::Version _ddl_version;
1307 std::string _comment;
1308 OptionalSize _alignment = Alignment::e1;
1309 Elements _elements;
1310
1311public:
1316 const TypeInfo* getTypeInfo() const noexcept
1317 {
1318 return _type_info.get();
1319 }
1320
1324 TypeInfo* getTypeInfo() noexcept
1325 {
1326 return _type_info.get();
1327 }
1328
1332 void setTypeInfo(std::shared_ptr<TypeInfo> info) noexcept
1333 {
1334 _type_info.set(std::move(info));
1335 }
1336
1337private:
1339 InfoSlot<TypeInfo> _type_info;
1340};
1341
1347 public ModelSubject<StreamMetaType>,
1348 public utility::TypeAccessMapSubject<StreamMetaType>,
1349 public InfoMap {
1350public: // types
1362 friend Properties;
1364
1365public:
1370 StreamMetaType() = delete;
1404 StreamMetaType(std::string name,
1405 std::string version,
1406 std::string parent = {},
1407 const std::vector<Property>& properties = {});
1412 virtual ~StreamMetaType() = default;
1420 bool operator==(const StreamMetaType& other) const;
1428 bool operator!=(const StreamMetaType& other) const;
1429
1442
1446 TypeOfType getTypeOfType() const override;
1450 void setName(const std::string& name) override;
1451
1457 const std::string& getParent() const;
1465 void setParent(const std::string& parent);
1466
1472 const std::string& getVersion() const;
1479 void setVersion(const std::string& version);
1480
1481private:
1482 void notify(ModelEventCode code,
1484 const std::string& additional_info);
1485 bool validateContains(const Properties::access_type& prop) const;
1486 void notifyChangedMapContent(utility::TypeAccessMapEventCode code,
1487 Properties::access_type& element,
1488 const std::string& additional_info);
1489
1490 std::string _version = {};
1491 std::string _parent = {};
1492 Properties _properties;
1493};
1494
1508 std::shared_ptr<datamodel::DataType> _data_type = {};
1512 std::shared_ptr<datamodel::EnumType> _enum_type = {};
1516 std::shared_ptr<datamodel::StructType> _struct_type = {};
1517};
1518
1519} // namespace datamodel
1520} // namespace dd
1521} // namespace ddl
1522
1524{
1532 static constexpr auto _other_types = "enumtype, structtype or streammetatype";
1539 static std::string getDifference(const ddl::dd::datamodel::DataType& left, const ddl::dd::datamodel::DataType& right);
1540 };
1541
1548 static constexpr auto _other_types = "datatype, streammetatype or structtype";
1555 static std::string getDifference(const ddl::dd::datamodel::EnumType& left, const ddl::dd::datamodel::EnumType& right);
1556 };
1557
1564 static constexpr auto _other_types = "datatype, enumtype or streammetatype";
1572 };
1573
1589}
1590
1591#endif // DD_DATA_MODEL_TYPES_H_INCLUDED
Definition dd_common_types.h:378
static ByteOrder getPlatformDefault()
Get the current Platform Byteorder.
DDL Version.
Definition dd_common_types.h:203
observable DataDefinition object class to describe (POD) DataType.
Definition datamodel_types.h:116
const TypeInfo * getTypeInfo() const noexcept
Get the calculated type information (see dd::TypeInfo), for internal use.
Definition datamodel_types.h:320
void setTypeInfo(std::shared_ptr< TypeInfo > info) noexcept
Set the calculated type information, for internal use.
Definition datamodel_types.h:336
const std::string & getUnitName() const
Get the Unit Name.
size_t getBitSize() const
Get the Bit Size.
void setArraySize(OptionalSize array_size)
Set the Array Size object.
TypeInfo * getTypeInfo() noexcept
Get the calculated type information (see dd::TypeInfo), for internal use.
Definition datamodel_types.h:328
DataType & operator=(const DataType &)=default
copy assignment operator.
void setMax(const std::string &maximum_value)
Set the Max (introduced in DDL 3.0)
bool operator==(const DataType &other) const
equality operator.
void setName(const std::string &name) override
Set the Name.
OptionalSize getArraySize() const
Get the Array Size (optional)
void setUnitName(const std::string &unit_name)
Set the Unit Name.
DataType & operator=(DataType &&)=default
move assignment operator.
TypeOfType getTypeOfType() const override
Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
const std::string & getMax() const
Get the Max Value for information (introduced in DDL 3.0)
const std::string & getMin() const
Get the Min Value for information (introduced in DDL 3.0)
void setMin(const std::string &minimum_value)
Set the Min (introduced in DDL 3.0)
DataType()
default CTOR
Definition datamodel_types.h:122
void setBitSize(size_t size)
Set the Bit Size.
bool operator!=(const DataType &other) const
non equality operator.
const std::string & getDescription() const
Get the Description.
DataType(const std::initializer_list< std::string > &initializer)
CTOR with initializer.
void setDescription(const std::string &description)
Set the Description.
DataType(DataType &&)=default
move CTOR
DataType(std::string name, size_t bit_size, std::string description={}, OptionalSize array_size={}, std::string unit_name={}, std::string minimum_value={}, std::string maximum_value={}, OptionalSize default_type_alignment={})
CTOR.
virtual ~DataType()=default
DTOR.
const OptionalSize & getDefaultAlignment() const
Get the default Alignment if set.
DataType(const DataType &)=default
copy CTOR
observable DataDefinition object class to describe EnumType.
Definition datamodel_types.h:353
void setName(const std::string &name) override
Set the Name.
void setTypeInfo(std::shared_ptr< TypeInfo > info) noexcept
Set the calculated type information, for internal use.
Definition datamodel_types.h:499
EnumType()=delete
no default CTOR
TypeOfType getTypeOfType() const override
Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
const TypeInfo * getTypeInfo() const noexcept
Get the calculated type information (see dd::TypeInfo), for internal use.
Definition datamodel_types.h:483
Elements & getElements()
Get the Elements object.
EnumType(const EnumType &other)
Copy CTOR.
bool operator==(const EnumType &other) const
equality operator.
const Elements & getElements() const
Get the Elements object.
EnumType & operator=(EnumType &&)
move assignment operator
const std::string & getDataTypeName() const
Get the Data Type Name.
KeyValuePair Element
Enum type element defintion as Name Value pair.
Definition datamodel_types.h:359
bool operator!=(const EnumType &other) const
non equality operator.
EnumType & operator=(const EnumType &other)
copy assignment operator
void setDataTypeName(const std::string &data_type_name)
Set the Data Type Name.
utility::TypeAccessMap< Element, EnumType > Elements
container class for elements in EnumType
Definition datamodel_types.h:364
EnumType(const std::string &name, const std::string &data_type_name, const std::vector< Element > &elements={})
Construct a new Enum Type object.
virtual ~EnumType()=default
DTOR.
EnumType(EnumType &&)
move CTOR.
TypeInfo * getTypeInfo() noexcept
Get the calculated type information (see dd::TypeInfo), for internal use.
Definition datamodel_types.h:491
Holds a single info of type INFO_T for its owner. Like the entries of an InfoMap, the info belongs to...
Definition infomodel_base.h:84
observable KeyValuePair
Definition datamodel_keyvalue.h:33
bool operator==(const StreamMetaType &other) const
equality operator.
StreamMetaType & operator=(StreamMetaType &&)
move assignment operator
TypeOfType getTypeOfType() const override
Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
Properties & getProperties()
Get the Properties object.
const std::string & getParent() const
Get the Parent.
utility::TypeAccessMap< Property, StreamMetaType > Properties
container of properties for the StreamMetaType::Property.
Definition datamodel_types.h:1360
const Properties & getProperties() const
Get the Properties object.
void setName(const std::string &name) override
Set the Name.
const std::string & getVersion() const
Get the Version.
KeyValuePair Property
defintion of properties by using name - type pair.
Definition datamodel_types.h:1355
void setVersion(const std::string &version)
Set the Version.
virtual ~StreamMetaType()=default
DTOR.
void setParent(const std::string &parent)
Set the Parent This is only valid if the parent is a valid other streammetatype.
bool operator!=(const StreamMetaType &other) const
non equality operator.
StreamMetaType(const StreamMetaType &other)
copy CTOR
StreamMetaType(std::string name, std::string version, std::string parent={}, const std::vector< Property > &properties={})
CTOR.
StreamMetaType & operator=(const StreamMetaType &other)
copy assignment operator
StreamMetaType()=delete
no default CTOR
StreamMetaType(StreamMetaType &&)
move CTOR
DeserializedInfo(const DeserializedInfo &)=default
copy CTOR
DeserializedInfo & operator=(DeserializedInfo &&)=default
move assignment operator
bool operator==(const DeserializedInfo &other) const
equality operator.
DeserializedInfo(const std::initializer_list< size_t > &intializer)
CTOR.
DeserializedInfo(DeserializedInfo &&)=default
move CTOR
DeserializedInfo & operator=(const DeserializedInfo &)=default
copy assignment operator
DeserializedInfo()
Default CTOR.
Definition datamodel_types.h:713
void setAlignment(size_t alignment)
Set the Alignment.
virtual size_t getAlignment() const
Get the Alignment.
virtual void notifyChangeDeserialized(const std::string &)
Forwarding the notification.
Definition datamodel_types.h:786
observable DataDefinition object class for a Element of a StructType.
Definition datamodel_types.h:799
const std::string & getDefault() const
Get the Default object.
void setName(const std::string &name)
Set the Name.
Element(std::string name, std::string type_name, DeserializedInfo deserialized_info, SerializedInfo serialized_info, dd::ArraySize array_size, std::string description, std::string comment, std::string unit_name, std::string value, std::string minimum_value, std::string maximum_value, std::string default_value, std::string scale, std::string offset, std::string valid_element_count) noexcept
CTOR.
void setOffset(const std::string &offset)
Set the Offset (for information only)
void setArraySize(const ArraySize &array_size)
Set the Array Size.
void setMin(const std::string &minimum_value)
Set the Min (for information only).
Element(std::string name, std::string type_name, DeserializedInfo deserialized_info, SerializedInfo serialized_info, dd::ArraySize array_size={}, std::string description={}, std::string comment={}, std::string unit_name={}, std::string value={}, std::string minimum_value={}, std::string maximum_value={}, std::string default_value={}, std::string scale={}, std::string offset={}) noexcept
CTOR.
const std::string & getScale() const
Get the Scale (for information only)
bool operator==(const Element &other) const
equality operator.
const std::string & getOffset() const
Get the Offset (for information only)
Element & operator=(Element &&other)
move assignment operator, which assigns like the copy assignment operator
const std::string & getValidElementCount() const noexcept
Get the Valid Element Count element name.
void setMax(const std::string &maximum_value)
Set the Max (for information only).
const std::string & getDescription() const
Get the Description.
const std::string & getComment() const
Get the Comment.
Element(Element &&other) noexcept
move CTOR
void setUnitName(const std::string &unit_name)
Set the Unit Name.
bool operator!=(const Element &other) const
non equality operator.
void setComment(const std::string &comment)
Set the Comment object.
void setElementTypeInfo(std::shared_ptr< ElementTypeInfo > info) noexcept
Set the calculated element information, for internal use.
Definition datamodel_types.h:1165
const std::string & getUnitName() const
Get the Unit Name.
void setScale(const std::string &scale)
Set the Scale (for information only)
const std::string & getName() const
Get the Name.
void setTypeName(const std::string &type_name)
Set the Type Name.
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...
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.
const std::string & getValue() const
Get the value.
void setDescription(const std::string &description)
Set the Description.
const ElementTypeInfo * getElementTypeInfo() const noexcept
Get the calculated element information (see dd::ElementTypeInfo), for internal use.
Definition datamodel_types.h:1148
Element & operator=(const Element &other)
copy assignment operator
const std::string & getMin() const
Get the Min (for information only). This was introduced in DDL 3.0.
Element(const Element &other) noexcept
copy CTOR
const std::string & getTypeName() const
Get the Type Name.
const std::string & getMax() const
Get the Max (for information only). This was introduced in DDL 3.0.
ElementTypeInfo * getElementTypeInfo() noexcept
Get the calculated element information (see dd::ElementTypeInfo), for internal use.
Definition datamodel_types.h:1157
const ArraySize & getArraySize() const
Get the Array Size.
void setValidElementCount(const std::string &valid_element_count)
Set the Valid Element Count element name. This value is usually only used if array size is greater th...
OptionalSize getNumBits() const
Get the Num Bits (if set)
SerializedInfo(const std::initializer_list< size_t > &intializer)
CTOR with string list initializing.
OptionalSize getBitPos() const
Get the Bit Pos (if set)
void setNumBits(OptionalSize num_bits)
Set the Num Bits.
bool operator==(const SerializedInfo &other) const
equality operator.
SerializedInfo & operator=(const SerializedInfo &)=default
copy assignment operator
SerializedInfo()
default CTOR.
Definition datamodel_types.h:562
OptionalSize getBytePos() const
Get the Byte Pos.
virtual void notifyChangeSerialized(const std::string &)
notification forwarding of serialized information to the StructType::Element object.
Definition datamodel_types.h:695
SerializedInfo(const SerializedInfo &)=default
copy CTOR
SerializedInfo(SerializedInfo &&)=default
move CTOR
SerializedInfo(OptionalSize byte_pos, ByteOrder byte_order=ByteOrderDefault::getPlatformDefault(), OptionalSize bit_pos={}, OptionalSize num_bits={})
CTOR.
void setBytePos(OptionalSize byte_pos, bool prevent_notification=false)
Set the Byte Pos.
void setBitPos(OptionalSize bit_pos, bool prevent_notification=false)
Sets the Bit Pos.
SerializedInfo & operator=(SerializedInfo &&)=default
move assignment operator
void setByteOrder(ByteOrder byte_order)
Set the Byte Order.
ByteOrder getByteOrder() const
Get the Byte Order.
observable DataDefinition object class to describe StructType.
Definition datamodel_types.h:516
StructType(const std::string &name, const std::string &struct_version="1", OptionalSize alignment={}, const std::string &comment={}, dd::Version ddl_version=dd::Version(0, 0), const std::vector< Element > &elements={})
CTOR.
void setComment(const std::string &comment)
Set the Comment.
virtual ~StructType()=default
DTOR.
utility::TypeAccessList< Element, StructType > Elements
container of elements for the StructType::Element.
Definition datamodel_types.h:1279
StructType()=delete
no default CTOR
Elements & getElements()
Get the Elements object.
void setAlignment(OptionalSize alignment)
Set the Alignment.
const std::string & getVersion() const
Get the set Version (the struct version! Not the DDL Version!)
bool operator!=(const StructType &other) const
non equality operator.
void setVersion(const std::string &struct_version)
Get the Version (the struct version! Not the DDL Version!)
StructType & operator=(const StructType &other) noexcept
copy assignment operator
OptionalSize getAlignment() const
Get the Alignment (if set)
void setName(const std::string &name) override
Set the Name.
StructType & operator=(StructType &&other)
move assignment operator.
const Elements & getElements() const
Get the Elements object.
void setLanguageVersion(const Version &ddl_version)
Set the Language Version.
TypeOfType getTypeOfType() const override
Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
StructType(const StructType &other) noexcept
copy CTOR
void setTypeInfo(std::shared_ptr< TypeInfo > info) noexcept
Set the calculated type information, for internal use.
Definition datamodel_types.h:1332
const std::string & getComment() const
Get the Comment.
StructType(StructType &&other) noexcept
move CTOR.
TypeInfo * getTypeInfo() noexcept
Get the calculated type information (see dd::TypeInfo), for internal use.
Definition datamodel_types.h:1324
bool operator==(const StructType &other) const
equality operator.
const TypeInfo * getTypeInfo() const noexcept
Get the calculated type information (see dd::TypeInfo), for internal use.
Definition datamodel_types.h:1316
Version getLanguageVersion() const
Get the set language Version.
virtual TypeOfType getTypeOfType() const =0
Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
std::string _name
name storage value
Definition datamodel_types.h:106
virtual void setName(const std::string &name)
Set the Name.
virtual ~TypeBase()=default
DTOR.
TypeBase(TypeBase &&)=default
move CTOR
TypeBase(std::string name)
CTOR.
TypeBase & operator=(const TypeBase &)=default
copy assignment operator
TypeBase & operator=(TypeBase &&)=default
move assignment operator
TypeBase(const TypeBase &)=default
copy CTOR
const std::string & getName() const
Get the Name.
Utility class for observable named items where the order is important.
Definition access_list.h:89
Element access_type
Definition access_list.h:92
Utility class for observable named items where the order is NOT important.
Definition access_map.h:79
Element access_type
Definition access_map.h:82
definition of the datamodel namespace
Definition datamodel_base.h:28
utility::ModelSubjectUtility< TYPE, ModelEventCode > ModelSubject
Subject template class that is observable.
Definition datamodel_base.h:187
ModelEventCode
Model event code for the data model observer.
Definition datamodel_base.h:34
Definition datamodel_keyvalue.h:160
ModelSubjectUtility< T, TypeAccessMapEventCode > TypeAccessMapSubject
helper template to observe map content.
Definition access_map.h:61
ModelSubjectUtility< T, TypeAccessListEventCode > TypeAccessListSubject
helper template to observe list content.
Definition access_list.h:71
TypeAccessListEventCode
Internal event code to inform the parent DD Object about the change of an item within the list.
Definition access_list.h:45
TypeAccessMapEventCode
Internal event code to inform the parent DD Object about the change of an item within the list.
Definition access_map.h:37
definition of the dd namespace
Definition datamodel_base.h:26
ByteOrder
Definition dd_common_types.h:152
@ e1
Definition dd_common_types.h:100
utility::Optional< size_t > OptionalSize
Optional Size Type.
Definition dd_common_types.h:38
TypeOfType
Classification of a Type.
Definition dd_common_types.h:44
@ invalid_type
the type is unknown
Definition dd_common_types.h:49
definition of the ddl namespace
Definition codec.h:21
helper union class for an element that uses one of the datatype, enumtype, structtype
Definition datamodel_types.h:1499
std::shared_ptr< datamodel::StructType > _struct_type
is set to an valid reference if the type is struct_type!
Definition datamodel_types.h:1516
std::shared_ptr< datamodel::EnumType > _enum_type
is set to an valid reference if the type is enum_type!
Definition datamodel_types.h:1512
std::shared_ptr< datamodel::DataType > _data_type
is set to an valid reference if the type is data_type OR enum_type!
Definition datamodel_types.h:1508
TypeOfType _type_of_type
the type of the type used (if valid)
Definition datamodel_types.h:1504
static std::string getDifference(const ddl::dd::datamodel::DataType &left, const ddl::dd::datamodel::DataType &right)
Get the Difference.
static constexpr auto _other_types
validation other type
Definition datamodel_types.h:1532
static constexpr auto _other_types
validation other type
Definition datamodel_types.h:1548
static std::string getDifference(const ddl::dd::datamodel::EnumType &left, const ddl::dd::datamodel::EnumType &right)
Get the Difference.
static std::string getDifference(const ddl::dd::datamodel::StructType &left, const ddl::dd::datamodel::StructType &right)
Get the Difference.
static constexpr auto _other_types
validation other type
Definition datamodel_types.h:1564
static constexpr auto _other_types
validation other type
Definition datamodel_types.h:1580
static std::string getDifference(const ddl::dd::datamodel::StructType::Element &left, const ddl::dd::datamodel::StructType::Element &right)
Get the Difference.
Validation helper template for clear excpetion messages.
Definition access_validation.h:37