![]() |
MySQL 9.2.0
Source Code Documentation
|
Interface for serializable data structures. More...
#include <serializable.h>
Public Member Functions | |
template<class Serializable_functor_type , class Field_functor_type > | |
void | do_for_each_field (Serializable_functor_type &&func_s, Field_functor_type &&func_f) |
calls functor for each field More... | |
template<class Serializable_functor_type , class Field_functor_type > | |
void | do_for_each_field (Serializable_functor_type &&func_s, Field_functor_type &&func_f) const |
calls functor for each field, const version More... | |
template<typename Serializer_type > | |
std::size_t | get_size_internal () const |
Returns serializable object fields size, internal function (without serializable metadata size) More... | |
bool | is_any_field_provided () const |
Performs iteration over all of the serializable fields and checks whether any of the fields in this serializable is provided. More... | |
void | set_unknown_field_policy (const Unknown_field_policy &policy) |
Sets unknown field policy for this object. More... | |
bool | is_ignorable () const |
Static Public Member Functions | |
static constexpr Field_id_type | get_last_field_id () |
This function calculates last field id of this type. More... | |
template<typename Serializer_type > | |
static constexpr std::size_t | get_max_size_internal () |
Returns serializable object fields maximum size, internal function (without serializable metadata size) More... | |
Protected Types | |
using | Tag = Serializable_tag |
Protected Member Functions | |
template<class Serializable_functor_type , class Field_functor_type , class Tuple_type , std::size_t... Is> | |
void | do_for_each_field (Serializable_functor_type &&func_s, Field_functor_type &&func_f, Tuple_type &&tuple, std::index_sequence< Is... >) |
do_for_each_field helper More... | |
template<class Serializable_functor_type , class Field_functor_type , class Field_type > | |
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 More... | |
template<class Serializable_functor_type , class Field_functor_type , class Field_type > | |
void | do_for_one_field (Serializable_functor_type &&func_s, Field_functor_type &&func_f, Field_type &field, std::size_t field_id, Serializable_tag) |
do_for_each_field helper More... | |
template<class Serializable_functor_type , class Field_functor_type , class Field_type > | |
void | do_for_one_field (Serializable_functor_type &&, Field_functor_type &&func_f, Field_type &field, std::size_t field_id, Field_definition_tag) |
do_for_each_field helper More... | |
template<class Serializable_functor_type , class Field_functor_type , class Tuple_type , std::size_t... Is> | |
void | do_for_each_field (Serializable_functor_type &&func_s, Field_functor_type &&func_f, Tuple_type &&tuple, std::index_sequence< Is... >) const |
do_for_each_field (const) helper More... | |
template<class Serializable_functor_type , class Field_functor_type , class Field_type > | |
void | do_for_one_field (Serializable_functor_type &&func_s, Field_functor_type &&func_f, const Field_type &field, std::size_t field_id) const |
do_for_each_field (const) helper More... | |
template<class Serializable_functor_type , class Field_functor_type , class Field_type > | |
void | do_for_one_field (Serializable_functor_type &&func_s, Field_functor_type &&func_f, const Field_type &field, std::size_t field_id, Serializable_tag) const |
do_for_each_field (const) helper More... | |
template<class Serializable_functor_type , class Field_functor_type , class Field_type > | |
void | do_for_one_field (Serializable_functor_type &&, Field_functor_type &&func_f, const Field_type &field, std::size_t field_id, Field_definition_tag) const |
do_for_each_field (const) helper More... | |
Serializable ()=default | |
Serializable (const Serializable &)=default | |
Serializable (Serializable &&)=default | |
Serializable & | operator= (const Serializable &)=default |
Serializable & | operator= (Serializable &&)=default |
virtual | ~Serializable ()=default |
Creation of Serializable objects is prohibited. More... | |
Private Attributes | |
Unknown_field_policy | m_unknown_field_policy = Unknown_field_policy::ignore |
Unknown field policy for this serializable object. More... | |
Friends | |
template<class Serializer_derived_type , class Archive_type > | |
class | Serializer |
template<class Derived_serializable_type_current > | |
class | Serializable |
Interface for serializable data structures.
Classes that implement serializable interface may be serialized automatically by the serializer
Please have a look at examples enclosed in unittest The base class provides:
|
protected |
|
protecteddefault |
|
protecteddefault |
|
protecteddefault |
|
protectedvirtualdefault |
Creation of Serializable objects is prohibited.
void mysql::serialization::Serializable< Derived_serializable_type >::do_for_each_field | ( | Serializable_functor_type && | func_s, |
Field_functor_type && | func_f | ||
) |
calls functor for each field
Serializable_functor_type | Type of functor to be applied on the serializable |
Field_functor_type | Type of functor to be applied on the field |
func_s | Functor to be called for each serializable field |
func_f | Functor to be called for each non-serializable field |
void mysql::serialization::Serializable< Derived_serializable_type >::do_for_each_field | ( | Serializable_functor_type && | func_s, |
Field_functor_type && | func_f | ||
) | const |
calls functor for each field, const version
Serializable_functor_type | Type of functor to be applied on the serializable |
Field_functor_type | Type of functor to be applied on the field |
func_s | Functor to be called for each serializable field |
func_f | Functor to be called for each non-serializable field |
|
protected |
do_for_each_field helper
|
protected |
do_for_each_field (const) helper
|
protected |
do_for_each_field (const) helper
|
protected |
do_for_each_field helper
|
protected |
do_for_each_field (const) helper
|
protected |
do_for_each_field (const) helper
|
protected |
do_for_each_field helper
|
protected |
do_for_each_field helper
|
inlinestaticconstexpr |
This function calculates last field id of this type.
|
inlinestaticconstexpr |
Returns serializable object fields maximum size, internal function (without serializable metadata size)
Serializer_type | Type of serializer used to format fields object will have this maximum size |
std::size_t mysql::serialization::Serializable< Derived_serializable_type >::get_size_internal |
Returns serializable object fields size, internal function (without serializable metadata size)
Serializer_type | Type of serializer used to format fields overhead added by serializer, including overhead of nested types |
bool mysql::serialization::Serializable< Derived_serializable_type >::is_any_field_provided |
Performs iteration over all of the serializable fields and checks whether any of the fields in this serializable is provided.
|
inline |
|
protecteddefault |
|
protecteddefault |
|
inline |
Sets unknown field policy for this object.
policy | Chosen policy, determines what decoder should do in case it encounters this object in the stream but this object definition is unknown to the decoder |
|
friend |
|
friend |
|
private |
Unknown field policy for this serializable object.