![]() |
MySQL 8.0.43
Source Code Documentation
|
This is a POD. More...
#include <uuid.h>
Public Member Functions | |
| void | clear () |
| Set to all zeros. More... | |
| void | copy_from (const unsigned char *data) |
| Copies the given 16-byte data to this UUID. More... | |
| void | copy_from (const Uuid &data) |
| Copies the given UUID object to this UUID. More... | |
| void | copy_to (unsigned char *data) const |
| Copies the given UUID object to this UUID. More... | |
| bool | equals (const Uuid &other) const |
| Returns true if this UUID is equal the given UUID. More... | |
| int | parse (const char *string, size_t len) |
| Stores the UUID represented by a string of the form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX or XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX or {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} in this object. More... | |
| size_t | to_string (char *buf) const |
| Generates a 36+1 character long representation of this UUID object in the given string buffer. More... | |
| std::string | to_string () const |
| void | print () const |
Static Public Member Functions | |
| static bool | is_valid (const char *string, size_t len) |
| Returns true if parse() would succeed, but doesn't store the result. More... | |
| static int | parse (const char *in_string, size_t len, const unsigned char *out_binary_string) |
| Parses the UUID passed as argument in in_string and functions and writes the binary representation in out_binary_string. More... | |
| static bool | read_section (int section_len, const char **section_str, const unsigned char **out_binary_str) |
| Helper method used to validate and parse one section of a uuid. More... | |
| static size_t | to_string (const unsigned char *bytes_arg, char *buf) |
| Convert the given binary buffer to a UUID. More... | |
Public Attributes | |
| unsigned char | bytes [BYTE_LENGTH] |
| The data for this Uuid. More... | |
Static Public Attributes | |
| static const size_t | BYTE_LENGTH = 16 |
| The number of bytes in the data of a Uuid. More... | |
| static const size_t | TEXT_LENGTH = 36 |
| The number of bytes in the textual representation of a Uuid. More... | |
| static const size_t | BIT_LENGTH = 128 |
| The number of bits in the data of a Uuid. More... | |
| static const int | NUMBER_OF_SECTIONS = 5 |
| static const int | bytes_per_section [NUMBER_OF_SECTIONS] = {4, 2, 2, 2, 6} |
| static const int | hex_to_byte [256] |
This is a POD.
It has to be a POD because it is a member of Sid_map::Node which is stored in HASH in mysql-server code. The structure contains the following components.
| Name | Format | Description |
|---|---|---|
| byte | unsigned char array | This stores the Uuid of the server on which transaction is originated |
|
inline |
Set to all zeros.
|
inline |
Copies the given 16-byte data to this UUID.
|
inline |
Copies the given UUID object to this UUID.
|
inline |
Copies the given UUID object to this UUID.
|
inline |
Returns true if this UUID is equal the given UUID.
|
static |
Returns true if parse() would succeed, but doesn't store the result.
| string | String that needs to be checked. |
| len | Length of that string. |
| true | valid string. |
| false | invalid string. |
|
static |
Parses the UUID passed as argument in in_string and functions and writes the binary representation in out_binary_string.
Depends on UUID's read_section method and the constants for text length.
| [in] | in_string | String to be parsed. |
| [in] | len | Length of that string. |
| [out] | out_binary_string | String where the binary UUID will be stored |
| 0 | success. |
| >0 | failure. |
| int binary_log::Uuid::parse | ( | const char * | string, |
| size_t | len | ||
| ) |
Stores the UUID represented by a string of the form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX or XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX or {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} in this object.
| string | String to be parsed and stored. |
| len | Length of that string. |
| 0 | success. |
| >0 | failure. |
|
inline |
|
static |
Helper method used to validate and parse one section of a uuid.
If the last parameter, out_binary_str, is NULL then the function will just validate the section.
| [in] | section_len | Length of the section to be parsed. |
| [in,out] | section_str | Pointer to a string containing the section. It will be updated during the execution as the string is parsed. |
| [out] | out_binary_str | String where the section will be stored in binary format. If null, the function will just validate the input string. |
| false | success. |
| true | failure. |
|
inline |
| size_t binary_log::Uuid::to_string | ( | char * | buf | ) | const |
Generates a 36+1 character long representation of this UUID object in the given string buffer.
| 36 | - the length of the resulting string. |
|
static |
Convert the given binary buffer to a UUID.
|
static |
The number of bits in the data of a Uuid.
|
static |
The number of bytes in the data of a Uuid.
| unsigned char binary_log::Uuid::bytes[BYTE_LENGTH] |
The data for this Uuid.
|
static |
|
static |
|
static |
|
static |
The number of bytes in the textual representation of a Uuid.