ADTF
Loading...
Searching...
No Matches
ddl::codec::detail::SourceValueConverter< ElementValueType, SourceValueType, conversion_allowed > Struct Template Reference

Converter to convert from a value of SourceValueType to a value of ElementValueType. More...

#include <leaf_value_access.h>

Static Public Member Functions

static bool convert (ElementValueType &element_value, const SourceValueType &value)
 Converts a value of SourceValueType to a element_value of type ElementValueType.
 

Detailed Description

template<typename ElementValueType, typename SourceValueType, bool conversion_allowed = SupportSourceTypeConversion<ElementValueType, SourceValueType>::value>
struct ddl::codec::detail::SourceValueConverter< ElementValueType, SourceValueType, conversion_allowed >

Converter to convert from a value of SourceValueType to a value of ElementValueType.

Template Parameters
ElementValueTypeThe elements value target type
SourceValueTypeThe values source type
conversion_allowedevaluates to a bool value if conversion is possible

Member Function Documentation

◆ convert()

template<typename ElementValueType, typename SourceValueType, bool conversion_allowed = SupportSourceTypeConversion<ElementValueType, SourceValueType>::value>
static bool ddl::codec::detail::SourceValueConverter< ElementValueType, SourceValueType, conversion_allowed >::convert ( ElementValueType & element_value,
const SourceValueType & value )
inlinestatic

Converts a value of SourceValueType to a element_value of type ElementValueType.

Parameters
element_valueThe converted value
valuethe value to convert
Returns
true The conversion is possible
false The converion was not possible (i.e. enum type to float)

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