ADTF
StructType

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

Inheritance diagram for StructType:
[legend]

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 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

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

void notify (ModelEventCode code, utility::TypeAccessMapEventCode map_code, const std::string &additional_info)
 
bool validateContains (const Elements::access_type &element_name) const
 
void notifyChangedListContent (utility::TypeAccessListEventCode code, Elements::access_type &element, const std::string &additional_info)
 
const Elements::container_named_compatibility_typegetNamedItemList () const
 
Elements::container_named_compatibility_typegetNamedItemList ()
 
const Elements::container_named_typegetNamedItemViewList () const
 
Elements::container_named_typegetNamedItemViewList ()
 

Private Attributes

std::string _struct_version
 
dd::Version _ddl_version
 
std::string _comment
 
OptionalSize _alignment = Alignment::e1
 
Elements _elements
 

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...
 
- Protected Attributes inherited from TypeBase
std::string _name
 name storage value
 

Detailed Description

observable DataDefinition object class to describe StructType.

Definition at line 451 of file datamodel_types.h.

Constructor & Destructor Documentation

◆ StructType() [1/2]

StructType ( const StructType other)

copy CTOR

Parameters
otherthe structtype to copy from.

◆ StructType() [2/2]

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 getAlignment ( ) const

Get the Alignment (if set)

Returns
OptionalSize

Referenced by structure< T >::GetAlignment().

◆ getComment()

const std::string& getComment ( ) const

Get the Comment.

Returns
const std::string&

◆ getElements() [1/2]

Elements& getElements ( )

Get the Elements object.

Returns
Elements&

◆ getElements() [2/2]

const Elements& getElements ( ) const

Get the Elements object.

Returns
const Elements&

◆ getLanguageVersion()

Version getLanguageVersion ( ) const

Get the set language Version.

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

◆ getTypeOfType()

TypeOfType getTypeOfType ( ) const
overridevirtual

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

Returns
TypeOfType

Implements TypeBase.

◆ getVersion()

const std::string& getVersion ( ) const

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

Returns
const std::string&

◆ operator!=()

bool 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& operator= ( const StructType other)

copy assignment operator

Parameters
otherthe structtype to copy from.
Returns
StructType&

◆ operator=() [2/2]

StructType& operator= ( StructType &&  other)

move assignment operator.

Returns
StructType&

◆ operator==()

bool 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 setAlignment ( OptionalSize  alignment)

Set the Alignment.

Parameters
alignmentthe alignment to set.
Remarks
This is observable.

◆ setComment()

void setComment ( const std::string &  comment)

Set the Comment.

Parameters
commentthe comment to set
Remarks
This is observable.

◆ setLanguageVersion()

void setLanguageVersion ( const Version ddl_version)

Set the Language Version.

Parameters
ddl_versionthe language version to set
Remarks
This is observable.

◆ setName()

void 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 TypeBase.

◆ setVersion()

void setVersion ( const std::string &  struct_version)

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

Remarks
This is observable.