Dev Essential  1.6.3
Loading...
Searching...
No Matches
ddl::codec::ValueSetter< CodecType, ValueType > Struct Template Reference

#include <value_access.h>

Static Public Member Functions

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

Detailed Description

template<typename CodecType, typename ValueType>
struct ddl::codec::ValueSetter< CodecType, ValueType >

Value setter to set the current value of the given element from a type 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 this template.

Member Function Documentation

◆ setValue()

template<typename CodecType, typename ValueType>
static void ddl::codec::ValueSetter< CodecType, ValueType >::setValue ( CodecType & codec,
const CodecIndex & codec_index,
const ValueType & value )
inlinestatic

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

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

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