15#ifndef DD_DD_H_INCLUDED
16#define DD_DD_H_INCLUDED
153 std::shared_ptr<const datamodel::DataDefinition>
getModel()
const;
417 bool force_recalculation =
false);
532 friend class ddl::DDMerge;
533 std::shared_ptr<datamodel::DataDefinition> _datamodel;
534 void attachToModel();
535 void detachFromModel();
538 const std::string& additional_info)
override;
541 const std::string& additional_info)
override;
544 const std::string& additional_info)
override;
547 const std::string& additional_info)
override;
550 const std::string& additional_info)
override;
553 const std::string& additional_info)
override;
556 const std::string& additional_info)
override;
559 const std::string& additional_info)
override;
562 const std::string& additional_info)
override;
564 Version _last_known_ddl_version;
568 std::unordered_map<std::string, std::string> _recursion_detection_stream_meta_types;
569 std::unordered_map<std::string, std::string> _recursion_detection_struct;
648 const std::vector<ddl::dd::Problem>& problems);
DataDefinition()
Construct a new DataDefinition object with a new datamodel::DataDefinition. The used language version...
The Data Definiton class uses the validation model to keep a Data Definition datamodel (ddl::dd::data...
Definition dd.h:92
const StructTypes & getStructTypes() const
Get the Struct Types of the datamodel.
const StreamMetaTypes & getStreamMetaTypes() const
Get the Streammeta Types of the datamodel.
virtual ~DataDefinition()
Destroy the DataDefinition object.
const UnitPrefixes & getUnitPrefixes() const
Get the Unit Prefixes of the datamodel.
void setHeader(const Header &header)
Resets the DataDefinition Header of the datamodel.
const Units & getUnits() const
Get the Units of the datamodel.
std::shared_ptr< const datamodel::DataDefinition > getModel() const
Gets the datamodel reference.
Streams & getStreams()
Get the Streams of the datamodel.
const DataTypes & getDataTypes() const
Get the Data Types of the datamodel.
void add(const BaseUnit &base_unit, const DataDefinition &source_dd)
Merges or add the given base unit. If there are dependencies, they will be retrieved from source_dd....
const EnumTypes & getEnumTypes() const
Get the Enum Types of the datamodel.
const BaseUnits & getBaseUnits() const
Get the Base Units of the datamodel.
UnitPrefixes & getUnitPrefixes()
Get the Unit Prefixes of the datamodel.
Header & getHeader()
Gets the Header of the datamodel.
StreamMetaTypes & getStreamMetaTypes()
Get the Streammeta Types of the datamodel.
void add(const EnumType &enum_type, const DataDefinition &source_dd)
Merges or add the given enumtype. If there are dependencies, they will be retrieved from source_dd....
StructTypes & getStructTypes()
Get the Struct Types of the datamodel.
void add(const UnitPrefix &unit_prefix, const DataDefinition &source_dd)
Merges or add the given unit prefix. If there are dependencies, they will be retrieved from source_dd...
std::vector< ddl::dd::Problem > getValidationProtocol() const
Gets a collection of all problems obtained while validating the DataDefinition Objects.
void add(const DataDefinition &source_dd)
Merges or add the DataDefinition objects of the given source_dd.
void add(const Stream &stream, const DataDefinition &source_dd)
Merges or add the given stream. If there are dependencies, they will be retrieved from source_dd....
void calculatePositions(const std::string &type_name={}, TypeOfType type_of_type=TypeOfType::invalid_type, bool force_recalculation=false)
calculates the element sizes and positions of all structs, enumtypes and datatypes or dedicated for t...
void add(const Unit &unit, const DataDefinition &source_dd)
Merges or add the given unit. If there are dependencies, they will be retrieved from source_dd....
TypeOfType getTypeOfType(const std::string &type_name) const
Retrieve information if the datamodel contains a type with the given name and return the type of it....
void add(const StructType &struct_type, const DataDefinition &source_dd)
Merges or add the given structtype. If there are dependencies, they will be retrieved from source_dd....
DataDefinition()
Construct a new DataDefinition object with a new datamodel::DataDefinition. The used language version...
Version getVersion() const
Get the current language version set in datamodel.
const Streams & getStreams() const
Get the Streams of the datamodel.
DataDefinition(Version ddl_version)
Construct a new DataDefinition object with a new datamodel::DataDefinition.
bool containsUnit(const std::string &unit_name) const
Retrieve information if the datamodel contains a unit with the given name. Following units are cons...
StructTypeAccess getStructTypeAccess(const std::string &type_name) const
Get the Struct Type Access, where to enter the type and calculated element position information.
void add(const DataType &data_type, const DataDefinition &source_dd)
Merges or add the given datatype. If there are dependencies, they will be retrieved from source_dd....
void add(const StreamMetaType &stream_meta_type, const DataDefinition &source_dd)
Merges or add the given streammetatype. If there are dependencies, they will be retrieved from source...
DataTypes & getDataTypes()
Get the Data Types of the datamodel.
TypeOfUnit getTypeOfUnit(const std::string &unit_name) const
Retrieve information if the datamodel contains a unit with the given name and return the type of it....
datamodel::DataDefinition::StructTypes StructTypes
Reuse of datamodel structs container - ddl::dd::datamodel::DataDefinition::StructTypes.
Definition dd.h:184
DataDefinition & operator=(const DataDefinition &other)
Assigns the DataDefinition object and copies the datamodel.
DataDefinition & operator=(DataDefinition &&other)
Assigns the DataDefinition object and moves the datamodel.
datamodel::DataDefinition::Units Units
Reuse of datamodel units container - ddl::dd::datamodel::DataDefinition::Units.
Definition dd.h:169
datamodel::DataDefinition::StreamMetaTypes StreamMetaTypes
Reuse of datamodel streammetatypes container - ddl::dd::datamodel::DataDefinition::StreamMetaTypes.
Definition dd.h:189
datamodel::DataDefinition::UnitPrefixes UnitPrefixes
Reuse of datamodel unit prefixes container - ddl::dd::datamodel::DataDefinition::BaseUnits.
Definition dd.h:165
bool containsType(const std::string &type_name) const
Retrieve information if the datamodel contains a type with the given name. Following types are cons...
bool isValid(ValidationLevel level=ValidationLevel::valid) const
Obtains if the validation level has reached at least the given level.
datamodel::DataDefinition::EnumTypes EnumTypes
Reuse of datamodel enumtypes container - ddl::dd::datamodel::DataDefinition::EnumTypes.
Definition dd.h:179
EnumTypes & getEnumTypes()
Get the Enum Types of the datamodel.
BaseUnits & getBaseUnits()
Get the Base Units of the datamodel.
DataDefinition(const std::shared_ptr< datamodel::DataDefinition > &datamodel)
Construct a new DataDefinition object and set the datamodel to the given one.
datamodel::DataDefinition::BaseUnits BaseUnits
Reuse of datamodel base unit container - ddl::dd::datamodel::DataDefinition::BaseUnits.
Definition dd.h:160
datamodel::DataDefinition::Streams Streams
Reuse of datamodel streams container - ddl::dd::datamodel::DataDefinition::Streams.
Definition dd.h:194
Units & getUnits()
Get the Units of the datamodel.
const Header & getHeader() const
Gets the Header of the datamodel.
DataDefinition(DataDefinition &&other)
Construct a new DataDefinition object and take the datamodel of the other.
void setVersion(const Version &ddl_version)
Set the language version of the containing datamodel.
datamodel::DataDefinition::DataTypes DataTypes
Reuse of datamodel datatypes container - ddl::dd::datamodel::DataDefinition::DataTypes.
Definition dd.h:174
void setModel(const std::shared_ptr< datamodel::DataDefinition > &datamodel)
Sets and references the datamodel object, that is to validate and observe.
DataDefinition(const DataDefinition &other)
Construct a new DataDefinition object and copies the datamodel.
void validate(bool force_revalidation=false)
Calculate the validation level of all DataDefinition objects that does not have a validation level ye...
Accessing class for a instance of a struct. This will calculate the byte positions can be used for se...
Definition dd_struct_access.h:598
DDL Version.
Definition dd_common_types.h:203
BaseUnit.
Definition datamodel_units.h:108
utility::TypeAccessMap< EnumType, DataDefinition > EnumTypes
container class for all EnumTypes
Definition datamodel_datadefinition.h:119
utility::TypeAccessMap< DataType, DataDefinition > DataTypes
container class for all DataTypes
Definition datamodel_datadefinition.h:117
utility::TypeAccessMap< StreamMetaType, DataDefinition > StreamMetaTypes
container class for all StreamMetaTypes
Definition datamodel_datadefinition.h:123
utility::TypeAccessMap< Stream, DataDefinition > Streams
container class for all Streams
Definition datamodel_datadefinition.h:125
utility::TypeAccessMap< StructType, DataDefinition > StructTypes
container class for all StructTypes
Definition datamodel_datadefinition.h:121
utility::TypeAccessMap< Unit, DataDefinition > Units
container class for all Units
Definition datamodel_datadefinition.h:115
utility::TypeAccessMap< UnitPrefix, DataDefinition > UnitPrefixes
container class for all UnitPrefixes
Definition datamodel_datadefinition.h:113
utility::TypeAccessMap< BaseUnit, DataDefinition > BaseUnits
container class for all BaseUnits
Definition datamodel_datadefinition.h:111
observable DataDefinition object class to describe (POD) DataType.
Definition datamodel_types.h:113
observable DataDefinition object class to describe EnumType.
Definition datamodel_types.h:320
observable Stream DataDefinition object.
Definition datamodel_streams.h:41
observable DataDefinition object class to describe StructType.
Definition datamodel_types.h:453
Unit Prefix - datamodel pefixes.
Definition datamodel_units.h:221
BaseUnit.
Definition datamodel_units.h:338
definition of the datamodel namespace
Definition datamodel_base.h:28
utility::ModelObserverUtility< TYPE, ModelEventCode > ModelObserver
Observer template class that observe the TYPE.
Definition datamodel_base.h:195
ModelEventCode
Model event code for the data model observer.
Definition datamodel_base.h:34
definition of the dd namespace
Definition datamodel_base.h:26
dd::DataDefinition DataDescription
Alias Name for DataDefinition, formally known as DataDescription.
Definition dd.h:654
datamodel::Stream Stream
Definition dd.h:67
bool addStreamTypeByName(const std::string &stream_type_name, const DataDefinition &source_dd, DataDefinition &destination_dd)
Merges or add the streamtype with the name of stream_type_name. If there are dependencies,...
datamodel::DataType DataType
Definition dd.h:51
ValidationLevel
Validation level.
Definition dd_infomodel_type.h:66
@ dont_know
The validation is not known. This means it is not calculated yet. Use i.e. ddl::dd::DataDefinition::v...
Definition dd_infomodel_type.h:71
@ valid
every thing is well defined.
Definition dd_infomodel_type.h:95
std::vector< std::string > transformValidationProblemList(const std::vector< ddl::dd::Problem > &problems)
transforms the validation protocol of problems to a simple vrctor of strings. Simple usage:
datamodel::EnumType EnumType
Definition dd.h:55
TypeOfUnit
Classification of unit.
Definition dd_common_types.h:76
@ base_unit
the unit is a base unit (BaseUnit)
Definition dd_common_types.h:91
@ unit
the unit is a unit (Unit)
Definition dd_common_types.h:86
datamodel::StructType StructType
Definition dd.h:59
bool addTypeByName(const std::string &type_name, const DataDefinition &source_dd, DataDefinition &destination_dd)
Helper function which merges or adds the type with the name of type_name. If there are dependencies,...
datamodel::Unit Unit
Definition dd.h:47
TypeOfType
Classification of a Type.
Definition dd_common_types.h:44
@ invalid_type
the type is unknown
Definition dd_common_types.h:49
@ struct_type
the type is a struct type (StructType)
Definition dd_common_types.h:64
@ data_type
the type is a data type (DataType)
Definition dd_common_types.h:54
@ stream_meta_type
the type is an stream meta type (StreamMetaType)
Definition dd_common_types.h:69
@ enum_type
the type is a enum type (EnumType)
Definition dd_common_types.h:59
datamodel::UnitPrefix UnitPrefix
Definition dd.h:43
datamodel::StreamMetaType StreamMetaType
Definition dd.h:63
bool addUnitByName(const std::string &unit_name, const DataDefinition &source_dd, DataDefinition &destination_dd)
Merges or add the unit with the name of unit_name. If there are dependencies, they will be retrieved ...
datamodel::Header Header
Definition dd.h:35
datamodel::BaseUnit BaseUnit
Definition dd.h:39
definiton of the unit prefixes namespace
Definition dd_predefined_units.h:61
definition of the ddl namespace
Definition codec.h:21