15 #ifndef DD_DD_H_INCLUDED
16 #define DD_DD_H_INCLUDED
142 void setModel(
const std::shared_ptr<datamodel::DataDefinition>& datamodel);
148 std::shared_ptr<const datamodel::DataDefinition>
getModel()
const;
416 bool force_recalculation =
false);
531 std::shared_ptr<datamodel::DataDefinition> _datamodel;
532 void attachToModel();
533 void detachFromModel();
536 const std::string& additional_info)
override;
539 const std::string& additional_info)
override;
542 const std::string& additional_info)
override;
545 const std::string& additional_info)
override;
548 const std::string& additional_info)
override;
551 const std::string& additional_info)
override;
554 const std::string& additional_info)
override;
557 const std::string& additional_info)
override;
560 const std::string& additional_info)
override;
562 Version _last_known_ddl_version;
566 std::unordered_map<std::string, std::string> _recursion_detection_stream_meta_types;
567 std::unordered_map<std::string, std::string> _recursion_detection_struct;
646 const std::vector<ddl::dd::Problem>& problems);
The Data Definiton class uses the validation model to keep a Data Definition datamodel (ddl::dd::data...
DataDefinition & operator=(DataDefinition &&other)
Assigns the DataDefinition object and moves the datamodel.
DataDefinition()
Construct a new DataDefinition object with a new datamodel::DataDefinition.
BaseUnits & getBaseUnits()
Get the Base Units of the datamodel.
bool containsType(const std::string &type_name) const
Retrieve information if the datamodel contains a type with the given name.
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 setHeader(const Header &header)
Resets the DataDefinition Header of the datamodel.
Units & getUnits()
Get the Units of the datamodel.
const EnumTypes & getEnumTypes() const
Get the Enum Types of the datamodel.
void add(const EnumType &enum_type, const DataDefinition &source_dd)
Merges or add the given enumtype.
void add(const DataDefinition &source_dd)
Merges or add the DataDefinition objects of the given source_dd.
DataDefinition(Version ddl_version)
Construct a new DataDefinition object with a new datamodel::DataDefinition.
EnumTypes & getEnumTypes()
Get the Enum Types of the datamodel.
void add(const DataType &data_type, const DataDefinition &source_dd)
Merges or add the given datatype.
std::vector< ddl::dd::Problem > getValidationProtocol() const
Gets a collection of all problems obtained while validating the DataDefinition Objects-.
bool isValid(ValidationLevel level=ValidationLevel::valid) const
Obtains if the validation level has reached at least the given level.
void validate(bool force_revalidation=false)
Calculate the validation level of all DataDefinition objects that does not have a validation level ye...
void setModel(const std::shared_ptr< datamodel::DataDefinition > &datamodel)
Sets and references the datamodel object, that is to validate and observe.
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.
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...
bool containsUnit(const std::string &unit_name) const
Retrieve information if the datamodel contains a unit with the given name.
void add(const UnitPrefix &unit_prefix, const DataDefinition &source_dd)
Merges or add the given unit prefix.
void add(const BaseUnit &base_unit, const DataDefinition &source_dd)
Merges or add the given base unit.
void setVersion(const Version &ddl_version)
Set the language version of the containing datamodel.
const BaseUnits & getBaseUnits() const
Get the Base Units of the datamodel.
void add(const StructType &struct_type, const DataDefinition &source_dd)
Merges or add the given structtype.
StructTypes & getStructTypes()
Get the Struct Types of the datamodel.
const StructTypes & getStructTypes() const
Get the Struct Types of the datamodel.
Header & getHeader()
Gets the Header of the datamodel.
Streams & getStreams()
Get the Streams of the datamodel.
void add(const Stream &stream, const DataDefinition &source_dd)
Merges or add the given stream.
void add(const StreamMetaType &stream_meta_type, const DataDefinition &source_dd)
Merges or add the given streammetatype.
StructTypeAccess getStructTypeAccess(const std::string &type_name) const
Get the Struct Type Access, where to enter the type and calculated element position information.
const StreamMetaTypes & getStreamMetaTypes() const
Get the Streammeta Types of the datamodel.
DataDefinition(DataDefinition &&other)
Construct a new DataDefinition object and take the datamodel of the other.
DataDefinition & operator=(const DataDefinition &other)
Assigns the DataDefinition object and copies the datamodel.
const DataTypes & getDataTypes() const
Get the Data Types of the datamodel.
const Streams & getStreams() const
Get the Streams of the datamodel.
DataDefinition(const DataDefinition &other)
Construct a new DataDefinition object and copies the datamodel.
StreamMetaTypes & getStreamMetaTypes()
Get the Streammeta Types of the datamodel.
const Header & getHeader() const
Gets the Header of the datamodel.
void add(const Unit &unit, const DataDefinition &source_dd)
Merges or add the given unit.
const Units & getUnits() const
Get the Units of the datamodel.
std::shared_ptr< const datamodel::DataDefinition > getModel() const
Gets the datamodel reference.
DataDefinition(const std::shared_ptr< datamodel::DataDefinition > &datamodel)
Construct a new DataDefinition object and set the datamodel to the given one.
Version getVersion() const
Get the current language version set in datamodel.
DataTypes & getDataTypes()
Get the Data Types of the datamodel.
UnitPrefixes & getUnitPrefixes()
Get the Unit Prefixes of the datamodel.
virtual ~DataDefinition()
Destroy the DataDefinition object.
const UnitPrefixes & getUnitPrefixes() const
Get the Unit Prefixes of the datamodel.
Accessing class for a instance of a struct.
utility::TypeAccessMap< UnitPrefix, DataDefinition > UnitPrefixes
container class for all UnitPrefixes
utility::TypeAccessMap< DataType, DataDefinition > DataTypes
container class for all DataTypes
utility::TypeAccessMap< EnumType, DataDefinition > EnumTypes
container class for all EnumTypes
utility::TypeAccessMap< Stream, DataDefinition > Streams
container class for all Streams
utility::TypeAccessMap< StructType, DataDefinition > StructTypes
container class for all StructTypes
utility::TypeAccessMap< StreamMetaType, DataDefinition > StreamMetaTypes
container class for all StreamMetaTypes
utility::TypeAccessMap< BaseUnit, DataDefinition > BaseUnits
container class for all BaseUnits
utility::TypeAccessMap< Unit, DataDefinition > Units
container class for all Units
observable DataDefinition object class to describe (POD) DataType.
observable DataDefinition object class to describe EnumType.
observable Stream DataDefinition object.
observable DataDefinition object class to describe StructType.
Unit Prefix - datamodel pefixes.
The ModelObserver utility template.
OO DataDefinition Redesign.
OO DataDefinition Common Design.
OO DataDefinition info model types.
OO DataDefinition Redesign.
ModelEventCode
Model event code for the data model observer.
datamodel::StreamMetaType StreamMetaType
Reuse of datamodel streammetatype class - ddl::dd::datamodel::StreamMetaType.
datamodel::DataType DataType
Reuse of datamodel datatype class - ddl::dd::datamodel::DataType.
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.
datamodel::EnumType EnumType
Reuse of datamodel enumtype class - ddl::dd::datamodel::EnumType.
datamodel::BaseUnit BaseUnit
Reuse of datamodel base unit class - ddl::dd::datamodel::BaseUnit.
std::vector< std::string > transformValidationProblemList(const std::vector< ddl::dd::Problem > &problems)
transforms the validation protocol of problems to a simple vrctor of strings.
datamodel::UnitPrefix UnitPrefix
Reuse of datamodel unit prefix class - ddl::dd::datamodel::UnitPrefix.
datamodel::Unit Unit
Reuse of datamodel unit class - ddl::dd::datamodel::Unit.
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.
TypeOfType
Classification of a Type.
@ enum_type
the type is a enum type (EnumType)
@ data_type
the type is a data type (DataType)
@ struct_type
the type is a struct type (StructType)
@ invalid_type
the type is unknown
@ stream_meta_type
the type is an stream meta type (StreamMetaType)
datamodel::StructType StructType
Reuse of datamodel structtype class - ddl::dd::datamodel::StructType.
TypeOfUnit
Classification of unit.
@ unit
the unit is a unit (Unit)
@ base_unit
the unit is a base unit (BaseUnit)
datamodel::Stream Stream
Reuse of datamodel stream class - ddl::dd::datamodel::Stream.
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.
datamodel::Header Header
Reuse of datamodel header class - ddl::dd::datamodel::Header.
dd::DataDefinition DataDescription
Alias Name for DataDefinition, formally known as DataDescription.
ValidationLevel
Validation level.
@ dont_know
The validation is not known.
@ valid
every thing is well defined.
definition of the ddl namespace