15 #ifndef DD_DATA_MODEL_TYPES_H_INCLUDED
16 #define DD_DATA_MODEL_TYPES_H_INCLUDED
93 virtual void setName(
const std::string& name);
159 const std::string& description = {},
161 const std::string& unit_name = {},
162 const std::string& minimum_value = {},
163 const std::string& maximum_value = {},
179 DataType(
const std::initializer_list<std::string>& initializer);
211 void setName(
const std::string& name)
override;
265 void setMin(
const std::string& minimum_value);
280 void setMax(
const std::string& maximum_value);
303 void notify(
const std::string& additional_info);
304 size_t _bit_size = 0;
305 std::string _description = {};
307 std::string _unit_name = {};
308 std::string _minimum_value = {};
309 std::string _maximum_value = {};
374 const std::string& data_type_name,
375 const std::vector<Element>& elements = {});
418 void setName(
const std::string& name)
override;
436 const std::string& additional_info);
440 const std::string& additional_info);
442 std::string _data_type_name = {};
726 size_t _alignment = Alignment::e_invalid;
789 const std::string& type_name,
793 const std::string& description = {},
794 const std::string& comment = {},
795 const std::string& unit_name = {},
796 const std::string& value = {},
797 const std::string& minimum_value = {},
798 const std::string& maximum_value = {},
799 const std::string& default_value = {},
800 const std::string& scale = {},
801 const std::string& offset = {});
827 const std::string& type_name,
831 const std::string& description,
832 const std::string& comment,
833 const std::string& unit_name,
834 const std::string& value,
835 const std::string& minimum_value,
836 const std::string& maximum_value,
837 const std::string& default_value,
838 const std::string& scale,
839 const std::string& offset,
840 const std::string& valid_element_count);
994 void setMin(
const std::string& minimum_value);
1009 void setMax(
const std::string& maximum_value);
1060 std::string _type_name;
1061 std::string _description;
1062 std::string _unit_name;
1063 std::string _comment;
1066 std::string _minimum_value;
1067 std::string _maximum_value;
1068 std::string _default_value;
1070 std::string _offset;
1086 const std::string& struct_version =
"1",
1088 const std::string& comment = {},
1090 const std::vector<Element>& elements = {});
1197 const std::string& additional_info);
1201 const std::string& additional_info);
1210 std::string _struct_version;
1212 std::string _comment;
1280 const std::string& version,
1281 const std::string& parent = {},
1282 const std::vector<Property>& properties = {});
1359 const std::string& additional_info);
1363 const std::string& additional_info);
1365 std::string _version = {};
1366 std::string _parent = {};
1407 static constexpr
auto _other_types =
"enumtype, structtype or streammetatype";
1423 static constexpr
auto _other_types =
"datatype, streammetatype or structtype";
1439 static constexpr
auto _other_types =
"datatype, enumtype or streammetatype";
DataDefinition Utility class for observable items.
DataDefinition Utility class for observable items.
Sinc DDL 2.0 it is possible to define arraysize with a string that indicates a dynamic array.
static ByteOrder getPlatformDefault()
Get the current Platform Byteorder.
observable DataDefinition object class to describe (POD) DataType.
void setMax(const std::string &maximum_value)
Set the Max (introduced in DDL 3.0)
bool operator==(const DataType &other) const
equality operator.
const std::string & getDescription() const
Get the Description.
bool operator!=(const DataType &other) const
non equality operator.
void setUnitName(const std::string &unit_name)
Set the Unit Name.
DataType & operator=(const DataType &)=default
copy assignment operator.
void setDescription(const std::string &description)
Set the Description.
size_t getBitSize() const
Get the Bit Size.
void setBitSize(size_t size)
Set the Bit Size.
DataType(const std::string &name, size_t bit_size, const std::string &description={}, OptionalSize array_size={}, const std::string &unit_name={}, const std::string &minimum_value={}, const std::string &maximum_value={}, OptionalSize default_type_alignment={})
CTOR.
const OptionalSize & getDefaultAlignment() const
Get the default Alignment if set.
OptionalSize getArraySize() const
Get the Array Size (optional)
const std::string & getMax() const
Get the Max Value for information (introduced in DDL 3.0)
DataType & operator=(DataType &&)=default
move assignment operator.
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)
void setName(const std::string &name) override
Set the Name.
DataType(DataType &&)=default
move CTOR
const std::string & getUnitName() const
Get the Unit Name.
void setArraySize(OptionalSize array_size)
Set the Array Size object.
DataType(const std::initializer_list< std::string > &initializer)
CTOR with initializer.
DataType(const DataType &)=default
copy CTOR
TypeOfType getTypeOfType() const override
Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
virtual ~DataType()=default
DTOR.
observable DataDefinition object class to describe EnumType.
EnumType & operator=(EnumType &&)
move assignment operator
EnumType(EnumType &&)
move CTOR.
const std::string & getDataTypeName() const
Get the Data Type Name.
void setDataTypeName(const std::string &data_type_name)
Set the Data Type Name.
EnumType()=delete
no default CTOR
utility::TypeAccessMap< Element, EnumType > Elements
container class for elements in EnumType
bool operator==(const EnumType &other) const
equality operator.
EnumType & operator=(const EnumType &other)
copy assignment operator
bool operator!=(const EnumType &other) const
non equality operator.
void setName(const std::string &name) override
Set the Name.
virtual ~EnumType()=default
DTOR.
const Elements & getElements() const
Get the Elements object.
Elements & getElements()
Get the Elements object.
EnumType(const EnumType &other)
Copy CTOR.
TypeOfType getTypeOfType() const override
Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
EnumType(const std::string &name, const std::string &data_type_name, const std::vector< Element > &elements={})
Construct a new Enum Type object.
Info Map for the datamodel to hold a set of optional IInfo instances.
class to describe the deserialized information of a StructType::Element.
DeserializedInfo(size_t alignment)
CTOR.
DeserializedInfo(DeserializedInfo &&)=default
move CTOR
DeserializedInfo(const DeserializedInfo &)=default
copy CTOR
virtual void notifyChangeDeserialized(const std::string &)
Forwarding the notification.
DeserializedInfo(const std::initializer_list< size_t > &intializer)
CTOR.
DeserializedInfo()
Default CTOR.
DeserializedInfo & operator=(const DeserializedInfo &)=default
copy assignment operator
void setAlignment(size_t alignment)
Set the Alignment.
DeserializedInfo & operator=(DeserializedInfo &&)=default
move assignment operator
virtual size_t getAlignment() const
Get the Alignment.
virtual ~DeserializedInfo()=default
DTOR.
bool operator==(const DeserializedInfo &other) const
equality operator.
observable DataDefinition object class for a Element of a StructType.
void setMax(const std::string &maximum_value)
Set the Max (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.
Element(Element &&other)
move CTOR
const std::string & getTypeName() const
Get the Type Name.
void setTypeName(const std::string &type_name)
Set the Type Name.
const std::string & getDescription() const
Get the Description.
void setUnitName(const std::string &unit_name)
Set the Unit Name.
const std::string & getScale() const
Get the Scale (for information only)
void setDefault(const std::string &default_value)
Set the Default Value.
bool operator==(const Element &other) const
equality operator.
void setDescription(const std::string &description)
Set the Description.
const ArraySize & getArraySize() const
Get the Array Size.
bool operator!=(const Element &other) const
non equality operator.
const std::string & getComment() const
Get the Comment.
Element(const Element &other)
copy CTOR
const std::string & getValue() const
Get the value.
const std::string & getMax() const
Get the Max (for information only).
const std::string & getValidElementCount() const
Get the Valid Element Count element name.
Element & operator=(Element &&other)
move assignment operator
const std::string & getName() const
Get the Name.
const std::string & getMin() const
Get the Min (for information only).
void notifyChangeSerialized(const std::string &additional_info) override
notification forwarding of serialized information to the StructType::Element object.
void setName(const std::string &name)
Set the Name.
void setMin(const std::string &minimum_value)
Set the Min (for information only).
void setScale(const std::string &scale)
Set the Scale (for information only)
const std::string & getUnitName() const
Get the Unit 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...
const std::string & getDefault() const
Get the Default object.
void notifyChangeDeserialized(const std::string &additional_info) override
Forwarding the notification.
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.
Element & operator=(const Element &other)
copy assignment operator
void setComment(const std::string &comment)
Set the Comment object.
const std::string & getOffset() const
Get the Offset (for information only)
void setOffset(const std::string &offset)
Set the Offset (for information only)
void setArraySize(const ArraySize &array_size)
Set the Array Size.
void setValidElementCount(const std::string &valid_element_count)
Set the Valid Element Count element name.
class to describe the serialized information of a StructType::Element.
void setBytePos(OptionalSize byte_pos, bool prevent_notification=false)
Set the Byte Pos.
SerializedInfo(SerializedInfo &&)=default
move CTOR
SerializedInfo & operator=(SerializedInfo &&)=default
move assignment operator
SerializedInfo & operator=(const SerializedInfo &)=default
copy assignment operator
ByteOrder getByteOrder() const
Get the Byte Order.
OptionalSize getBytePos() const
Get the Byte Pos.
SerializedInfo(const SerializedInfo &)=default
copy CTOR
OptionalSize getBitPos() const
Get the Bit Pos (if set)
SerializedInfo(OptionalSize byte_pos, ByteOrder byte_order=ByteOrderDefault::getPlatformDefault(), OptionalSize bit_pos={}, OptionalSize num_bits={})
CTOR.
SerializedInfo(const std::initializer_list< size_t > &intializer)
CTOR with string list initializing.
void setByteOrder(ByteOrder byte_order)
Set the Byte Order.
OptionalSize getNumBits() const
Get the Num Bits (if set)
void setBitPos(OptionalSize bit_pos, bool prevent_notification=false)
Sets the Bit Pos.
SerializedInfo()
default CTOR.
void setNumBits(OptionalSize num_bits)
Set the Num Bits.
bool operator==(const SerializedInfo &other) const
equality operator.
virtual void notifyChangeSerialized(const std::string &)
notification forwarding of serialized information to the StructType::Element object.
virtual ~SerializedInfo()=default
DTOR.
observable DataDefinition object class to describe StructType.
bool operator==(const StructType &other) const
equality operator.
void setLanguageVersion(const Version &ddl_version)
Set the Language Version.
StructType & operator=(StructType &&other)
move assignment operator.
utility::TypeAccessList< Element, StructType > Elements
container of elements for the StructType::Element.
const std::string & getVersion() const
Get the set Version (the struct version! Not the DDL Version!)
StructType(StructType &&other)
move CTOR.
const std::string & getComment() const
Get the Comment.
void setAlignment(OptionalSize alignment)
Set the Alignment.
StructType()=delete
no default CTOR
virtual ~StructType()=default
DTOR.
OptionalSize getAlignment() const
Get the Alignment (if set)
StructType(const StructType &other)
copy CTOR
StructType & operator=(const StructType &other)
copy assignment operator
void setName(const std::string &name) override
Set the Name.
Version getLanguageVersion() const
Get the set language Version.
bool operator!=(const StructType &other) const
non equality operator.
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.
const Elements & getElements() const
Get the Elements object.
void setVersion(const std::string &struct_version)
Get the Version (the struct version! Not the DDL Version!)
Elements & getElements()
Get the Elements object.
TypeOfType getTypeOfType() const override
Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
void setComment(const std::string &comment)
Set the Comment.
TypeBase & operator=(const TypeBase &)=default
copy assignment operator
TypeBase(TypeBase &&)=default
move CTOR
virtual void setName(const std::string &name)
Set the Name.
virtual ~TypeBase()=default
DTOR.
virtual TypeOfType getTypeOfType() const =0
Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
const std::string & getName() const
Get the Name.
TypeBase(const TypeBase &)=default
copy CTOR
std::string _name
name storage value
TypeBase(const std::string &name)
CTOR.
TypeBase & operator=(TypeBase &&)=default
move assignment operator
Model Subject utility to define a Model Subject that notifies one or more observers.
Element access_type
local definition of the access type
std::unordered_map< std::string, value_type > container_named_compatibility_type
local definition of the container type for getNamedItemList, which had incompatible changes within de...
std::unordered_map< std::string, value_type > container_named_type
local definition of the container type for getNamedItemViewList
Element access_type
local definition of the access type
OO DataDefinition Redesign.
OO DataDefinition Redesign - Data model Observer - Subject pattern.
OO DataDefinition Common Design.
OO DataDefinition Redesign - Data model info extension.
ModelEventCode
Model event code for the data model observer.
detail namespace with no compatibility contraints
TypeAccessMapEventCode
Internal event code to inform the parent DD Object about the change of an item within the list.
TypeAccessListEventCode
Internal event code to inform the parent DD Object about the change of an item within the list.
TypeOfType
Classification of a Type.
@ invalid_type
the type is unknown
utility::Optional< size_t > OptionalSize
Optional Size Type.
ByteOrder
Representation of the byteorder enumeration.
definition of the ddl namespace
helper union class for an element that uses one of the datatype, enumtype, structtype
TypeOfType _type_of_type
the type of the type used (if valid)
std::shared_ptr< datamodel::EnumType > _enum_type
is set to an valid reference if the type is enum_type!
std::shared_ptr< datamodel::StructType > _struct_type
is set to an valid reference if the type is struct_type!
std::shared_ptr< datamodel::DataType > _data_type
is set to an valid reference if the type is data_type OR enum_type!
static std::string getDifference(const ddl::dd::datamodel::DataType &left, const ddl::dd::datamodel::DataType &right)
Get the Difference.
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 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.
static constexpr auto _other_types
validation other types