ADTF  3.18.2
ElementTypeInfo

Element Size Info is important to get the calculate the TypeInfo for StructType. More...

Inheritance diagram for ElementTypeInfo:
[legend]

Public Member Functions

DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API ElementTypeInfo ()=default
 default CTOR
 
OptionalSize getDeserializedBytePos (size_t array_pos=0) const
 Get the Deserialized Byte Pos This position is always invalid for positions after a dynamic content (isAfterDynamic) More...
 
OptionalSize getDeserializedByteSize () const
 Get the Deserialized Byte Size always aligned, depending on the struct_ddl_version. More...
 
size_t getDeserializedTypeByteSize () const
 Get the Deserialized Type Byte Size usually this is the same like getDeserializedByteSize, but only for array_size = 1 always aligned, depending on the struct_ddl_version >= 3.0. More...
 
size_t getDeserializedTypeAlignedByteSize () const
 Get the Deserialized Type Byte Size usually this is the same like getDeserializedByteSize, but only for array_size = 1 usually this is the size for all elements of an array except the last one on struct_ddl_version >= 3.0. More...
 
OptionalSize getSerializedBytePos (size_t array_pos=0) const
 Get the Serialized Byte Pos This position is always invalid for positions after a dynamic content (isAfterDynamic) More...
 
OptionalSize getSerializedBitOffset (size_t array_pos=0) const
 Get the Serialized Bit Pos of the element as bit offset to the beginning of the struct This position is always invalid for positions after a dynamic content (isAfterDynamic) More...
 
size_t getSerializedBitSize () const
 Get the Serialized Bit Size. More...
 
size_t getSerializedTypeBitSize () const
 Get the Serialized Type Bit Size. More...
 
bool isDynamic () const
 Determines if the element itself or if it is element of a struct_type defines a dynamic array. More...
 
bool isAfterDynamic () const
 The element is after a dynamic content. More...
 
bool isValid () const
 Determines if all size can be calculated, all references are known and the dependencies are well defined. More...
 
TypeOfType getTypeOfType () const
 Get the Type Of Type object Fast access to the type information. More...
 
std::shared_ptr< const datamodel::StructTypegetStructType () const
 Get the Struct Type Object. More...
 
std::shared_ptr< const datamodel::EnumTypegetEnumType () const
 Get the Enum Type object. More...
 
std::shared_ptr< const datamodel::DataTypegetDataType () const
 Get the Data Type object. More...
 
void update (datamodel::StructType::Element &element, const std::shared_ptr< datamodel::StructType::Element > &previous_element, const Version &struct_ddl_version, datamodel::DataDefinition &parent_dd)
 Updates all information of the element. More...
 
bool updateReference (const datamodel::StructType::Element &element, datamodel::DataDefinition &parent_dd)
 Updates the current type reference to the new model. 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::element_type_info
 definiton of info type to use the datamodel::Info template.
 

Private Attributes

OptionalSize _deserialized_byte_pos = {}
 
OptionalSize _deserialized_byte_size = {}
 
size_t _deserialized_type_byte_size = 0
 
size_t _deserialized_type_aligned_byte_size = 0
 
OptionalSize _serialized_byte_pos = {}
 
OptionalSize _serialized_absolute_bit_offset = {}
 
OptionalSize _serialized_bit_size = {}
 
size_t _serialized_type_bit_size = 0
 
bool _is_dynamic = false
 
bool _is_after_dynamic = false
 
bool _is_valid = false
 
datamodel::ElementType _element_type
 

Additional Inherited Members

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

Detailed Description

Element Size Info is important to get the calculate the TypeInfo for StructType.

It will only updated by the TypeInfo::update method for StructType. @dev_essential_deprecated Use ddl::dd::StructTypeAccess and ddl::dd::StructElementAccess instead.

Definition at line 175 of file dd_typeinfomodel.h.

Member Function Documentation

◆ getDataType()

std::shared_ptr<const datamodel::DataType> getDataType ( ) const

Get the Data Type object.

If the type is enum_type the value is set to the defined Data Type Object the enum_type depends on.

Returns
returns a valid pointer if the type of this element is a data_type (or enum_type) and the infomation is valid (see isValid())!
const std::shared_ptr<const datamodel::DataType>

◆ getDeserializedBytePos()

OptionalSize getDeserializedBytePos ( size_t  array_pos = 0) const

Get the Deserialized Byte Pos This position is always invalid for positions after a dynamic content (isAfterDynamic)

