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

observable DataDefinition object class to describe StructType. More...

#include <datamodel_types.h>

Inherits ddl::dd::datamodel::TypeBase, ddl::dd::utility::ModelSubjectUtility< TYPE, ModelEventCode >, ddl::dd::utility::ModelSubjectUtility< T, TypeAccessMapEventCode >, and ddl::dd::datamodel::InfoMap.

Classes

class  DeserializedInfo
 class to describe the deserialized information of a StructType::Element. More...
 
class  Element
 observable DataDefinition object class for a Element of a StructType. More...
 
class  SerializedInfo
 class to describe the serialized information of a StructType::Element. More...
 

Public Types

using Elements = utility::TypeAccessList<Element, StructType>
 container of elements for the StructType::Element.
 
- 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 Types inherited from ddl::dd::utility::ModelSubjectUtility< T, TypeAccessMapEventCode >
typedef TypeAccessMapEventCode event_code_type
 local definition of the event code type
 
typedef T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< T, TypeAccessMapEventCodeobserver_type
 local definition of the observer type to notify
 
typedef TypeAccessMapEventCode event_code_type
 local definition of the event code type
 
typedef T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< T, TypeAccessMapEventCodeobserver_type
 local definition of the observer type to notify
 
typedef TypeAccessMapEventCode event_code_type
 local definition of the event code type
 
typedef T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< T, TypeAccessMapEventCodeobserver_type
 local definition of the observer type to notify
 
typedef TypeAccessMapEventCode event_code_type
 local definition of the event code type
 
typedef T subject_type
 local definition of the subject type
 
typedef ModelObserverUtility< T, TypeAccessMapEventCodeobserver_type
 local definition of the observer type to notify
 

Public Member Functions

 StructType ()=delete
 no default CTOR
 
 StructType (StructType &&other)
 move CTOR.
 
StructTypeoperator= (StructType &&other)
 move assignment operator.
 
 StructType (const StructType &other)
 copy CTOR
 
StructTypeoperator= (const StructType &other)
 copy assignment operator
 
virtual ~StructType ()=default
 DTOR.
 
 StructType (const std::string &name, const std::string &struct_version="1", OptionalSize alignment={}, const std::string &comment={}, dd::Version ddl_version=dd::Version(0, 0), const std::vector< Element > &elements={})
 CTOR.
 
bool operator== (const StructType &other) const
 equality operator.
 
bool operator!= (const StructType &other) const
 non equality operator.
 
TypeOfType getTypeOfType () const override
 Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).
 
void setName (const std::string &name) override
 Set the Name.
 
OptionalSize getAlignment () const
 Get the Alignment (if set)
 
void setAlignment (OptionalSize alignment)
 Set the Alignment.
 
const std::string & getComment () const
 Get the Comment.
 
void setComment (const std::string &comment)
 Set the Comment.
 
const std::string & getVersion () const
 Get the set Version (the struct version! Not the DDL Version!)
 
void setVersion (const std::string &struct_version)
 Get the Version (the struct version! Not the DDL Version!)
 
Version getLanguageVersion () const
 Get the set language Version.
 
void setLanguageVersion (const Version &ddl_version)
 Set the Language Version.
 
const ElementsgetElements () const
 Get the Elements object.
 
ElementsgetElements ()
 Get the Elements object.
 
- Public Member Functions inherited from ddl::dd::datamodel::TypeBase
 TypeBase ()=default
 CTOR.
 
 TypeBase (const TypeBase &)=default
 copy CTOR
 
 TypeBase (TypeBase &&)=default
 move CTOR
 
TypeBaseoperator= (const TypeBase &)=default
 copy assignment operator
 
TypeBaseoperator= (TypeBase &&)=default
 move assignment operator
 
 TypeBase (std::string name)
 CTOR.
 
virtual ~TypeBase ()=default
 DTOR.
 
const std::string & getName () const
 Get the Name.
 
- 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::utility::ModelSubjectUtility< T, TypeAccessMapEventCode >
 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
 
- Protected Member Functions inherited from ddl::dd::utility::ModelSubjectUtility< T, TypeAccessMapEventCode >
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
 
- Protected Attributes inherited from ddl::dd::datamodel::TypeBase
std::string _name
 name storage value
 

