ADTF
ValueGetter< DecoderType, ValueType >

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

Static Public Member Functions

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

Detailed Description

template<typename DecoderType, typename ValueType>
struct ddl::codec::ValueGetter< DecoderType, ValueType >

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 template.

Definition at line 57 of file value_access.h.

Member Function Documentation

◆ getValue()

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

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

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

Definition at line 65 of file value_access.h.

Referenced by ValueGetterSelect< DecoderType, ValueType, is_supported_leaf_type >::getValue(), and ValueGetterSelect< DecoderType, ValueType, true >::getValue().