ADTF  3.18.2
DataType

observable DataDefinition object class to describe (POD) DataType. More...

Inheritance diagram for DataType:
[legend]

Public Member Functions

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

Private Attributes

size_t _bit_size = 0
 
std::string _description = {}
 
OptionalSize _array_size = {}
 
std::string _unit_name = {}
 
std::string _minimum_value = {}
 
std::string _maximum_value = {}
 
OptionalSize _default_type_alignment = {}
 

Additional Inherited Members

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

Definition at line 111 of file datamodel_types.h.

Constructor & Destructor Documentation

◆ DataType() [1/2]

DataType ( const std::string &  name,
size_t  bit_size,
const std::string &  description = {},
OptionalSize  array_size = {},
const std::string &  unit_name = {},
const std::string &  minimum_value = {},
const 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]

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!"};

Member Function Documentation

◆ getArraySize()

OptionalSize getArraySize ( ) const

Get the Array Size (optional)

Returns
OptionalSize

◆ getBitSize()

size_t getBitSize ( ) const

Get the Bit Size.

Returns
size_t

◆ getDefaultAlignment()

const OptionalSize& getDefaultAlignment ( ) const

Get the default Alignment if set.

Returns
const OptionalSize&

◆ getDescription()

const std::string& getDescription ( ) const

Get the Description.

Returns
const std::string&

◆ getMax()

const std::string& getMax ( ) const

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

Returns
const std::string&

◆ getMin()

const std::string& getMin ( ) const

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

Returns
const std::string&

◆ getTypeOfType()

TypeOfType getTypeOfType ( ) const
overridevirtual

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

Returns
TypeOfType

Implements TypeBase.

◆ getUnitName()

const std::string& getUnitName ( ) const

Get the Unit Name.

Returns
const std::string&

◆ operator!=()

bool 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& operator= ( const DataType )
default

copy assignment operator.

Returns
DataType&

◆ operator=() [2/2]

DataType& operator= ( DataType &&  )
default

move assignment operator.

Returns
DataType&

◆ operator==()

bool 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 setArraySize ( OptionalSize  array_size)

Set the Array Size object.

Parameters
array_sizethe optional array to set.

◆ setBitSize()

void setBitSize ( size_t  size)

Set the Bit Size.

Parameters
sizethe number of bits of this type

◆ setDescription()

void setDescription ( const std::string &  description)

Set the Description.

Parameters
descriptionthe description to set

◆ setMax()

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

◆ setUnitName()

void setUnitName ( const std::string &  unit_name)

Set the Unit Name.

Parameters
unit_name