Dev Essential  1.6.3
Loading...
Searching...
No Matches
ddl::dd::datamodel::DataDefinition Class Reference

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

#include <datamodel_datadefinition.h>

Inherits ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelObserverUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, and ddl::dd::datamodel::InfoMap.

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 ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >
typedef ModelEventCode event_code_type
 local definition of the event code type
 
typedef TYPE subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< TYPE, ModelEventCode > observer_type
 local definition of the observer type to notify
 
typedef ModelEventCode event_code_type
 local definition of the event code type
 
typedef TYPE subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< TYPE, ModelEventCode > observer_type
 local definition of the observer type to notify
 
typedef ModelEventCode event_code_type
 local definition of the event code type
 
typedef TYPE subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< TYPE, ModelEventCode > observer_type
 local definition of the observer type to notify
 
typedef ModelEventCode event_code_type
 local definition of the event code type
 
typedef TYPE subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< TYPE, ModelEventCode > observer_type
 local definition of the observer type to notify
 

Public Member Functions

 DataDefinition ()
 CTOR. Creates a datamodel with the current version (ddl::dd::Version)
 
 DataDefinition (const dd::Version &ddl_version)
 CTOR. Creates a datamodel with the given version (ddl::dd::Version)
 
 DataDefinition (DataDefinition &&)
 move CTOR
 
DataDefinitionoperator= (DataDefinition &&)
 move assignment operator
 
 DataDefinition (const DataDefinition &other)
 CTOR. Copies the datamodel DD.
 
DataDefinitionoperator= (const DataDefinition &other)
 resets the current content an copies the other
 
virtual ~DataDefinition ()=default
 
void setVersion (const dd::Version &ddl_version)
 Set the DDL Version (in the header!)
 
Version getVersion () const
 Get the DDL Version.
 
std::shared_ptr< const HeadergetHeader () const
 Get the Header object.
 
std::shared_ptr< HeadergetHeader ()
 Get the Header object.
 
void setHeader (const Header &header)
 Set the Header object.
 
const BaseUnitsgetBaseUnits () const
 Get the Base Units object.
 
BaseUnitsgetBaseUnits ()
 Get the Base Units object.
 
const UnitPrefixesgetUnitPrefixes () const
 Get the Unit Prefixes object.
 
UnitPrefixesgetUnitPrefixes ()
 Get the Unit Prefixes object.
 
const UnitsgetUnits () const
 Get the Units object.
 
UnitsgetUnits ()
 Get the Units object.
 
const DataTypesgetDataTypes () const
 Get the Data Types object.
 
DataTypesgetDataTypes ()
 Get the Data Types object.
 
const EnumTypesgetEnumTypes () const
 Get the Enum Types object.
 
EnumTypesgetEnumTypes ()
 Get the Enum Types object.
 
const StructTypesgetStructTypes () const
 Get the Struct Types object.
 
StructTypesgetStructTypes ()
 Get the Struct Types object.
 
const StreamMetaTypesgetStreamMetaTypes () const
 Get the Stream Meta Types object.
 
StreamMetaTypesgetStreamMetaTypes ()
 Get the Stream Meta Types object.
 
const StreamsgetStreams () const
 Get the Streams object.
 
StreamsgetStreams ()
 Get the Streams object.
 
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.
 
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.
 
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.
 
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.
 
bool isEmpty () const
 
- Public Member Functions inherited from ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
 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!
 
virtual ~ModelSubjectUtility ()=default
 DTOR.
 
void attachObserver (observer_type *observer)
 adda a observer to notify.
 
void detachObserver (observer_type *observer)
 remove a observer if in list.
 
- Public Member Functions inherited from ddl::dd::datamodel::InfoMap
 InfoMap ()=default
 CTOR.
 
 InfoMap (const InfoMap &)
 copy CTOR
 
 InfoMap (InfoMap &&)
 move CTOR
 
InfoMapoperator= (const InfoMap &)
 copy assignment operator
 
InfoMapoperator= (InfoMap &&)
 move assignment operator
 
template<typename INFO_T>
const INFO_T * getInfo () const
 Get the Info Pointer.
 
template<typename INFO_T>
INFO_T * getInfo ()
 Get the Info Pointer.
 
template<typename INFO_T>
void setInfo (const std::shared_ptr< INFO_T > &info)
 Set the Info object as shared pointer.
 

Additional Inherited Members

- Protected Member Functions inherited from ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 
void notifyChanged (event_code_type event_code, subject_type &changed_subject, const std::string &additional_info)
 helper utility function to notify the current observers
 

Detailed Description

DataDefinition Datamodel This datamodel is observable for any change of:

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)

Constructor & Destructor Documentation

◆ DataDefinition() [1/2]

ddl::dd::datamodel::DataDefinition::DataDefinition ( const dd::Version & ddl_version)

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

Parameters
ddl_versionthe version to use.

◆ DataDefinition() [2/2]

ddl::dd::datamodel::DataDefinition::DataDefinition ( const DataDefinition & other)

CTOR. Copies the datamodel DD.

Parameters
otherthe other DD to copy.

◆ ~DataDefinition()

virtual ddl::dd::datamodel::DataDefinition::~DataDefinition ( )
virtualdefault

DTOR

Member Function Documentation

◆ containsType()

bool ddl::dd::datamodel::DataDefinition::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 ddl::dd::datamodel::DataDefinition::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 & ddl::dd::datamodel::DataDefinition::getBaseUnits ( )

Get the Base Units object.

Returns
BaseUnits&

◆ getBaseUnits() [2/2]

const BaseUnits & ddl::dd::datamodel::DataDefinition::getBaseUnits ( ) const

Get the Base Units object.

Returns
const BaseUnits&

◆ getDataTypes() [1/2]

DataTypes & ddl::dd::datamodel::DataDefinition::getDataTypes ( )

Get the Data Types object.

Returns
DataTypes&

◆ getDataTypes() [2/2]

const DataTypes & ddl::dd::datamodel::DataDefinition::getDataTypes ( ) const

Get the Data Types object.

Returns
const DataTypes&

◆ getEnumTypes() [1/2]

EnumTypes & ddl::dd::datamodel::DataDefinition::getEnumTypes ( )

Get the Enum Types object.

Returns
EnumTypes&

◆ getEnumTypes() [2/2]

const EnumTypes & ddl::dd::datamodel::DataDefinition::getEnumTypes ( ) const

Get the Enum Types object.

Returns
const EnumTypes&

◆ getHeader() [1/2]

std::shared_ptr< Header > ddl::dd::datamodel::DataDefinition::getHeader ( )

Get the Header object.

Returns
std::shared_ptr<Header>

◆ getHeader() [2/2]

std::shared_ptr< const Header > ddl::dd::datamodel::DataDefinition::getHeader ( ) const

Get the Header object.

Returns
std::shared_ptr<const Header>

◆ getStreamMetaTypes() [1/2]

StreamMetaTypes & ddl::dd::datamodel::DataDefinition::getStreamMetaTypes ( )

Get the Stream Meta Types object.

Returns
StreamMetaTypes&

◆ getStreamMetaTypes() [2/2]

const StreamMetaTypes & ddl::dd::datamodel::DataDefinition::getStreamMetaTypes ( ) const

Get the Stream Meta Types object.

Returns
const StreamMetaTypes&

◆ getStreams() [1/2]

Streams & ddl::dd::datamodel::DataDefinition::getStreams ( )

Get the Streams object.

Returns
Streams&

◆ getStreams() [2/2]

const Streams & ddl::dd::datamodel::DataDefinition::getStreams ( ) const

Get the Streams object.

Returns
const Streams&

◆ getStructTypes() [1/2]

StructTypes & ddl::dd::datamodel::DataDefinition::getStructTypes ( )

Get the Struct Types object.

Returns
StructTypes&

◆ getStructTypes() [2/2]

const StructTypes & ddl::dd::datamodel::DataDefinition::getStructTypes ( ) const

Get the Struct Types object.

Returns
const StructTypes&

◆ getTypeOfType()

TypeOfType ddl::dd::datamodel::DataDefinition::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 ddl::dd::datamodel::DataDefinition::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 & ddl::dd::datamodel::DataDefinition::getUnitPrefixes ( )

Get the Unit Prefixes object.

Returns
UnitPrefixes&

◆ getUnitPrefixes() [2/2]

const UnitPrefixes & ddl::dd::datamodel::DataDefinition::getUnitPrefixes ( ) const

Get the Unit Prefixes object.

Returns
const UnitPrefixes&

◆ getUnits() [1/2]

Units & ddl::dd::datamodel::DataDefinition::getUnits ( )

Get the Units object.

Returns
Units&

◆ getUnits() [2/2]

const Units & ddl::dd::datamodel::DataDefinition::getUnits ( ) const

Get the Units object.

Returns
const Units&

◆ getVersion()

Version ddl::dd::datamodel::DataDefinition::getVersion ( ) const

Get the DDL Version.

Returns
Version

◆ isEmpty()

bool ddl::dd::datamodel::DataDefinition::isEmpty ( ) const

indicates the model as empty or not.

Returns
true/false

◆ operator=() [1/2]

DataDefinition & ddl::dd::datamodel::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 & ddl::dd::datamodel::DataDefinition::operator= ( DataDefinition && )

move assignment operator

Returns
DataDefinition&

◆ setHeader()

void ddl::dd::datamodel::DataDefinition::setHeader ( const Header & header)

Set the Header object.

Parameters
headerthe header to set

◆ setVersion()

void ddl::dd::datamodel::DataDefinition::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>!

The documentation for this class was generated from the following file: