24#ifndef MYSQL_GTID_TAG_H
25#define MYSQL_GTID_TAG_H
64 Tag(
const std::string &text);
81 [[nodiscard]] std::size_t
from_string(
const std::string &text);
89 [[nodiscard]] std::size_t
from_cstring(
const char *text);
160 [[nodiscard]] std::size_t
decode_tag(
const unsigned char *
buf,
195 void replace(
const char *text, std::size_t len);
Representation of the GTID tag.
Definition: tag.h:49
bool operator!=(const Tag &other) const
Operator !=.
Definition: tag.cpp:143
const Tag_data & get_data() const
Internal data accessor.
Definition: tag.h:173
static bool is_character_valid(const char &character, std::size_t pos)
Checks whether current character is a valid Tag character.
Definition: tag.cpp:113
std::size_t encode_tag(unsigned char *buf, const Gtid_format >id_format) const
stores Tag in buffer
Definition: tag.cpp:66
bool is_defined() const
Indicates whether transaction tag is defined (is not empty)
Definition: tag.h:97
bool is_empty() const
Indicates whether transaction tag is empty.
Definition: tag.h:93
bool operator<(const Tag &other) const
Compares this tag with other, <.
Definition: tag.h:112
std::size_t get_encoded_length(const Gtid_format >id_format) const
returns length of encoded tag, based on defined format
Definition: tag.cpp:93
Tag_data m_data
internal tag representation
Definition: tag.h:197
static constexpr std::size_t get_max_encoded_length()
Obtains maximum length of encoded tag (compile time)
Definition: tag.h:145
void replace(const char *text, std::size_t len)
Replaces internal tag data with a given text, includes text normalization.
Definition: tag.cpp:45
bool operator==(const Tag &other) const
Operator ==.
Definition: tag.cpp:141
Tag_data & get_data()
Internal data accessor, non const (serialization)
Definition: tag.h:177
std::size_t from_string(const std::string &text)
Creates Tag object from a given text.
Definition: tag.cpp:109
std::string Tag_data
Definition: tag.h:51
Tag()=default
Constructs an empty, valid tag.
static bool is_valid_end_char(const char &character)
Checks whether current character is a valid ending of a Tag string.
Definition: tag.cpp:104
std::size_t get_length() const
returns length of tag
Definition: tag.cpp:102
std::size_t from_cstring(const char *text)
Creates Tag object from a given text.
Definition: tag.cpp:118
std::string to_string() const
Obtains textual representation of internal tag.
Definition: tag.cpp:55
std::size_t decode_tag(const unsigned char *buf, std::size_t buf_len, const Gtid_format >id_format)
Reads Tag data from the buffer.
Definition: tag.cpp:76
Definition: buf0block_hint.cc:30
Gtid_format
Gtid binary format indicator.
Definition: gtid_format.h:38
constexpr std::size_t tag_max_length
Maximal number of characters in a tag.
Definition: gtid_constants.h:44
Structure to compute hash function of a given Tag object.
Definition: tag.h:165
size_t operator()(const Tag &arg) const
Computes hash of a given Tag object.
Definition: tag.cpp:152
Tag representation so that:
Definition: tag_plain.h:47