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

#include <leaf_value_access.h>

Static Public Member Functions

static ValueType getValue (const void *data, const size_t data_size, const LeafLayout &leaf_layout)
 

Detailed Description

template<typename ValueType>
struct ddl::codec::LeafValueGetter< ValueType >

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

Template Parameters
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

◆ getValue()

template<typename ValueType>
static ValueType ddl::codec::LeafValueGetter< ValueType >::getValue ( const void * data,
const size_t data_size,
const LeafLayout & leaf_layout )
inlinestatic

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

Parameters
leaf_layoutThe small leaf layout of the element to get.
dataThe data area to retrieve the value from
data_sizeThe data area size in bytes
Returns
ValueType Returns the current value as ValueType if supported.
Exceptions
std::runtime_errorif there is no valid conversion or the given layout is invalid

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