Parameters
array_posthis ould calculate and return the deserialized pos for the aligned array pos.
Returns
OptionalSize the position if valid.

◆ getDeserializedByteSize()

OptionalSize getDeserializedByteSize ( ) const

Get the Deserialized Byte Size always aligned, depending on the struct_ddl_version.

Returns
OptionalSize the deserialize size (aligned for ddl version >= 3.0, not aligned for other)
See also
getDeserializedTypeAlignedByteSize

◆ getDeserializedTypeAlignedByteSize()

size_t getDeserializedTypeAlignedByteSize ( ) const

Get the Deserialized Type Byte Size usually this is the same like getDeserializedByteSize, but only for array_size = 1 usually this is the size for all elements of an array except the last one on struct_ddl_version >= 3.0.

Returns
size_t the byte size of the type only

◆ getDeserializedTypeByteSize()

size_t getDeserializedTypeByteSize ( ) const

Get the Deserialized Type Byte Size usually this is the same like getDeserializedByteSize, but only for array_size = 1 always aligned, depending on the struct_ddl_version >= 3.0.

Returns
size_t the byte size of the type only

◆ getEnumType()

std::shared_ptr<const datamodel::EnumType> getEnumType ( ) const

Get the Enum Type object.

Returns
returns a valid pointer if the type of this element is a enum_type and the infomation is valid (see isValid())!
const std::shared_ptr<const datamodel::EnumType>

◆ getSerializedBitOffset()

OptionalSize getSerializedBitOffset ( size_t  array_pos = 0) const

Get the Serialized Bit Pos of the element as bit offset to the beginning of the struct This position is always invalid for positions after a dynamic content (isAfterDynamic)

Parameters
array_posthe position in the array to calculate the offset for
Returns
OptionalSize the position if valid

◆ getSerializedBitSize()

size_t getSerializedBitSize ( ) const

Get the Serialized Bit Size.

Returns
size_t the bitsize if set or the one of the type

◆ getSerializedBytePos()

OptionalSize getSerializedBytePos ( size_t  array_pos = 0) const

Get the Serialized Byte Pos This position is always invalid for positions after a dynamic content (isAfterDynamic)

Parameters
array_posthe position in the array to calculate the offset for
Returns
OptionalSize the position if valid

◆ getSerializedTypeBitSize()

size_t getSerializedTypeBitSize ( ) const

Get the Serialized Type Bit Size.

Returns
size_t size of the type (only size for array size=1)

◆ getStructType()

std::shared_ptr<const datamodel::StructType> getStructType ( ) const

Get the Struct Type Object.

Returns
returns a valid pointer if the type of this element is a struct_type and the infomation is valid (see isValid())!
const std::shared_ptr<const datamodel::StructType>

◆ getTypeOfType()

TypeOfType getTypeOfType ( ) const

Get the Type Of Type object Fast access to the type information.

Returns
TypeOfType

◆ isAfterDynamic()

bool isAfterDynamic ( ) const

The element is after a dynamic content.

All positions can only be calculated if the sizes of the elements before are known.

Returns
true the element is after a dynamic content.
false the element is not after a dynamic content

◆ isDynamic()

bool isDynamic ( ) const

Determines if the element itself or if it is element of a struct_type defines a dynamic array.

Returns
true The elemnt is a dynmic array or is a instance of a struct_type that contains dynamic arrays
false this is a static content, sizes can be calculated.

◆ isValid()

bool isValid ( ) const

Determines if all size can be calculated, all references are known and the dependencies are well defined.

Usually the ddl::dd::DataDefinition implementation prevent this, but

Returns
true it is valid
false it is not valid

◆ update()

void update ( datamodel::StructType::Element element,
const std::shared_ptr< datamodel::StructType::Element > &  previous_element,
const Version struct_ddl_version,
datamodel::DataDefinition parent_dd 
)

Updates all information of the element.

This will recalculate the infomation and set the byte position and type references if valid.

Parameters
elementthe element to create the information for
previous_elementthe previous element
struct_ddl_versionthe language version set in the parent struct type (this influences the alignmend etc.)
parent_ddthe parent DD to retrieve all dependencies.

◆ updateReference()

bool updateReference ( const datamodel::StructType::Element element,
datamodel::DataDefinition parent_dd 
)

Updates the current type reference to the new model.

Parameters
elementthe element corresponding to the current element type info
parent_ddthe parent DD to retrieve all dependencies.
Returns
bool reference update suceeded
Remarks
This is an optimization to prevent reinit of type info while copying struct_type