ADTF  3.18.2
DataDefinition

DataDefinition Datamodel This datamodel is observable for any change of: More...

Inheritance diagram for DataDefinition:
[legend]

Public Types

using BaseUnits = utility::TypeAccessMap< BaseUnit, DataDefinition >
 container class for all BaseUnits
 
using UnitPrefixes = utility::TypeAccessMap< UnitPrefix, DataDefinition >
 container class for all UnitPrefixes
 
using Units = utility::TypeAccessMap< Unit, DataDefinition >
 container class for all Units
 
using DataTypes = utility::TypeAccessMap< DataType, DataDefinition >
 container class for all DataTypes
 
using EnumTypes = utility::TypeAccessMap< EnumType, DataDefinition >
 container class for all EnumTypes
 
using StructTypes = utility::TypeAccessMap< StructType, DataDefinition >
 container class for all StructTypes
 
using StreamMetaTypes = utility::TypeAccessMap< StreamMetaType, DataDefinition >
 container class for all StreamMetaTypes
 
using Streams = utility::TypeAccessMap< Stream, DataDefinition >
 container class for all Streams
 
- Public Types inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
typedef EVENT_CODE_T event_code_type
 local definition of the event code type
 
typedef MODEL_SUBJECT_T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< MODEL_SUBJECT_T, EVENT_CODE_T > observer_type
 local definition of the observer type to notify
 

Public Member Functions

 DataDefinition ()
 CTOR. More...
 
 DataDefinition (const dd::Version &ddl_version)
 CTOR. More...
 
 DataDefinition (DataDefinition &&)
 move CTOR
 
DataDefinitionoperator= (DataDefinition &&)
 move assignment operator More...
 
 DataDefinition (const DataDefinition &other)
 CTOR. More...
 
DataDefinitionoperator= (const DataDefinition &other)
 resets the current content an copies the other More...
 
void setVersion (const dd::Version &ddl_version)
 Set the DDL Version (in the header!) More...
 
Version getVersion () const
 Get the DDL Version. More...
 
std::shared_ptr< const HeadergetHeader () const
 Get the Header object. More...
 
std::shared_ptr< HeadergetHeader ()
 Get the Header object. More...
 
void setHeader (const Header &header)
 Set the Header object. More...
 
const BaseUnitsgetBaseUnits () const
 Get the Base Units object. More...
 
BaseUnitsgetBaseUnits ()
 Get the Base Units object. More...
 
const UnitPrefixesgetUnitPrefixes () const
 Get the Unit Prefixes object. More...
 
UnitPrefixesgetUnitPrefixes ()
 Get the Unit Prefixes object. More...
 
const UnitsgetUnits () const
 Get the Units object. More...
 
UnitsgetUnits ()
 Get the Units object. More...
 
const DataTypesgetDataTypes () const
 Get the Data Types object. More...
 
DataTypesgetDataTypes ()
 Get the Data Types object. More...
 
const EnumTypesgetEnumTypes () const
 Get the Enum Types object. More...
 
EnumTypesgetEnumTypes ()
 Get the Enum Types object. More...
 
const StructTypesgetStructTypes () const
 Get the Struct Types object. More...
 
StructTypesgetStructTypes ()
 Get the Struct Types object. More...
 
const StreamMetaTypesgetStreamMetaTypes () const
 Get the Stream Meta Types object. More...
 
StreamMetaTypesgetStreamMetaTypes ()
 Get the Stream Meta Types object. More...
 
const StreamsgetStreams () const
 Get the Streams object. More...
 
StreamsgetStreams ()
 Get the Streams object. More...
 
bool containsType (const std::string &type_name) const
 Retrieve information if the datamodel contains a type with the given name. More...
 
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. More...
 
bool containsUnit (const std::string &unit_name) const
 Retrieve information if the datamodel contains a unit with the given name. More...
 
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. More...
 
bool isEmpty () const
 indicates the model as empty or not. More...
 
- Public Member Functions inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
 ModelSubjectUtility ()=default
 CTOR.
 
 ModelSubjectUtility (const ModelSubjectUtility &)
 copy CTOR which removes the observers in case of!
 
ModelSubjectUtilityoperator= (const ModelSubjectUtility &)
 copy assignment operator which removes the observers in case of! More...
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify. More...
 
void detachObserver (observer_type *observer)
 remove a observer if in list. More...
 
- Public Member Functions inherited from InfoMap
 InfoMap ()=default
 CTOR.
 
 InfoMap (const InfoMap &)
 copy CTOR More...
 
 InfoMap (InfoMap &&)
 move CTOR More...
 
InfoMapoperator= (const InfoMap &)
 copy assignment operator More...
 
