ADTF
Loading...
Searching...
No Matches
ddl::codec::ValueGetterSelect< DecoderType, ValueType, is_supported_leaf_type > Struct Template Reference

#include <value_access.h>

Static Public Member Functions

static ValueType getValue (const DecoderType &decoder, const CodecIndex &codec_index)
 

Detailed Description

template<typename DecoderType, typename ValueType, bool is_supported_leaf_type = detail::SupportedLeafValueTypeExplicit<ValueType>::value>
struct ddl::codec::ValueGetterSelect< DecoderType, ValueType, is_supported_leaf_type >

Value getter to retrieve the current value of the given element as a ValueType if supported

Template Parameters
DecoderTypeThe type of the decoder.
ValueTypeThe value type supported (by default bool, all int types, float, double and std::string are supported).
Remarks
If you want to support your own data type, then create a specialization of this ValueGetter.

Member Function Documentation

◆ getValue()

template<typename DecoderType, typename ValueType, bool is_supported_leaf_type = detail::SupportedLeafValueTypeExplicit<ValueType>::value>
static ValueType ddl::codec::ValueGetterSelect< DecoderType, ValueType, is_supported_leaf_type >::getValue ( const DecoderType & decoder,
const CodecIndex & codec_index )
inlinestatic

Returns the current value of the given element as a ValueType if supported

Parameters
[in]codec_indexThe codec index of the element.
[in]decoderThe decoder to retrieve the value from.
Returns
ValueType Returns the current value as ValueType if supported.
Exceptions
throwsstd::runtime_error if not found by decoder.

The documentation for this struct was generated from the following file: