ADTF  3.18.2
ValueGetterSelect< DecoderType, ValueType, true >

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

Static Public Member Functions

static ValueType getValue (const DecoderType &decoder, const CodecIndex &codec_index)
 Returns the current value of the given element as a ValueType if supported. More...
 

Detailed Description

template<typename DecoderType, typename ValueType>
struct ddl::codec::ValueGetterSelect< DecoderType, ValueType, true >

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.

Definition at line 185 of file value_access.h.

Member Function Documentation

◆ getValue()

static ValueType 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.

Definition at line 193 of file value_access.h.

References ValueGetter< DecoderType, ValueType >::getValue(), and LeafValueGetter< ValueType >::getValue().