Detailed Description

observable DataDefinition object class to describe StructType.

Constructor & Destructor Documentation

◆ StructType() [1/2]

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

copy CTOR

Parameters
otherthe structtype to copy from.

◆ StructType() [2/2]

ddl::dd::datamodel::StructType::StructType ( const std::string & name,
const std::string & struct_version = "1",
OptionalSize alignment = {},
const std::string & comment = {},
dd::Version ddl_version = dd::Version(0, 0),
const std::vector< Element > & elements = {} )

CTOR.

Parameters
nameThe name for the structtype
struct_versionthe struct version (should be some unsigned integer value)
alignmentthe alignment of the struct (default is 1)
commentthe comment
ddl_versiondedicated language version for this structtype must be used (this influences the structsize and its alignment!)
elementsvector of elements, that will be added immediatelly.
Exceptions
ddl::dd::Errormay throw if elements contains elements with the same name twice

Member Function Documentation

◆ getAlignment()

OptionalSize ddl::dd::datamodel::StructType::getAlignment ( ) const

Get the Alignment (if set)

Returns
OptionalSize

◆ getComment()

const std::string & ddl::dd::datamodel::StructType::getComment ( ) const

Get the Comment.

Returns
const std::string&

◆ getElements() [1/2]

Elements & ddl::dd::datamodel::StructType::getElements ( )

Get the Elements object.

Returns
Elements&

◆ getElements() [2/2]

const Elements & ddl::dd::datamodel::StructType::getElements ( ) const

Get the Elements object.

Returns
const Elements&

◆ getLanguageVersion()

Version ddl::dd::datamodel::StructType::getLanguageVersion ( ) const

Get the set language Version.

Returns
Version
Return values
dd::Version(0,0)if it was not set

◆ getTypeOfType()

TypeOfType ddl::dd::datamodel::StructType::getTypeOfType ( ) const
overridevirtual

Get the Type Of the Type (data_type, enum_type, struct_type, stream_meta_type).

Returns
TypeOfType

Implements ddl::dd::datamodel::TypeBase.

◆ getVersion()

const std::string & ddl::dd::datamodel::StructType::getVersion ( ) const

Get the set Version (the struct version! Not the DDL Version!)

Returns
const std::string&

◆ operator!=()

bool ddl::dd::datamodel::StructType::operator!= ( const StructType & other) const

non equality operator.

Parameters
otherthe other structtype to compare to.
Returns
false the type is equal (and all its elements).
true the type is not equal.

◆ operator=() [1/2]

StructType & ddl::dd::datamodel::StructType::operator= ( const StructType & other)

copy assignment operator

Parameters
otherthe structtype to copy from.
Returns
StructType&

◆ operator=() [2/2]

StructType & ddl::dd::datamodel::StructType::operator= ( StructType && other)

move assignment operator.

Returns
StructType&

◆ operator==()

bool ddl::dd::datamodel::StructType::operator== ( const StructType & other) const

equality operator.

Parameters
otherthe other structtype to compare to.
Returns
true the type is equal (and all its elements).
false the type is not equal.

◆ setAlignment()

void ddl::dd::datamodel::StructType::setAlignment ( OptionalSize alignment)

Set the Alignment.

Parameters
alignmentthe alignment to set.
Remarks
This is observable.

◆ setComment()

void ddl::dd::datamodel::StructType::setComment ( const std::string & comment)

Set the Comment.

Parameters
commentthe comment to set
Remarks
This is observable.

◆ setLanguageVersion()

void ddl::dd::datamodel::StructType::setLanguageVersion ( const Version & ddl_version)

Set the Language Version.

Parameters
ddl_versionthe language version to set
Remarks
This is observable.

◆ setName()

void ddl::dd::datamodel::StructType::setName ( const std::string & name)
overridevirtual

Set the Name.

Parameters
nameThe name of type.
Exceptions
Thismight throw if the set name does already exist in the container this type is part of.

Reimplemented from ddl::dd::datamodel::TypeBase.

◆ setVersion()

void ddl::dd::datamodel::StructType::setVersion ( const std::string & struct_version)

Get the Version (the struct version! Not the DDL Version!)

Remarks
This is observable.

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