24#ifndef MYSQL_SERIALIZATION_SERIALIZABLE_H
25#define MYSQL_SERIALIZATION_SERIALIZABLE_H
28#include <unordered_set>
47template <
typename Serializer_type,
typename... Args>
85template <
class Derived_serializable_type>
94 template <
class Serializable_functor_type,
class Field_functor_type>
96 Field_functor_type &&func_f);
104 template <
class Serializable_functor_type,
class Field_functor_type>
106 Field_functor_type &&func_f)
const;
113 using Tuple_type_captured =
114 decltype(std::declval<Derived_serializable_type>().define_fields());
115 return std::tuple_size_v<Tuple_type_captured> - 1;
123 template <
typename Serializer_type>
137 template <
typename Serializer_type>
139 using Tuple_type_captured =
140 decltype(std::declval<Derived_serializable_type>().define_fields());
142 Tuple_type_captured>::get_max_size();
159 template <
class Serializer_derived_type,
class Archive_type>
161 template <
class Derived_serializable_type_current>
165 template <
class Serializable_functor_type,
class Field_functor_type,
166 class Tuple_type, std::size_t... Is>
168 Field_functor_type &&func_f, Tuple_type &&tuple,
169 std::index_sequence<Is...>);
172 template <
class Serializable_functor_type,
class Field_functor_type,
175 Field_functor_type &&func_f,
Field_type &field,
179 template <
class Serializable_functor_type,
class Field_functor_type,
182 Field_functor_type &&func_f,
Field_type &field,
186 template <
class Serializable_functor_type,
class Field_functor_type,
189 Field_functor_type &&func_f,
Field_type &field,
193 template <
class Serializable_functor_type,
class Field_functor_type,
194 class Tuple_type, std::size_t... Is>
196 Field_functor_type &&func_f, Tuple_type &&tuple,
197 std::index_sequence<Is...>)
const;
200 template <
class Serializable_functor_type,
class Field_functor_type,
203 Field_functor_type &&func_f,
const Field_type &field,
207 template <
class Serializable_functor_type,
class Field_functor_type,
210 Field_functor_type &&func_f,
const Field_type &field,
214 template <
class Serializable_functor_type,
class Field_functor_type,
217 Field_functor_type &&func_f,
const Field_type &field,
Interface for serializable data structures.
Definition: serializable.h:86
Unknown_field_policy m_unknown_field_policy
Unknown field policy for this serializable object.
Definition: serializable.h:231
std::size_t get_size_internal() const
Returns serializable object fields size, internal function (without serializable metadata size)
Definition: serializable_impl.hpp:31
static constexpr std::size_t get_max_size_internal()
Returns serializable object fields maximum size, internal function (without serializable metadata siz...
Definition: serializable.h:138
Serializable & operator=(Serializable &&)=default
bool is_ignorable() const
Definition: serializable.h:152
bool is_any_field_provided() const
Performs iteration over all of the serializable fields and checks whether any of the fields in this s...
Definition: serializable_impl.hpp:161
Serializable & operator=(const Serializable &)=default
static constexpr Field_id_type get_last_field_id()
This function calculates last field id of this type.
Definition: serializable.h:112
void set_unknown_field_policy(const Unknown_field_policy &policy)
Sets unknown field policy for this object.
Definition: serializable.h:149
void do_for_one_field(Serializable_functor_type &&func_s, Field_functor_type &&func_f, Field_type &field, std::size_t field_id)
do_for_each_field helper
Definition: serializable_impl.hpp:87
virtual ~Serializable()=default
Creation of Serializable objects is prohibited.
void do_for_each_field(Serializable_functor_type &&func_s, Field_functor_type &&func_f)
calls functor for each field
Definition: serializable_impl.hpp:47
Serializable(const Serializable &)=default
Serializable(Serializable &&)=default
Interface for serializer.
Definition: serializer.h:62
uint64_t Field_id_type
Type for field_id assigned to each field in the.
Definition: serialization_types.h:42
Unknown_field_policy
Represents 'unknown field' policy - decision what needs to be done in case unknown field is encounter...
Definition: unknown_field_policy.h:39
@ ignore
Ignore this field.
static const LEX_CSTRING field_id
Definition: sql_show_processlist.cc:49
Definition: sql_resultset.h:36
Used to distinguish between Serializable and Field_definition types.
Definition: serializable_type_tags.h:43
Definition: serializable.h:48
Used to distinguish between Serializable and Field_definition types.
Definition: serializable_type_tags.h:40