ADTF
|
DataDefinition Datamodel This datamodel is observable for any change of: More...
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 | |
DataDefinition & | operator= (DataDefinition &&) |
move assignment operator More... | |
DataDefinition (const DataDefinition &other) | |
CTOR. More... | |
DataDefinition & | operator= (const DataDefinition &other) |
resets the current content an copies the other More... | |
virtual | ~DataDefinition ()=default |
DTOR. | |
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 Header > | getHeader () const |
Get the Header object. More... | |
std::shared_ptr< Header > | getHeader () |
Get the Header object. More... | |
void | setHeader (const Header &header) |
Set the Header object. More... | |
const BaseUnits & | getBaseUnits () const |
Get the Base Units object. More... | |
BaseUnits & | getBaseUnits () |
Get the Base Units object. More... | |
const UnitPrefixes & | getUnitPrefixes () const |
Get the Unit Prefixes object. More... | |
UnitPrefixes & | getUnitPrefixes () |
Get the Unit Prefixes object. More... | |
const Units & | getUnits () const |
Get the Units object. More... | |
Units & | getUnits () |
Get the Units object. More... | |
const DataTypes & | getDataTypes () const |
Get the Data Types object. More... | |
DataTypes & | getDataTypes () |
Get the Data Types object. More... | |
const EnumTypes & | getEnumTypes () const |
Get the Enum Types object. More... | |
EnumTypes & | getEnumTypes () |
Get the Enum Types object. More... | |
const StructTypes & | getStructTypes () const |
Get the Struct Types object. More... | |
StructTypes & | getStructTypes () |
Get the Struct Types object. More... | |
const StreamMetaTypes & | getStreamMetaTypes () const |
Get the Stream Meta Types object. More... | |
StreamMetaTypes & | getStreamMetaTypes () |
Get the Stream Meta Types object. More... | |
const Streams & | getStreams () const |
Get the Streams object. More... | |
Streams & | getStreams () |
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! | |
ModelSubjectUtility & | operator= (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... | |
InfoMap & | operator= (const InfoMap &) |
copy assignment operator More... | |
InfoMap & | operator= (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 | |
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:
Definition at line 55 of file datamodel_datadefinition.h.
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)
ddl_version | the version to use. |
DataDefinition | ( | const DataDefinition & | other | ) |
CTOR.
Copies the datamodel DD.
other | the other DD to copy. |
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.
type_name | the name to check |
bool containsUnit | ( | const std::string & | unit_name | ) | const |
BaseUnits& getBaseUnits | ( | ) |
Get the Base Units object.
const BaseUnits& getBaseUnits | ( | ) | const |
Get the Base Units object.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().
DataTypes& getDataTypes | ( | ) |
Get the Data Types object.
const DataTypes& getDataTypes | ( | ) | const |
Get the Data Types object.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().
EnumTypes& getEnumTypes | ( | ) |
Get the Enum Types object.
const EnumTypes& getEnumTypes | ( | ) | const |
Get the Enum Types object.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().
std::shared_ptr<const Header> getHeader | ( | ) | const |
Get the Header object.
Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().
StreamMetaTypes& getStreamMetaTypes | ( | ) |
Get the Stream Meta Types object.
const StreamMetaTypes& getStreamMetaTypes | ( | ) | const |
Get the Stream Meta Types object.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().
Streams& getStreams | ( | ) |
Get the Streams object.
const Streams& getStreams | ( | ) | const |
Get the Streams object.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().
StructTypes& getStructTypes | ( | ) |
Get the Struct Types object.
const StructTypes& getStructTypes | ( | ) | const |
Get the Struct Types object.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().
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.
type_name | the name to check |
TypeOfType::invalid_type | A type with the given name does not exists. |
TypeOfType::data_type | A type with the given name is a DataType. |
TypeOfType::enum_type | A type with the given name is a EnumType. |
TypeOfType::struct_type | A type with the given name is a StructType. |
TypeOfType::streammetatype_type | A type with the given name is a StreamMetaType. |
TypeOfUnit getTypeOfUnit | ( | const std::string & | unit_name | ) | const |
UnitPrefixes& getUnitPrefixes | ( | ) |
Get the Unit Prefixes object.
const UnitPrefixes& getUnitPrefixes | ( | ) | const |
Get the Unit Prefixes object.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().
Units& getUnits | ( | ) |
Get the Units object.
const Units& getUnits | ( | ) | const |
Get the Units object.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().
Version getVersion | ( | ) | const |
Get the DDL Version.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD(), and DDToXMLFactory< DOM_NODE_TYPE >::createNode().
bool isEmpty | ( | ) | const |
indicates the model as empty or not.
DataDefinition& operator= | ( | const DataDefinition & | other | ) |
resets the current content an copies the other
other | the other to copy from |
DataDefinition& operator= | ( | DataDefinition && | ) |
move assignment operator
void setHeader | ( | const Header & | header | ) |
Set the Header object.
header | the header to set |
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().
void setVersion | ( | const dd::Version & | ddl_version | ) |
Set the DDL Version (in the header!)
ddl_version | the version to set |