ADTF
LeafValueSetter< ValueType >

Value setter to set the current value of the given element from a type ValueType if supported. More...

Static Public Member Functions

static void setValue (void *data, const size_t data_size, const LeafLayout &leaf_layout, const ValueType &value)
 Sets the current value if the given element as a ValueType if supported. More...
 

Detailed Description

template<typename ValueType>
struct ddl::codec::LeafValueSetter< 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 and double are supported).
Remarks
If you want to support your own data type, then create a specialization of this template.

Definition at line 892 of file leaf_value_access.h.

Member Function Documentation

◆ setValue()

static void setValue ( void *  data,
const size_t  data_size,
const LeafLayout leaf_layout,
const ValueType &  value 
)
inlinestatic

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

Parameters
leaf_layoutThe small leaf layout of the element to get.
dataThe data area to set the value to
data_sizeThe data area size in bytes
[in]valueThe value to set as ValueType, if supported.
Exceptions
std::runtime_errorif there is no valid conversion or the given layout is invalid

Definition at line 901 of file leaf_value_access.h.

References LeafLayout::data_flags, and ddl::codec::serialized.

Referenced by Codec::setElementValue(), StaticCodec::setElementValue(), and ValueSetterSelect< CodecType, ValueType, true >::setValue().