ADTF  3.18.2
ValueSetterSelect< CodecType, ValueType, is_supported_leaf_type >

Value setter to set the value of the given element as a ValueType if supported. More...

Static Public Member Functions

static void setValue (CodecType &codec, const CodecIndex &codec_index, const ValueType &value)
 Sets the current value of the given element as a ValueType if supported. More...
 

Detailed Description

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

Value setter to set the value of the given element as a ValueType if supported.

Template Parameters
CodecTypeThe type of the codec.
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 ValueSetter.

Definition at line 219 of file value_access.h.

Member Function Documentation

◆ setValue()

static void setValue ( CodecType &  codec,
const CodecIndex codec_index,
const ValueType &  value 
)
inlinestatic

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

Parameters
[in]codec_indexThe codec index of the element.
[in]codecThe codec to set the value to.
[in]valuethe value as ValueType to set.
Exceptions
throwsstd::runtime_error if not found by codec.

Definition at line 227 of file value_access.h.

References ValueSetter< CodecType, ValueType >::setValue().

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