InfoMapoperator= (InfoMap &&)
 move assignment operator More...
 
template<typename INFO_T >
const INFO_T * getInfo () const
 Get the Info Pointer. More...
 
template<typename INFO_T >
INFO_T * getInfo ()
 Get the Info Pointer. More...
 
template<typename INFO_T >
void setInfo (const std::shared_ptr< INFO_T > &info)
 Set the Info object as shared pointer. More...
 

Private Member Functions

bool validateContains (const BaseUnits::access_type &base_unit) const
 
bool validateContains (const UnitPrefixes::access_type &unit_prefix) const
 
bool validateContains (const Units::access_type &unit) const
 
bool validateContains (const DataTypes::access_type &data_type) const
 
bool validateContains (const EnumTypes::access_type &enum_type) const
 
bool validateContains (const StructTypes::access_type &struct_type) const
 
bool validateContains (const StreamMetaTypes::access_type &stream_meta_type) const
 
bool validateContains (const Streams::access_type &stream) const
 
void notifyChangedMapContent (utility::TypeAccessMapEventCode code, BaseUnits::access_type &base_unit, const std::string &additional_info)
 
void notifyChangedMapContent (utility::TypeAccessMapEventCode code, UnitPrefixes::access_type &unit_prefix, const std::string &additional_info)
 
void notifyChangedMapContent (utility::TypeAccessMapEventCode code, Units::access_type &unit, const std::string &additional_info)
 
void notifyChangedMapContent (utility::TypeAccessMapEventCode code, DataTypes::access_type &data_type, const std::string &additional_info)
 
void notifyChangedMapContent (utility::TypeAccessMapEventCode code, EnumTypes::access_type &enum_type, const std::string &additional_info)
 
void notifyChangedMapContent (utility::TypeAccessMapEventCode code, StructTypes::access_type &struct_type, const std::string &additional_info)
 
void notifyChangedMapContent (utility::TypeAccessMapEventCode code, StreamMetaTypes::access_type &struct_type, const std::string &additional_info)
 
void notifyChangedMapContent (utility::TypeAccessMapEventCode code, Streams::access_type &stream, const std::string &additional_info)
 
void modelChanged (datamodel::ModelEventCode event_code, datamodel::Header &changed_subject, const std::string &additional_info) override
 
- Private Member Functions inherited from ModelObserverUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
virtual void modelChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)=0
 interface function to override. More...
 
virtual ~ModelObserverUtility ()
 protected DTOR
 

Private Attributes

std::shared_ptr< Header_header
 
BaseUnits _base_units
 
UnitPrefixes _unit_prefixes
 
Units _units
 
DataTypes _data_types
 
EnumTypes _enum_types
 
StructTypes _struct_types
 
StreamMetaTypes _stream_meta_types
 
Streams _streams
 
bool _empty_model
 

Additional Inherited Members

- Protected Member Functions inherited from ModelSubjectUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers More...
 
- Private Types inherited from ModelObserverUtility< MODEL_SUBJECT_T, EVENT_CODE_T >
typedef EVENT_CODE_T event_code_type
 local definition of the event code type
 
typedef MODEL_SUBJECT_T subject_type
 local definition of the subject code type
 

Detailed Description

DataDefinition Datamodel This datamodel is observable for any change of:

  • the header - ModelSubject<Header>
  • the baseunits - ModelSubject<BaseUnit>
  • the prefixes - ModelSubject<UnitPrefix>
  • the units - ModelSubject<Unit>
  • the datatypes - ModelSubject<DataType>
  • the enums - ModelSubject<EnumType>
  • the structs - ModelSubject<StructType>
  • the streammetatypes - ModelSubject<StreamMetaType>
  • the Stream - ModelSubject<Stream>

Use the ModelObserver template to observe the specific change.
Example: If you observe the changes on a StructType:

  • see the events observable: ModelEventCode
  • you will get events for the structs (items)
  • you will get events for the elements too (subitems)

Definition at line 55 of file datamodel_datadefinition.h.

Constructor & Destructor Documentation

◆ DataDefinition() [1/3]

CTOR.

Creates a datamodel with the current version (ddl::dd::Version)

◆ DataDefinition() [2/3]

DataDefinition ( const dd::Version ddl_version)

CTOR.

Creates a datamodel with the given version (ddl::dd::Version)

Parameters
ddl_versionthe version to use.

◆ DataDefinition() [3/3]

DataDefinition ( const DataDefinition other)

CTOR.

Copies the datamodel DD.

Parameters
otherthe other DD to copy.

Member Function Documentation

◆ containsType()

bool containsType ( const std::string &  type_name) const

Retrieve information if the datamodel contains a type with the given name.


