MySQL 9.6.0
Source Code Documentation
mysql::uuids::Uuid Class Reference

Holds data for a UUID. More...

#include <uuid.h>

Inheritance diagram for mysql::uuids::Uuid:
[legend]

Public Member Functions

constexpr std::size_t size () const
 Return the size. More...
 
char * data ()
 Return the data buffer as char *. More...
 
const char * data () const
 Return the data buffer as const char *. More...
 
void assign (const Uuid &other)
 Copy other to this. More...
 
mysql::utils::Return_status assign (const std::string_view &other)
 Copy other, which is represented as binary, to this. More...
 
- Public Member Functions inherited from mysql::ranges::Buffer_interface< Uuid >
 operator bool () const
 Return true if size() != 0. More...
 
bool operator! () const
 Return true if size() == 0. More...
 
bool empty () const
 Return true if size() == 0. More...
 
std::ptrdiff_t ssize () const
 Return the size as std::ptrdiff_t. More...
 
auto * udata ()
 Return the data buffer as unsigned char *. More...
 
auto * udata () const
 Return the data buffer as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * bdata ()
 Return the data buffer as std::byte *. More...
 
auto * bdata () const
 Return the data buffer as const std::byte * or std::byte *, const-ness inherited from Self_t::data() const. More...
 
std::string_view string_view () const
 
auto * begin ()
 Return the begin as char *. More...
 
auto * begin () const
 Return the begin as const char * or char *, const-ness inherited from Self_t::data() const. More...
 
auto * cbegin () const
 Return the begin as const char * or char *, const-ness inherited from Self_t::data() const. More...
 
auto * ubegin ()
 Return the begin as unsigned char *. More...
 
auto * ubegin () const
 Return the begin as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * cubegin () const
 Return the begin as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * bbegin ()
 Return the begin as std::byte *. More...
 
auto * bbegin () const
 Return the begin as const std::byte * or std::byte *, const-ness inherited from Self_t::data() const. More...
 
auto * cbbegin () const
 Return the begin as const std::byte * or std::byte *, const-ness inherited from Self_t::data() const. More...
 
auto * end ()
 Return the end as char *. More...
 
auto * end () const
 Return the end as const char * or char *, const-ness inherited from Self_t::data() const. More...
 
auto * cend () const
 Return the end as const char * or char *, const-ness inherited from Self_t::data() const. More...
 
auto * uend ()
 Return the end as unsigned char *. More...
 
auto * uend () const
 Return the end as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * cuend () const
 Return the end as const unsigned char * or unsigned char *, const-ness inherited from Self_t::data() const. More...
 
auto * bend ()
 Return the end as std::byte *. More...
 
auto * bend () const
 Return the end as const std::byte * or std::byte *, const-ness inherited from Self_t::data() const. More...
 
auto * cbend () const
 Return the end as const std::byte * or or std::byte *, const-ness inherited from Self_t::data() const. More...
 
char & operator[] (std::ptrdiff_t n)
 Return reference the n'th element. More...
 
char operator[] (std::ptrdiff_t n) const
 Return the n'th element, const-ness inherited from Self_t::data() const. More...
 

Static Public Attributes

static constexpr std::size_t byte_size = 16
 The number of bytes in the data of a Uuid. More...
 
static constexpr std::size_t text_size = 36
 
static constexpr std::size_t section_count = 5
 
static constexpr std::array< std::size_t, section_countsection_sizes
 
- Static Public Attributes inherited from mysql::ranges::Buffer_interface< Uuid >
static constexpr auto equality_algorithm
 
static constexpr bool equality_enabled
 
static constexpr bool hash_enabled
 

Private Attributes

std::array< char, byte_sizem_data
 The data for this Uuid. More...
 

Detailed Description

Holds data for a UUID.

This satisfies std::is_trivially_default_constructible, std::is_trivially_copyable, and std::is_standard_layout.

Use mysql::strconv::encode_text / mysql::strconv::decode_text to convert to and from text format.

Member Function Documentation

◆ assign() [1/2]

mysql::utils::Return_status mysql::uuids::Uuid::assign ( const std::string_view &  other)
inline

Copy other, which is represented as binary, to this.

◆ assign() [2/2]

void mysql::uuids::Uuid::assign ( const Uuid other)
inline

Copy other to this.

◆ data() [1/2]

char * mysql::uuids::Uuid::data ( )
inline

Return the data buffer as char *.

◆ data() [2/2]

const char * mysql::uuids::Uuid::data ( ) const
inline

Return the data buffer as const char *.

◆ size()

constexpr std::size_t mysql::uuids::Uuid::size ( ) const
inlineconstexpr

Return the size.

Member Data Documentation

◆ byte_size

constexpr std::size_t mysql::uuids::Uuid::byte_size = 16
staticconstexpr

The number of bytes in the data of a Uuid.

◆ m_data

std::array<char, byte_size> mysql::uuids::Uuid::m_data
private

The data for this Uuid.

◆ section_count

constexpr std::size_t mysql::uuids::Uuid::section_count = 5
staticconstexpr

◆ section_sizes

constexpr std::array<std::size_t, section_count> mysql::uuids::Uuid::section_sizes
staticconstexpr
Initial value:
= {
4, 2, 2, 2, 6}

◆ text_size

constexpr std::size_t mysql::uuids::Uuid::text_size = 36
staticconstexpr

The documentation for this class was generated from the following file: