MySQL 9.1.0
Source Code Documentation
|
Represents Transaction Source Identifier which is composed of source UUID and transaction tag. More...
#include <tsid.h>
Classes | |
struct | Hash |
Structure to compute hash function of a given Tag object. More... | |
Public Member Functions | |
Tsid (const Uuid &uuid, const Tag &tag) | |
Constructs TSID from a given uuid and a tag. More... | |
Tsid (const Uuid &uuid) | |
Constructs TSID from a given uuid, tag is empty. More... | |
Tsid (const Tsid_plain &arg) | |
Construct from Tsid_plain object. More... | |
Tsid ()=default | |
Constructs empty TSID. More... | |
Tsid (Tsid const &)=default | |
Tsid (Tsid &&)=default | |
Tsid & | operator= (Tsid const &)=default |
Tsid & | operator= (Tsid &&)=default |
std::string | to_string () const |
Returns textual representation of Transaction Source Identifier. More... | |
std::size_t | to_string (char *out) const |
Obtains textual representation of TSID and writes it to out. More... | |
std::size_t | to_string (char *out, const char *tag_sid_separator) const |
Obtains textual representation of TSID and writes it to out. More... | |
std::size_t | from_cstring (const char *text) |
Fills Tsid with data from text. More... | |
bool | operator== (const Tsid &other) const |
Operator ==. More... | |
bool | operator!= (const Tsid &other) const |
Operator !=. More... | |
bool | operator< (const Tsid &other) const |
Operator <. More... | |
const Tag & | get_tag () const |
Tag accessor. More... | |
Tag & | get_tag_ref () |
Tag accessor, non const (serialization) More... | |
void | set_tag (const Tag &tag) |
Sets internal tag to a given tag object. More... | |
const Uuid & | get_uuid () const |
UUID accessor. More... | |
Uuid & | get_uuid () |
Non const getter is needed in some functions (copy data) More... | |
bool | is_tagged () const |
Checks whether this TSID contains tag. More... | |
void | clear () |
Clears data - uuid and tag. More... | |
std::size_t | encode_tsid (unsigned char *buf, const Gtid_format >id_format) const |
stores TSID in buffer More... | |
std::size_t | decode_tsid (const unsigned char *stream, std::size_t stream_len, const Gtid_format >id_format) |
reads TSID from the buffer More... | |
Static Public Member Functions | |
static constexpr std::size_t | get_max_encoded_length () |
Obtains maximum length of encoded TSID (compile time) More... | |
Static Public Attributes | |
static constexpr auto | tsid_separator = ":" |
Default TSID separator. More... | |
Private Attributes | |
Uuid | m_uuid = {0} |
GTID UUID. More... | |
Tag | m_tag |
GTID Tag. More... | |
Friends | |
struct | Hash |
Represents Transaction Source Identifier which is composed of source UUID and transaction tag.
Transaction tag may be empty.
Constructs TSID from a given uuid and a tag.
[in] | uuid | UUID component |
[in] | tag | Tag component |
mysql::gtid::Tsid::Tsid | ( | const Uuid & | uuid | ) |
Constructs TSID from a given uuid, tag is empty.
[in] | uuid | UUID component |
|
explicit |
Construct from Tsid_plain object.
arg | Source to copy from |
|
default |
Constructs empty TSID.
|
default |
|
default |
void mysql::gtid::Tsid::clear | ( | ) |
Clears data - uuid and tag.
std::size_t mysql::gtid::Tsid::decode_tsid | ( | const unsigned char * | stream, |
std::size_t | stream_len, | ||
const Gtid_format & | gtid_format | ||
) |
reads TSID from the buffer
stream | Stream to read tsid from |
stream_len | Length of the stream |
gtid_format | Gtid format expected in the stream |
std::size_t mysql::gtid::Tsid::encode_tsid | ( | unsigned char * | buf, |
const Gtid_format & | gtid_format | ||
) | const |
stores TSID in buffer
buf | Buffer to store bytes |
gtid_format | Format of encoded GTID. If tag is not defined for this GTID and tagged format is used, 0 will be encoded as length of the string. In case "untagged" format is requested, function won't encode additional tag information for untagged GTIDs. When using untagged, tag is required to be empty. |
std::size_t mysql::gtid::Tsid::from_cstring | ( | const char * | text | ) |
Fills Tsid with data from text.
[in] | text | Encoded TSID representation terminated with null sign, GTID separator or UUID set separator if part of the GTID set encoding |
|
inlinestaticconstexpr |
Obtains maximum length of encoded TSID (compile time)
|
inline |
Tag accessor.
|
inline |
Tag accessor, non const (serialization)
|
inline |
Non const getter is needed in some functions (copy data)
|
inline |
UUID accessor.
|
inline |
Checks whether this TSID contains tag.
true | This TSID contains tag |
false | This TSID contains empty tag |
bool mysql::gtid::Tsid::operator!= | ( | const Tsid & | other | ) | const |
Operator !=.
other | pattern to compare against |
bool mysql::gtid::Tsid::operator< | ( | const Tsid & | other | ) | const |
Operator <.
Compares uuid first. If uuids are equal, compares tags
other | pattern to compare against |
bool mysql::gtid::Tsid::operator== | ( | const Tsid & | other | ) | const |
Operator ==.
other | pattern to compare against |
|
inline |
Sets internal tag to a given tag object.
tag | Source to copy from |
string mysql::gtid::Tsid::to_string | ( | ) | const |
Returns textual representation of Transaction Source Identifier.
std::size_t mysql::gtid::Tsid::to_string | ( | char * | out | ) | const |
Obtains textual representation of TSID and writes it to out.
[out] | out | Output string |
std::size_t mysql::gtid::Tsid::to_string | ( | char * | out, |
const char * | tag_sid_separator | ||
) | const |
Obtains textual representation of TSID and writes it to out.
version with a custom tag-sid separator
[out] | out | Output string |
[in] | tag_sid_separator | Tag-sid separator |
|
friend |
|
private |
GTID Tag.
|
private |
GTID UUID.
|
staticconstexpr |
Default TSID separator.