ADTF  3.18.2
LeafCodecIndex

The Leaf codec index is a small layout information index to access the decoders/codecs data very fast. More...

Public Member Functions

 LeafCodecIndex ()=delete
 no CTOR
 
 LeafCodecIndex (const CodecIndex &codec_index, ddl::DataRepresentation rep=DataRepresentation::deserialized)
 CTOR. More...
 
const LeafLayoutgetLayout () const noexcept
 Get the leaf layout. More...
 

Static Public Member Functions

template<bool ThrowError>
static bool convertToLeafLayout (const CodecIndex &codec_index, LeafLayout &leaf_layout, ddl::DataRepresentation rep)
 Retrieves a valid, small, 8-bytes LeafLayout from a CodecIndex. More...
 

Private Types

template<bool ThrowError>
using throw_error = std::integral_constant< bool, ThrowError >
 

Static Private Member Functions

static bool convertToLeafLayout (const CodecIndex &codec_index, LeafLayout &leaf_layout, ddl::DataRepresentation rep, throw_error< false >) noexcept
 For internal use only.
 
static bool convertToLeafLayout (const CodecIndex &codec_index, LeafLayout &leaf_layout, ddl::DataRepresentation rep, throw_error< true >)
 For internal use only.
 
template<typename T >
static bool checkTypeSize (const CodecIndex &codec_index, ddl::DataRepresentation rep, bool exact_check_on_serialized, throw_error< false >) noexcept
 For internal use only.
 
template<typename T >
static bool checkTypeSize (const CodecIndex &codec_index, ddl::DataRepresentation rep, bool exact_check, throw_error< true >)
 For internal use only.
 
template<bool ThrowError>
static bool checkLeafLayout (const CodecIndex &codec_index, ddl::DataRepresentation rep)
 For internal use only.
 

Private Attributes

LeafLayout _leaf_layout
 For internal use only.
 

Detailed Description

The Leaf codec index is a small layout information index to access the decoders/codecs data very fast.

There are following constraints:

  • only possible to retrieve layout information for a leaf within the struct
  • only standard data types are supported
  • no customized data type can be used (standard must have standard sizes, user types are not possible)
  • with this index it is not possible to identify the name of the element
  • no complex types or the whole array element can be accessed
  • it can only describe serialized or deserialized data representation, you need to set while creating it

Definition at line 117 of file leaf_value_access.h.

Constructor & Destructor Documentation

◆ LeafCodecIndex()

LeafCodecIndex ( const CodecIndex codec_index,
ddl::DataRepresentation  rep = DataRepresentation::deserialized 
)
inline

CTOR.

Parameters
codec_indexthe valid codec index to create the LeafCodecIndex from
repthe data representation to extract for decoding

Definition at line 132 of file leaf_value_access.h.

References LeafCodecIndex::_leaf_layout, and LeafCodecIndex::convertToLeafLayout().

Member Function Documentation

◆ convertToLeafLayout()

static bool convertToLeafLayout ( const CodecIndex codec_index,
LeafLayout leaf_layout,
ddl::DataRepresentation  rep 
)
inlinestatic

Retrieves a valid, small, 8-bytes LeafLayout from a CodecIndex.

Template Parameters
ThrowErrorThrows if the conversion is not possible. (If set to false, the return value must be checked!)
Parameters
codec_indexThe CodecIndex to retrieve the lyout information from
leaf_layoutThe new small leaf layout
repThe layout information for a serialzed or deserialized representation
Returns
true The layout retrieval was successfully
false The layout retrieval was not successfully

Definition at line 158 of file leaf_value_access.h.

Referenced by LeafCodecIndex::LeafCodecIndex(), and LeafCodecIndex::convertToLeafLayout().

◆ getLayout()

const LeafLayout& getLayout ( ) const
inlinenoexcept

Get the leaf layout.

Returns
const LeafLayout&

Definition at line 141 of file leaf_value_access.h.

References LeafCodecIndex::_leaf_layout.

Referenced by StaticDecoder::getElementValue(), Codec::setElementValue(), and StaticCodec::setElementValue().