ADTF  3.18.2
TypeInfo

TypeInfo model will check for type. More...

Inheritance diagram for TypeInfo:
[legend]

Public Types

enum class  UpdateType { only_changed = 0 , force_all = 1 , only_last = 2 , only_reference = 3 }
 Update type for the struct update. More...
 

Public Member Functions

DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API TypeInfo ()=default
 default CTOR
 
DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API TypeInfo (const datamodel::DataType &data_type, datamodel::DataDefinition &parent_dd)
 CTOR to create a Type Info that is initial updated with data_type information. More...
 
DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API TypeInfo (const datamodel::EnumType &enum_type, datamodel::DataDefinition &parent_dd)
 CTOR to create a Type Info that is initial updated with enum_type information. More...
 
size_t getTypeBitSize () const
 Get the Type Bit Size. More...
 
size_t getTypeAlignment () const
 Get the Type Alignment. More...
 
size_t getTypeByteSize () const
 Get the Type Byte Size (depending on ddl version in structs this is aligned or not) More...
 
size_t getTypeAlignedByteSize () const
 Get the Type Aligned Byte Size. More...
 
size_t getTypeUnalignedByteSize () const
 Get the Type Unaligned Byte Size. More...
 
bool isValid () const
 the content is valid, all references to other DD Objects (for calculation) are valid. More...
 
bool isDynamic () const
 contains dynamic content (usually this is only possible for struct_type) More...
 
void update (const datamodel::DataType &data_type, datamodel::DataDefinition &parent_dd)
 Updates the content for a data_type. More...
 
void update (const datamodel::EnumType &enum_type, datamodel::DataDefinition &parent_dd)
 Updates the content for a enum_type. More...
 
void update (datamodel::StructType &struct_type, datamodel::DataDefinition &parent_dd, UpdateType update_type=UpdateType::only_changed)
 Updates the content for a struct_type. More...
 
- Public Member Functions inherited from IInfo
virtual ~IInfo ()=default
 virtual DTOR for IInfo object
 

Static Public Attributes

static constexpr const uint8_t INFO_TYPE_ID = dd::InfoType::type_info
 type info ID to use it in datamodel::Info.
 

Private Attributes

size_t _type_bit_size = 0
 
size_t _type_alignment = 0
 
size_t _type_byte_size = 0
 
size_t _type_aligned_byte_size = 0
 
size_t _type_unaligned_byte_size = 0
 
bool _is_dynamic = false
 
bool _is_valid = false
 
bool _already_discovering = false
 

Additional Inherited Members

- Protected Member Functions inherited from Info< TypeInfo >
uint8_t getInfoType () const override
 Get the Info Type object. More...
 

Detailed Description

TypeInfo model will check for type.

The TypeInfo is needed to:

Definition at line 44 of file dd_typeinfomodel.h.

Member Enumeration Documentation

◆ UpdateType

enum UpdateType
strong

Update type for the struct update.

Enumerator
only_changed 

update only changed elements

force_all 

force recaculation of all elements

only_last 

update the last element only

only_reference 

update the references only

Definition at line 138 of file dd_typeinfomodel.h.

Constructor & Destructor Documentation

◆ TypeInfo() [1/2]

DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API TypeInfo ( const datamodel::DataType data_type,
datamodel::DataDefinition parent_dd 
)

CTOR to create a Type Info that is initial updated with data_type information.

Parameters
data_typethe data type to initialize the info for
parent_ddthe parent DD to retrieve dependencies from

◆ TypeInfo() [2/2]

DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API TypeInfo ( const datamodel::EnumType enum_type,
datamodel::DataDefinition parent_dd 
)

CTOR to create a Type Info that is initial updated with enum_type information.

Parameters
enum_typethe data type to initialize the info for
parent_ddthe parent DD to retrieve dependencies from

Member Function Documentation

◆ getTypeAlignedByteSize()

size_t getTypeAlignedByteSize ( ) const

Get the Type Aligned Byte Size.

Returns
size_t the byte size

◆ getTypeAlignment()

size_t getTypeAlignment ( ) const

Get the Type Alignment.

Returns
size_t alignment

◆ getTypeBitSize()

size_t getTypeBitSize ( ) const

Get the Type Bit Size.

Returns
size_t the bit size of the type

◆ getTypeByteSize()

size_t getTypeByteSize ( ) const

Get the Type Byte Size (depending on ddl version in structs this is aligned or not)

Returns
size_t

◆ getTypeUnalignedByteSize()

size_t getTypeUnalignedByteSize ( ) const

Get the Type Unaligned Byte Size.

Returns
size_t the byte size

◆ isDynamic()

bool isDynamic ( ) const

contains dynamic content (usually this is only possible for struct_type)

Returns
true the struct_type contains dynamic content
false the struct_type does not contain dynamic content

◆ isValid()

bool isValid ( ) const

the content is valid, all references to other DD Objects (for calculation) are valid.

This is set to false also if a recursion loop in the definition was detected.

Returns
true the content is valid
false the content is not valid

◆ update() [1/3]

void update ( const datamodel::DataType data_type,
datamodel::DataDefinition parent_dd 
)

Updates the content for a data_type.

Parameters
data_typethe data_type
parent_ddthe parent DD

◆ update() [2/3]

void update ( const datamodel::EnumType enum_type,
datamodel::DataDefinition parent_dd 
)

Updates the content for a enum_type.

Parameters
enum_typethe enum_type
parent_ddthe parent DD

◆ update() [3/3]

void update ( datamodel::StructType struct_type,
datamodel::DataDefinition parent_dd,
UpdateType  update_type = UpdateType::only_changed 
)

Updates the content for a struct_type.

It will also create or update the ElementTypeInfo for all contained elements (if necessary).

Parameters
struct_typethe struct_type
parent_ddthe parent DD
update_typeupdate type to determine to validate only the last, the changed or all elements.