15 #ifndef DD_TYPEINFOMODEL_H_INCLUDED
16 #define DD_TYPEINFOMODEL_H_INCLUDED
25 #define DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API \
26 DEV_ESSENTIAL_DEPRECATED( \
27 "Use the ddl::dd::StructTypeAccess and ddl::dd::StructElementAccess instead.")
52 DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API
60 DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API
68 DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API
158 size_t _type_bit_size = 0;
159 size_t _type_alignment = 0;
160 size_t _type_byte_size = 0;
161 size_t _type_aligned_byte_size = 0;
162 size_t _type_unaligned_byte_size = 0;
163 bool _is_dynamic =
false;
164 bool _is_valid =
false;
166 bool _already_discovering =
false;
186 DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API
322 const std::shared_ptr<datamodel::StructType::Element>& previous_element,
323 const Version& struct_ddl_version,
339 size_t _deserialized_type_byte_size = 0;
340 size_t _deserialized_type_aligned_byte_size = 0;
345 size_t _serialized_type_bit_size = 0;
347 bool _is_dynamic =
false;
348 bool _is_after_dynamic =
false;
349 bool _is_valid =
false;
Element Size Info is important to get the calculate the TypeInfo for StructType.
bool isAfterDynamic() const
The element is after a dynamic content.
OptionalSize getDeserializedBytePos(size_t array_pos=0) const
Get the Deserialized Byte Pos This position is always invalid for positions after a dynamic content (...
bool updateReference(const datamodel::StructType::Element &element, datamodel::DataDefinition &parent_dd)
Updates the current type reference to the new model.
DEV_ESSENTIAL_DEPRECATED_TYPEINFO_API ElementTypeInfo()=default
default CTOR
size_t getSerializedBitSize() const
Get the Serialized Bit Size.
std::shared_ptr< const datamodel::StructType > getStructType() const
Get the Struct Type Object.
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.
bool isValid() const
Determines if all size can be calculated, all references are known and the dependencies are well defi...
static constexpr const uint8_t INFO_TYPE_ID
definiton of info type to use the datamodel::Info template.
OptionalSize getDeserializedByteSize() const
Get the Deserialized Byte Size always aligned, depending on the struct_ddl_version.
bool isDynamic() const
Determines if the element itself or if it is element of a struct_type defines a dynamic array.
size_t getDeserializedTypeAlignedByteSize() const
Get the Deserialized Type Byte Size usually this is the same like getDeserializedByteSize,...
TypeOfType getTypeOfType() const
Get the Type Of Type object Fast access to the type information.
size_t getSerializedTypeBitSize() const
Get the Serialized Type Bit Size.
OptionalSize getSerializedBytePos(size_t array_pos=0) const
Get the Serialized Byte Pos This position is always invalid for positions after a dynamic content (is...
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 ...
size_t getDeserializedTypeByteSize() const
Get the Deserialized Type Byte Size usually this is the same like getDeserializedByteSize,...
std::shared_ptr< const datamodel::EnumType > getEnumType() const
Get the Enum Type object.
std::shared_ptr< const datamodel::DataType > getDataType() const
Get the Data Type object.
TypeInfo model will check for type.
UpdateType
Update type for the struct update.
@ force_all
force recaculation of all elements
@ only_changed
update only changed elements
@ only_last
update the last element only
@ only_reference
update the references only
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.
bool isValid() const
the content is valid, all references to other DD Objects (for calculation) are valid.
static constexpr const uint8_t INFO_TYPE_ID
type info ID to use it in datamodel::Info.
void update(datamodel::StructType &struct_type, datamodel::DataDefinition &parent_dd, UpdateType update_type=UpdateType::only_changed)
Updates the content for a struct_type.
bool isDynamic() const
contains dynamic content (usually this is only possible for struct_type)
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.
size_t getTypeAlignedByteSize() const
Get the Type Aligned Byte Size.
size_t getTypeUnalignedByteSize() const
Get the Type Unaligned Byte Size.
size_t getTypeAlignment() const
Get the Type Alignment.
void update(const datamodel::DataType &data_type, datamodel::DataDefinition &parent_dd)
Updates the content for a data_type.
void update(const datamodel::EnumType &enum_type, datamodel::DataDefinition &parent_dd)
Updates the content for a enum_type.
size_t getTypeByteSize() const
Get the Type Byte Size (depending on ddl version in structs this is aligned or not)
size_t getTypeBitSize() const
Get the Type Bit Size.
DataDefinition Datamodel This datamodel is observable for any change of:
observable DataDefinition object class to describe (POD) DataType.
observable DataDefinition object class to describe EnumType.
Helper template class to create valid IInfo objects.
observable DataDefinition object class for a Element of a StructType.
observable DataDefinition object class to describe StructType.
OO DataDefinition Redesign.
OO DataDefinition info model types.
Definition of preprocessor macro DEV_ESSENTIAL_DEPRECATED.
ElementType
The element type of the value.
TypeOfType
Classification of a Type.
@ enum_type
the type is a enum type (EnumType)
@ data_type
the type is a data type (DataType)
@ struct_type
the type is a struct type (StructType)
utility::Optional< size_t > OptionalSize
Optional Size Type.
@ element_type_info
Element Type Info.
definition of the ddl namespace