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 \
30template <
typename ValueType>
32 :
public std::is_convertible<a_util::variant::Variant,
33 a_util::underlying_type_or_type_t<ValueType>> {
36template <
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 \
56template <
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
>(
84template <
typename DecoderType>
93 static void getValue(
const DecoderType& decoder,
97 value = decoder.getElementStringValue(codec_index);
108template <
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(
134template <
typename CodecType>
145 codec.setElementStringValue(codec_index, value);
157template <
typename DecoderType,
159 bool is_supported_leaf_type = detail::SupportedLeafValueTypeExplicit<ValueType>::value>
184template <
typename DecoderType,
typename ValueType>
197 codec_index, leaf_layout, decoder.getRepresentation())) {
199 decoder.getData(), decoder.getDataSize(), leaf_layout);
216template <
typename CodecType,
218 bool is_supported_leaf_type = detail::SupportedLeafValueTypeExplicit<ValueType>::value>
240template <
typename CodecType,
typename ValueType>
253 codec_index, leaf_layout,
codec.getRepresentation())) {
255 codec.getData(),
codec.getDataSize(), leaf_layout, value);
Definition codec_index.h:276
static bool convertToLeafLayout(const CodecIndex &codec_index, LeafLayout &leaf_layout, ddl::DataRepresentation rep)
Retrieves a valid, small, 8-bytes LeafLayout from a CodecIndex.
Definition leaf_value_access.h:83
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.
Definition type_traits.h:89
Namespace for the new faster CodecFactory/Decoder/Codec implementation.
Definition codec.h:22
definition of the ddl namespace
Definition codec.h:21
small leaf layout information to access codec data very fast.
Definition leaf_layout.h:76
static ValueType getValue(const void *data, const size_t data_size, const LeafLayout &leaf_layout)
Definition leaf_value_access.h:789
static void setValue(void *data, const size_t data_size, const LeafLayout &leaf_layout, const ValueType &value)
Definition leaf_value_access.h:820
static ValueType getValue(const DecoderType &decoder, const CodecIndex &codec_index)
Definition value_access.h:193
Definition value_access.h:160
static ValueType getValue(const DecoderType &decoder, const CodecIndex &codec_index)
Definition value_access.h:168
static void getValue(const DecoderType &decoder, const CodecIndex &codec_index, std::string &value)
Definition value_access.h:93
Definition value_access.h:57
static void getValue(const DecoderType &decoder, const CodecIndex &codec_index, ValueType &value)
Definition value_access.h:65
static void setValue(CodecType &codec, const CodecIndex &codec_index, const ValueType &value)
Definition value_access.h:249
Definition value_access.h:219
static void setValue(CodecType &codec, const CodecIndex &codec_index, const ValueType &value)
Definition value_access.h:227
static void setValue(CodecType &codec, const CodecIndex &codec_index, const std::string &value)
Definition value_access.h:143
Definition value_access.h:109
static void setValue(CodecType &codec, const CodecIndex &codec_index, const ValueType &value)
Definition value_access.h:117
Definition value_access.h:33
Definition value_access.h:39