12 #ifndef DDL_PREVIEW_VALUE_ACCESS_PRIVATE_CLASS_HEADER
13 #define DDL_PREVIEW_VALUE_ACCESS_PRIVATE_CLASS_HEADER
23 #if defined(__GNUC__) && (__GNUC__ == 5) && defined(__QNX__)
24 #pragma GCC diagnostic ignored \
30 template <
typename ValueType>
32 :
public std::is_convertible<a_util::variant::Variant,
33 a_util::underlying_type_or_type_t<ValueType>> {
36 template <
typename ValueType>
38 :
public std::is_convertible<a_util::underlying_type_or_type_t<ValueType>,
39 a_util::variant::Variant> {
44 #if defined(__GNUC__) && (__GNUC__ == 5) && defined(__QNX__)
45 #pragma GCC diagnostic warning \
56 template <
typename DecoderType,
typename ValueType>
65 static void getValue(
const DecoderType& decoder,
70 "Unsupported type for decode. "
71 "By default bool, all int types, float, double, std::string is supported. "
72 "To support your own data type, create a specialization of this template");
74 decoder.getElementVariantValue(codec_index, variant_value);
75 value =
static_cast<ValueType
>(
84 template <
typename DecoderType>
93 static void getValue(
const DecoderType& decoder,
97 value = decoder.getElementStringValue(codec_index);
108 template <
typename CodecType,
typename ValueType>
120 "Unsupported type for decode. "
121 "By default bool, all int types, float, double, std::string is supported. "
122 "To support your own data type, create a specialization of this template");
123 codec.setElementVariantValue(
134 template <
typename CodecType>
145 codec.setElementStringValue(codec_index, value);
157 template <
typename DecoderType,
159 bool is_supported_leaf_type = detail::SupportedLeafValueTypeExplicit<ValueType>::value>
184 template <
typename DecoderType,
typename ValueType>
196 if (LeafCodecIndex::convertToLeafLayout<false>(
197 codec_index, leaf_layout, decoder.getRepresentation())) {
199 decoder.getData(), decoder.getDataSize(), leaf_layout);
216 template <
typename CodecType,
218 bool is_supported_leaf_type = detail::SupportedLeafValueTypeExplicit<ValueType>::value>
240 template <
typename CodecType,
typename ValueType>
252 if (LeafCodecIndex::convertToLeafLayout<false>(
253 codec_index, leaf_layout, codec.getRepresentation())) {
255 codec.getData(), codec.getDataSize(), leaf_layout, value);
Container type, able to store any primitive data type (and arrays thereof)
Fast Access Index Type for the coders.
typename underlying_type_or_type< T, is_enum >::type underlying_type_or_type_t
Retrieves the underlying type if T is an enum, otherwise the type itself.
The leaf value access decoding and encoding is a header only optimization for leaf values of standard...
definition of the ddl namespace
small leaf layout information to access codec data very fast.
static ValueType getValue(const void *data, const size_t data_size, const LeafLayout &leaf_layout)
Returns the current value of the given element as a ValueType if supported.
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.
static void getValue(const DecoderType &decoder, const CodecIndex &codec_index, std::string &value)
Returns the current value of the given element as a std::string.
Value getter to retrieve the current value of the given element as a ValueType if supported.
static void getValue(const DecoderType &decoder, const CodecIndex &codec_index, ValueType &value)
Returns the current value of the given element as a ValueType if supported.
static ValueType getValue(const DecoderType &decoder, const CodecIndex &codec_index)
Returns the current value of the given element as a ValueType if supported.
Value getter to retrieve the current value of the given element as a ValueType if supported.
static ValueType getValue(const DecoderType &decoder, const CodecIndex &codec_index)
Returns the current value of the given element as a ValueType if supported.
static void setValue(CodecType &codec, const CodecIndex &codec_index, const std::string &value)
Sets the value of the given element from std::string.
Value setter to set the current value of the given element from a type ValueType if supported.
static void setValue(CodecType &codec, const CodecIndex &codec_index, const ValueType &value)
Sets the current value if the given element as a ValueType if supported.
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.
Value setter to set the value of the given element as a ValueType if supported.
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.
Common include for component a_util::result.