Following types are considered: DataType, StructType, EnumType, StreamMetaType.

Parameters
type_namethe name to check
Returns
true a type with the given name exists.
false a type with the given name does not exist.

◆ containsUnit()

bool containsUnit ( const std::string &  unit_name) const

Retrieve information if the datamodel contains a unit with the given name.


Following units are considered: BaseUnit, Unit.

Parameters
unit_namethe name to check
Returns
true a unit with the given name exists.
false a unit with the given name does not exist.

◆ getBaseUnits() [1/2]

BaseUnits& getBaseUnits ( )

Get the Base Units object.

Returns
BaseUnits&

◆ getBaseUnits() [2/2]

const BaseUnits& getBaseUnits ( ) const

Get the Base Units object.

Returns
const BaseUnits&

Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getDataTypes() [1/2]

DataTypes& getDataTypes ( )

Get the Data Types object.

Returns
DataTypes&

◆ getDataTypes() [2/2]

const DataTypes& getDataTypes ( ) const

Get the Data Types object.

Returns
const DataTypes&

Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getEnumTypes() [1/2]

EnumTypes& getEnumTypes ( )

Get the Enum Types object.

Returns
EnumTypes&

◆ getEnumTypes() [2/2]

const EnumTypes& getEnumTypes ( ) const

Get the Enum Types object.

Returns
const EnumTypes&

Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getHeader() [1/2]

std::shared_ptr<Header> getHeader ( )

Get the Header object.

Returns
std::shared_ptr<Header>

◆ getHeader() [2/2]

std::shared_ptr<const Header> getHeader ( ) const

Get the Header object.

Returns
std::shared_ptr<const Header>

Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getStreamMetaTypes() [1/2]

StreamMetaTypes& getStreamMetaTypes ( )

Get the Stream Meta Types object.

Returns
StreamMetaTypes&

◆ getStreamMetaTypes() [2/2]

const StreamMetaTypes& getStreamMetaTypes ( ) const

Get the Stream Meta Types object.

Returns
const StreamMetaTypes&

Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getStreams() [1/2]

Streams& getStreams ( )

Get the Streams object.

Returns
Streams&

◆ getStreams() [2/2]

const Streams& getStreams ( ) const

Get the Streams object.

Returns
const Streams&

Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getStructTypes() [1/2]

StructTypes& getStructTypes ( )

Get the Struct Types object.

Returns
StructTypes&

◆ getStructTypes() [2/2]

const StructTypes& getStructTypes ( ) const

Get the Struct Types object.

Returns
const StructTypes&

Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getTypeOfType()

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.


Following types are considered: DataType, StructType, EnumType, StreamMetaType.

Parameters
type_namethe name to check
Return values
TypeOfType::invalid_typeA type with the given name does not exists.
TypeOfType::data_typeA type with the given name is a DataType.
TypeOfType::enum_typeA type with the given name is a EnumType.
TypeOfType::struct_typeA type with the given name is a StructType.
TypeOfType::streammetatype_typeA type with the given name is a StreamMetaType.

◆ getTypeOfUnit()

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.


Following units are considered: BaseUnit, Unit.

Parameters
unit_namethe name to check
Return values
TypeOfUnit::invalid_unitA unit with the given name does not exists.
TypeOfUnit::unitA unit with the given name is a Unit.
TypeOfUnit::base_unitA unit with the given name is a BaseUnit.

◆ getUnitPrefixes() [1/2]

UnitPrefixes& getUnitPrefixes ( )

Get the Unit Prefixes object.

Returns
UnitPrefixes&

◆ getUnitPrefixes() [2/2]

const UnitPrefixes& getUnitPrefixes ( ) const

Get the Unit Prefixes object.

Returns
const UnitPrefixes&

Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getUnits() [1/2]

Units& getUnits ( )

Get the Units object.

Returns
Units&

◆ getUnits() [2/2]

const Units& getUnits ( ) const

Get the Units object.

Returns
const Units&

Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getVersion()

◆ isEmpty()

bool isEmpty ( ) const

indicates the model as empty or not.

Returns
true/false

◆ operator=() [1/2]

DataDefinition& operator= ( const DataDefinition other)

resets the current content an copies the other

Parameters
otherthe other to copy from
Returns
DataDefinition&

◆ operator=() [2/2]

DataDefinition& operator= ( DataDefinition &&  )

move assignment operator

Returns
DataDefinition&

◆ setHeader()

void setHeader ( const Header header)

Set the Header object.

Parameters
headerthe header to set

Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().

◆ setVersion()

void setVersion ( const dd::Version ddl_version)

Set the DDL Version (in the header!)

Parameters
ddl_versionthe version to set
Remarks
This change is observable on the ModelObserver<Header>!