ADTF
3.18.4
|
The leaf value access decoding and encoding is a header only optimization for leaf values of standard types at 1-byte aligned positions. More...
Go to the source code of this file.
Classes | |
struct | LeafLayout |
small leaf layout information to access codec data very fast. More... | |
class | LeafCodecIndex |
The Leaf codec index is a small layout information index to access the decoders/codecs data very fast. More... | |
struct | SupportedLeafValueTypeExplicit< ValueType > |
struct | SupportTargetTypeConversion< ElementValueTypeFrom, TargetValueTypeTo > |
struct | SupportAnyFromFundamentalConversion< ValueType > |
struct | TargetValueConverter< ElementValueType, TargetValueType, conversion_allowed > |
Converter to convert a value of ElementValueType to a value of TargetValueType . More... | |
struct | TargetValueConverter< ElementValueType, TargetValueType, false > |
Converter to convert a value of ElementValueType to a value of TargetValueType . More... | |
struct | SupportSourceTypeConversion< ElementValueTypeTo, SourceValueTypeFrom > |
struct | SupportAnyToFundamentalConversion< ValueType > |
struct | SourceValueConverter< ElementValueType, SourceValueType, conversion_allowed > |
Converter to convert from a value of SourceValueType to a value of ElementValueType . More... | |
struct | SourceValueConverter< ElementValueType, SourceValueType, false > |
Converter to convert from a value of SourceValueType to a value of ElementValueType . More... | |
struct | LeafValueGetter< ValueType > |
Value getter to retrieve the current value of the given element as a ValueType if supported from a data area. More... | |
struct | LeafValueSetter< ValueType > |
Value setter to set the current value of the given element from a type ValueType if supported. More... | |
Namespaces | |
ddl | |
definition of the ddl namespace | |
ddl::codec | |
Namespace for the new faster CodecFactory/Decoder/Codec implementation. | |
Enumerations | |
enum class | LeafDataRepresentation : uint8_t { deserialized = 0x00 , serialized = 0x01 , serialized_be = 0x03 , serialized_le = 0x01 } |
LeafLayout data representation flags. More... | |
enum class | LeafElementType : uint8_t { let_bool = static_cast<uint8_t>(ElementType::cet_bool) , let_int8 = static_cast<uint8_t>(ElementType::cet_int8) , let_uint8 , let_int16 , let_uint16 , let_int32 , let_uint32 , let_int64 , let_uint64 , let_float = static_cast<uint8_t>(ElementType::cet_float) , let_double = static_cast<uint8_t>(ElementType::cet_double) } |
Valid ElementTypes for the LeafLayout. More... | |
Functions | |
template<typename ElementValueType , typename TargetValueType > | |
TargetValueType | readBytes (const void *data, const size_t &data_size, uint32_t byte_pos) |
Read the bytes from a data area and converts this value to the TargetValueType . More... | |
template<typename ElementValueType , typename SourceValueType > | |
void | writeBytes (void *data, const size_t &data_size, uint32_t byte_pos, const SourceValueType &source_value) |
Writes the value of source_value to the data area after conversion to the elements ElementValueType . More... | |
template<typename ElementValueType , typename TargetValueType > | |
TargetValueType | readBits (const void *data, size_t data_size, size_t bit_offset, size_t bit_size, a_util::memory::Endianess byte_order) |
Read the bits from a data area and converts this value to the TargetValueType . More... | |
template<typename ElementValueType , typename SourceValueType > | |
void | writeBits (void *data, size_t data_size, size_t bit_offset, size_t bit_size, a_util::memory::Endianess byte_order, const SourceValueType &source_value) |
Write the bits of the element to the data area after conversion from source_value . More... | |
template<typename ValueType > | |
ValueType | readDeserializedBytes (const void *data, const size_t &data_size, const LeafLayout &layout) |
Retrieves a value from the given data area with the layout information of the layout . More... | |
template<typename ValueType > | |
ValueType | readSerializedBits (const void *data, const size_t &data_size, const LeafLayout &layout) |
Retrieves a value from the given data area with the layout information of the layout . More... | |
template<typename ValueType > | |
void | writeDeserializedBytes (void *data, const size_t &data_size, const LeafLayout &layout, const ValueType &value) |
Writes a value to the given data area with the layout information of the layout . More... | |
template<typename ValueType > | |
void | writeSerializedBits (void *data, const size_t &data_size, const LeafLayout &layout, const ValueType &value) |
Writes a value to the given data area with the layout information of the layout . More... | |
The leaf value access decoding and encoding is a header only optimization for leaf values of standard types at 1-byte aligned positions.
Copyright @ 2023 VW Group. All rights reserved. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
Definition in file leaf_value_access.h.
TargetValueType ddl::codec::detail::readBits | ( | const void * | data, |
size_t | data_size, | ||
size_t | bit_offset, | ||
size_t | bit_size, | ||
a_util::memory::Endianess | byte_order | ||
) |
Read the bits from a data
area and converts this value to the TargetValueType
.
ElementValueType | The type for retrieving the value |
TargetValueType | The target value type to convert to |
data | The data pointer of the memory |
data_size | The data size of data (in bytes) |
bit_offset | The bit offset of the value to retrieve in ElementValueType |
bit_size | The size of the value to retrieve in ElementValueType |
byte_order | The byteorder of the value to retrieve in ElementValueType |
std::runtime_error | if there is no valid conversion or the given bytepos is invalid |
Definition at line 551 of file leaf_value_access.h.
References TargetValueConverter< ElementValueType, TargetValueType, conversion_allowed >::convert(), BitSerializer::read(), and ddl::codec::detail::readBits().
Referenced by ddl::codec::detail::readBits().
TargetValueType ddl::codec::detail::readBytes | ( | const void * | data, |
const size_t & | data_size, | ||
uint32_t | byte_pos | ||
) |
Read the bytes from a data
area and converts this value to the TargetValueType
.
ElementValueType | The type for retrieving the value (this idetifies the size of the value within data ) |
TargetValueType | The target value type to convert to |
data | The data pointer of the memory |
data_size | The data size of data (in bytes) |
byte_pos | The byte position to retrieve the value |
std::runtime_error | if there is no valid conversion or the given bytepos is invalid |
Definition at line 495 of file leaf_value_access.h.
References TargetValueConverter< ElementValueType, TargetValueType, conversion_allowed >::convert(), and ddl::codec::detail::readBytes().
Referenced by ddl::codec::detail::readBytes().
ValueType ddl::codec::detail::readDeserializedBytes | ( | const void * | data, |
const size_t & | data_size, | ||
const LeafLayout & | layout | ||
) |
Retrieves a value from the given data
area with the layout information of the layout
.
ValueType | The requested value type to retrieve the element in |
data | The data pointer of the memory |
data_size | The data size of data (in bytes) |
layout | The layout information |
std::runtime_error | if there is no valid conversion or the given layout is invalid |
Definition at line 613 of file leaf_value_access.h.
References LeafLayout::byte_pos, LeafLayout::element_type, ddl::codec::let_bool, ddl::codec::let_double, ddl::codec::let_float, ddl::codec::let_int16, ddl::codec::let_int32, ddl::codec::let_int64, ddl::codec::let_int8, ddl::codec::let_uint16, ddl::codec::let_uint32, ddl::codec::let_uint64, ddl::codec::let_uint8, and ddl::codec::detail::readDeserializedBytes().
Referenced by ddl::codec::detail::readDeserializedBytes().
ValueType ddl::codec::detail::readSerializedBits | ( | const void * | data, |
const size_t & | data_size, | ||
const LeafLayout & | layout | ||
) |
Retrieves a value from the given data
area with the layout information of the layout
.
ValueType | The requested value type to retrieve the element in |
data | The data pointer of the memory |
data_size | The data size of data (in bytes) |
layout | The layout information |
std::runtime_error | if there is no valid conversion or the given layout is invalid |
Definition at line 668 of file leaf_value_access.h.
References LeafLayout::bit_pos, LeafLayout::bit_size, LeafLayout::byte_pos, LeafLayout::data_flags, LeafLayout::element_type, ddl::codec::let_bool, ddl::codec::let_double, ddl::codec::let_float, ddl::codec::let_int16, ddl::codec::let_int32, ddl::codec::let_int64, ddl::codec::let_int8, ddl::codec::let_uint16, ddl::codec::let_uint32, ddl::codec::let_uint64, ddl::codec::let_uint8, ddl::codec::detail::readSerializedBits(), and ddl::codec::serialized_be.
Referenced by ddl::codec::detail::readSerializedBits().
void ddl::codec::detail::writeBits | ( | void * | data, |
size_t | data_size, | ||
size_t | bit_offset, | ||
size_t | bit_size, | ||
a_util::memory::Endianess | byte_order, | ||
const SourceValueType & | source_value | ||
) |
Write the bits of the element to the data
area after conversion from source_value
.
ElementValueType | The elements type the write |
SourceValueType | The type to convert from |
data | The data pointer of the memory |
data_size | The data size of data (in bytes) |
bit_offset | The bit offset of the value to write |
bit_size | The size of the value to write |
byte_order | The byteorder of the value to write |
source_value | The source value to convert from |
std::runtime_error | if there is no valid conversion or the given bitpos is invalid |
Definition at line 580 of file leaf_value_access.h.
References BitSerializer::write(), and ddl::codec::detail::writeBits().
Referenced by ddl::codec::detail::writeBits().
void ddl::codec::detail::writeBytes | ( | void * | data, |
const size_t & | data_size, | ||
uint32_t | byte_pos, | ||
const SourceValueType & | source_value | ||
) |
Writes the value of source_value
to the data
area after conversion to the elements ElementValueType
.
ElementValueType | The type of the element within the data area |
SourceValueType | The source value type to write |
data | the data pointer of the memory |
data_size | the data size of data (in bytes) |
byte_pos | the byte pos to write the value |
source_value | The source value to convert and write |
std::runtime_error | if there is no valid conversion or the given bytepos is invalid |
Definition at line 518 of file leaf_value_access.h.
References ddl::codec::detail::writeBytes().
Referenced by ddl::codec::detail::writeBytes().
void ddl::codec::detail::writeDeserializedBytes | ( | void * | data, |
const size_t & | data_size, | ||
const LeafLayout & | layout, | ||
const ValueType & | value | ||
) |
Writes a value to the given data
area with the layout information of the layout
.
ValueType | The value type to set the elements content from |
data | The data pointer of the memory |
data_size | The data size of data (in bytes) |
layout | The layout information |
value | The value to set the element |
std::runtime_error | if there is no valid conversion or the given layout is invalid |
Definition at line 730 of file leaf_value_access.h.
References LeafLayout::byte_pos, LeafLayout::element_type, ddl::codec::let_bool, ddl::codec::let_double, ddl::codec::let_float, ddl::codec::let_int16, ddl::codec::let_int32, ddl::codec::let_int64, ddl::codec::let_int8, ddl::codec::let_uint16, ddl::codec::let_uint32, ddl::codec::let_uint64, ddl::codec::let_uint8, and ddl::codec::detail::writeDeserializedBytes().
Referenced by ddl::codec::detail::writeDeserializedBytes().
void ddl::codec::detail::writeSerializedBits | ( | void * | data, |
const size_t & | data_size, | ||
const LeafLayout & | layout, | ||
const ValueType & | value | ||
) |
Writes a value to the given data
area with the layout information of the layout
.
ValueType | The value type to set the elements content from |
data | The data pointer of the memory |
data_size | The data size of data (in bytes) |
layout | The layout information |
value | The value to set the element |
std::runtime_error | if there is no valid conversion or the given layout is invalid |
Definition at line 789 of file leaf_value_access.h.
References LeafLayout::bit_pos, LeafLayout::bit_size, LeafLayout::byte_pos, LeafLayout::data_flags, LeafLayout::element_type, ddl::codec::let_bool, ddl::codec::let_double, ddl::codec::let_float, ddl::codec::let_int16, ddl::codec::let_int32, ddl::codec::let_int64, ddl::codec::let_int8, ddl::codec::let_uint16, ddl::codec::let_uint32, ddl::codec::let_uint64, ddl::codec::let_uint8, ddl::codec::serialized_be, and ddl::codec::detail::writeSerializedBits().
Referenced by ddl::codec::detail::writeSerializedBits().