MySQL 8.4.2
Source Code Documentation
|
Field definition provided by classes implementing Serializable interface. More...
#include <field_definition.h>
Public Types | |
using | Tag = Field_definition_tag |
using | Field_type_ref = std::reference_wrapper< Field_type > |
Public Member Functions | |
Field_definition (Field_type &field, Field_encode_predicate encode_predicate, Unknown_field_policy unknown_field_policy, Field_missing_functor field_missing_functor) | |
Constructs field definition object. More... | |
Field_definition (Field_type &field, Unknown_field_policy unknown_field_policy=Unknown_field_policy::ignore) | |
Constructs field definition object. More... | |
Field_definition (Field_type &field, Field_encode_predicate encode_predicate, Unknown_field_policy unknown_field_policy=Unknown_field_policy::ignore) | |
Constructs field definition object. More... | |
Field_definition (Field_type &field, Field_missing_functor field_missing_functor) | |
Constructs field definition object. More... | |
Field_type & | get_ref () |
const Field_type & | get_ref () const |
void | run_field_missing () const |
Runs "field missing functor" in case field is not available in the provided encoded data. More... | |
bool | run_encode_predicate () const |
Runs encode predicate functor. More... | |
bool | is_field_ignorable () const |
Indicates whether this field can be ignored by decoders that do not know this field. More... | |
Protected Attributes | |
Field_type_ref | m_ref |
Field object reference. More... | |
Unknown_field_policy | m_unknown_field_policy = Unknown_field_policy::ignore |
Defines what a decoder should do if the field is present but the decoder is a version that does not know how to interpret the field. More... | |
Field_encode_predicate | m_encode_predicate |
Defines whether field will be encoded. More... | |
Field_missing_functor | m_field_missing_functor |
Function that is called for this field during decoding in case field is missing in the encoded message. More... | |
Field definition provided by classes implementing Serializable interface.
using mysql::serialization::Field_definition< Field_type, defined_field_size >::Field_type_ref = std::reference_wrapper<Field_type> |
using mysql::serialization::Field_definition< Field_type, defined_field_size >::Tag = Field_definition_tag |
|
inline |
Constructs field definition object.
[in] | field | Reference to described field object externally, serializer may ignore this value or use it to hide some fields |
[in] | encode_predicate | Function that is called for optional fields, defines whether field will be encoded |
[in] | unknown_field_policy | What decoder should do in case this field definition is unknown to the decoder (error / ignore) |
[in] | field_missing_functor | Function that is called for this field in case it is not available in encoded data |
|
inline |
Constructs field definition object.
[in] | field | Reference to described field object |
[in] | unknown_field_policy | What decoder should do in case this field definition is unknown to the decoder (error / ignore) |
|
inline |
Constructs field definition object.
[in] | field | Reference to described field object |
[in] | unknown_field_policy | What decoder should do in case this field definition is unknown to the decoder (error / ignore) |
[in] | encode_predicate | Function that is called for optional fields, defines whether field will be encoded |
|
inline |
Constructs field definition object.
[in] | field | Reference to described field object |
[in] | field_missing_functor | Function that is called for this field in case it is not available in encoded data |
|
inline |
|
inline |
|
inline |
Indicates whether this field can be ignored by decoders that do not know this field.
true | Decoders that do not recognize this field may ignore it |
false | Decoders that do not recognize this field should generate an error if they find this field in the packet |
|
inline |
Runs encode predicate functor.
true | Encode field |
false | Do not encode field |
|
inline |
Runs "field missing functor" in case field is not available in the provided encoded data.
|
protected |
Defines whether field will be encoded.
|
protected |
Function that is called for this field during decoding in case field is missing in the encoded message.
|
protected |
Field object reference.
|
protected |
Defines what a decoder should do if the field is present but the decoder is a version that does not know how to interpret the field.
Typically the encoder writes this information to the packet as a directive that instructs old decoders or third-party decoders how to handle the field, if the message definition that they are aware of does not include the field.