ADTF
Loading...
Searching...
No Matches
leaf_layout.h
Go to the documentation of this file.
1
15
16#ifndef DDL_LEAF_LAYOUT_CLASS_HEADER
17#define DDL_LEAF_LAYOUT_CLASS_HEADER
18
19namespace ddl {
20namespace codec {
21
25enum class LeafDataRepresentation : uint8_t {
35 serialized = 0x01,
46};
47
51enum class LeafElementType : uint8_t {
52 let_bool = static_cast<uint8_t>(ElementType::cet_bool),
53 let_int8 = static_cast<uint8_t>(ElementType::cet_int8),
55 static_cast<uint8_t>(ElementType::cet_uint8),
57 static_cast<uint8_t>(ElementType::cet_int16),
59 static_cast<uint8_t>(ElementType::cet_uint16),
61 static_cast<uint8_t>(ElementType::cet_int32),
63 static_cast<uint8_t>(ElementType::cet_uint32),
65 static_cast<uint8_t>(ElementType::cet_int64),
67 static_cast<uint8_t>(ElementType::cet_uint64),
68 let_float = static_cast<uint8_t>(ElementType::cet_float),
69 let_double = static_cast<uint8_t>(ElementType::cet_double),
70};
71
76struct LeafLayout {
78 static constexpr uint32_t _invalid_pos = static_cast<uint32_t>(-1);
80 static constexpr size_t _max_byte_size = 31;
82 static constexpr size_t _max_bit_size = 255;
83
85 uint32_t byte_pos =
86 _invalid_pos; // we do not need to use size_t here because CodecLayout will have bits!
88 uint8_t bit_pos = {}; // bitpos is only set in serialzed representation
90 LeafElementType element_type{}; // elementtype
92 uint8_t bit_size = {}; // max. 255bit for userdefined types!
94 uint8_t data_flags = static_cast<uint8_t>(LeafDataRepresentation::deserialized);
95};
96
97} // namespace codec
98} // namespace ddl
99
100#endif
Namespace for the new faster CodecFactory/Decoder/Codec implementation.
Definition codec.h:22
LeafElementType
Definition leaf_layout.h:51
@ let_uint64
LeafElementType type is std::uint64_t.
Definition leaf_layout.h:66
@ let_uint8
LeafElementType type is std::uint8_t.
Definition leaf_layout.h:54
@ let_double
LeafElementType type is double.
Definition leaf_layout.h:69
@ let_int8
LeafElementType type is std::int8_t.
Definition leaf_layout.h:53
@ let_int64
LeafElementType type is std::int64_t.
Definition leaf_layout.h:64
@ let_float
LeafElementType type is float.
Definition leaf_layout.h:68
@ let_int32
LeafElementType type is std::int32_t.
Definition leaf_layout.h:60
@ let_uint32
LeafElementType type is std::uint32_t.
Definition leaf_layout.h:62
@ let_bool
LeafElementType type is bool.
Definition leaf_layout.h:52
@ let_uint16
LeafElementType type is std::uint16_t.
Definition leaf_layout.h:58
@ let_int16
LeafElementType type is std::int16_t.
Definition leaf_layout.h:56
LeafDataRepresentation
LeafLayout data representation flags.
Definition leaf_layout.h:25
@ serialized_le
first bit is set second bit is not set for serialized data representation in little endianess of the ...
Definition leaf_layout.h:45
@ deserialized
first bit is zero for deserialized data representation of the LeafCodecIndex::data_flags
Definition leaf_layout.h:30
@ serialized_be
first and second bit is set for serialized data representation in big endianess of the LeafCodecIndex...
Definition leaf_layout.h:40
@ serialized
first bit is set for serialized data representation of the LeafCodecIndex::data_flags
Definition leaf_layout.h:35
@ cet_float
Variant type is float.
Definition codec_type_info.h:41
@ cet_int16
Variant type is std::int16_t.
Definition codec_type_info.h:35
@ cet_int8
Variant type is std::int8_t.
Definition codec_type_info.h:33
@ cet_uint64
Variant type is std::uint64_t.
Definition codec_type_info.h:40
@ cet_uint8
Variant type is std::uint8_t.
Definition codec_type_info.h:34
@ cet_uint32
Variant type is std::uint32_t.
Definition codec_type_info.h:38
@ cet_bool
Variant type is bool.
Definition codec_type_info.h:32
@ cet_uint16
Variant type is std::uint16_t.
Definition codec_type_info.h:36
@ cet_int32
Variant type is std::int32_t.
Definition codec_type_info.h:37
@ cet_int64
Variant type is std::int64_t.
Definition codec_type_info.h:39
@ cet_double
Variant type is double.
Definition codec_type_info.h:42
definition of the ddl namespace
Definition codec.h:21
small leaf layout information to access codec data very fast.
Definition leaf_layout.h:76
static constexpr size_t _max_bit_size
max type bit size of an element (usually this can not be reached for standard data types)
Definition leaf_layout.h:82
uint8_t bit_size
type bit size of an element for serialized or deserialized
Definition leaf_layout.h:92
uint32_t byte_pos
byte position of the element for serialized or deserialized
Definition leaf_layout.h:85
LeafElementType element_type
type of the value. accept all valid leaf types, except user defined types
Definition leaf_layout.h:90
uint8_t bit_pos
bit position of the element for serialized only
Definition leaf_layout.h:88
uint8_t data_flags
flags of the described layout
Definition leaf_layout.h:94
static constexpr size_t _max_byte_size
max type byte size of an element (usually this can not be reached for standard data types)
Definition leaf_layout.h:80
static constexpr uint32_t _invalid_pos
invalid position for byte_pos
Definition leaf_layout.h:78