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

observable DataDefinition object class to describe (POD) DataType. 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.

Inherited by ddl::DataType< bool >, ddl::DataType< char >, ddl::DataType< double >, ddl::DataType< float >, ddl::DataType< T >, ddl::DataType< bool >, ddl::DataType< char >, ddl::DataType< double >, and ddl::DataType< float >.

Public Member Functions

 DataType ()
 default CTOR
 
 DataType (const DataType &)=default
 copy CTOR
 
 DataType (DataType &&)=default
 move CTOR
 
DataTypeoperator= (const DataType &)=default
 copy assignment operator.
 
DataTypeoperator= (DataType &&)=default
 move assignment operator.
 
 DataType (std::string name, size_t bit_size, std::string description={}, OptionalSize array_size={}, std::string unit_name={}, std::string minimum_value={}, std::string maximum_value={}, OptionalSize default_type_alignment={})
 CTOR.
 
 DataType (const std::initializer_list< std::string > &initializer)
 CTOR with initializer.
 
virtual ~DataType ()=default
 DTOR.
 
bool operator== (const DataType &other) const
 equality operator.
 
bool operator!= (const DataType &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.
 
size_t getBitSize () const
 Get the Bit Size.
 
void setBitSize (size_t size)
 Set the Bit Size.
 
OptionalSize getArraySize () const
 Get the Array Size (optional)
 
void setArraySize (OptionalSize array_size)
 Set the Array Size object.
 
const std::string & getUnitName () const
 Get the Unit Name.
 
void setUnitName (const std::string &unit_name)
 Set the Unit Name.
 
const std::string & getMin () const
 Get the Min Value for information (introduced in DDL 3.0)
 
void setMin (const std::string &minimum_value)
 Set the Min (introduced in DDL 3.0)
 
const std::string & getMax () const
 Get the Max Value for information (introduced in DDL 3.0)
 
void setMax (const std::string &maximum_value)
 Set the Max (introduced in DDL 3.0)
 
const std::string & getDescription () const
 Get the Description.
 
void setDescription (const std::string &description)
 Set the Description.
 
const OptionalSizegetDefaultAlignment () const
 Get the default Alignment if set.
 
- 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

- 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
 
- 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 (POD) DataType.

Constructor & Destructor Documentation

◆ DataType() [1/2]

ddl::dd::datamodel::DataType::DataType ( std::string name,
size_t bit_size,
std::string description = {},
OptionalSize array_size = {},
std::string unit_name = {},
std::string minimum_value = {},
std::string maximum_value = {},
OptionalSize default_type_alignment = {} )

CTOR.

Parameters
namename of the datatype
bit_sizebit size of the datatype
descriptiondescription of the datatype
array_sizearraysize of the datatype (this is not support in this implementation of StructTypeAccess and typeinfo model!)
unit_nameunit name of the datatype
minimum_valuethe minimum value (for information only)
maximum_valuethe maximum value (for information only)
default_type_alignmentType alignment (this is optional, because it is not part of the DD, but important for automatic calculation of member positions)

◆ DataType() [2/2]

ddl::dd::datamodel::DataType::DataType ( const std::initializer_list< std::string > & initializer)

CTOR with initializer.

Parameters
initializerthe list containing the same values as the CTOR before. Valid in this order:
  • 0 - name
  • 1 - bit_size
  • 2 - description
  • 3 - array_size
  • 4 - unit_name
  • 5 - minimum_value
  • 6 - maximum_value
Example usage:
DataType my_dt = {"32_bit_type", "32", "My 32 bit type is great!"};
DataType()
default CTOR
Definition datamodel_types.h:119

Member Function Documentation

◆ getArraySize()

OptionalSize ddl::dd::datamodel::DataType::getArraySize ( ) const

Get the Array Size (optional)

Returns
OptionalSize

◆ getBitSize()

size_t ddl::dd::datamodel::DataType::getBitSize ( ) const

Get the Bit Size.

Returns
size_t

◆ getDefaultAlignment()

const OptionalSize & ddl::dd::datamodel::DataType::getDefaultAlignment ( ) const

Get the default Alignment if set.

Returns
const OptionalSize&

◆ getDescription()

const std::string & ddl::dd::datamodel::DataType::getDescription ( ) const

Get the Description.

Returns
const std::string&

◆ getMax()

const std::string & ddl::dd::datamodel::DataType::getMax ( ) const

Get the Max Value for information (introduced in DDL 3.0)

Returns
const std::string&

◆ getMin()

const std::string & ddl::dd::datamodel::DataType::getMin ( ) const

Get the Min Value for information (introduced in DDL 3.0)

Returns
const std::string&

◆ getTypeOfType()

TypeOfType ddl::dd::datamodel::DataType::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.

◆ getUnitName()

const std::string & ddl::dd::datamodel::DataType::getUnitName ( ) const

Get the Unit Name.

Returns
const std::string&

◆ operator!=()

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

non equality operator.

Parameters
otherthe other datatype to compare this type to.
Returns
false The datatype is equal (the description, minimum and maximum value will not be compared!)
true the datatype is not equal

◆ operator=() [1/2]

DataType & ddl::dd::datamodel::DataType::operator= ( const DataType & )
default

copy assignment operator.

Returns
DataType&

◆ operator=() [2/2]

DataType & ddl::dd::datamodel::DataType::operator= ( DataType && )
default

move assignment operator.

Returns
DataType&

◆ operator==()

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

equality operator.

Parameters
otherthe other datatype to compare this type to.
Returns
true The datatype is equal (the description, minimum and maximum value will not be compared!)
false the datatype is not equal

◆ setArraySize()

void ddl::dd::datamodel::DataType::setArraySize ( OptionalSize array_size)

Set the Array Size object.

Parameters
array_sizethe optional array to set.

◆ setBitSize()

void ddl::dd::datamodel::DataType::setBitSize ( size_t size)

Set the Bit Size.

Parameters
sizethe number of bits of this type

◆ setDescription()

void ddl::dd::datamodel::DataType::setDescription ( const std::string & description)

Set the Description.

Parameters
descriptionthe description to set

◆ setMax()

void ddl::dd::datamodel::DataType::setMax ( const std::string & maximum_value)

Set the Max (introduced in DDL 3.0)

Parameters
maximum_valuethe maximum value to set for information

◆ setMin()

void ddl::dd::datamodel::DataType::setMin ( const std::string & minimum_value)

Set the Min (introduced in DDL 3.0)

Parameters
minimum_valuethe minimum value to set for information

◆ setName()

void ddl::dd::datamodel::DataType::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.

◆ setUnitName()

void ddl::dd::datamodel::DataType::setUnitName ( const std::string & unit_name)

Set the Unit Name.

Parameters
unit_name

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