MySQL 8.0.40
Source Code Documentation
binary_log::gtids::Gtid Class Reference

Represents a MySQL Global Transaction Identifier. More...

#include <gtid.h>

Public Member Functions

 Gtid (const Uuid &uuid, gno_t gno)
 Construct a new Gtid object. More...
 
virtual ~Gtid ()
 Destroy the Gtid object. More...
 
virtual gno_t get_gno () const
 Get the sequence number of this transaction identifier. More...
 
virtual const Uuidget_uuid () const
 Get the uuid of this transaction identifier. More...
 
virtual std::string to_string () const
 Gets a human readable representation of this transaction identifier. More...
 
virtual bool operator== (const Gtid &other) const
 Compares two identifiers and returns whether they match or not. More...
 
virtual bool operator!= (const Gtid &other) const
 Compares two identifiers and returns whether they are different. More...
 
virtual Gtidoperator= (const Gtid &other)
 Copy assignment. More...
 
 Gtid (const Gtid &other)
 Construct a new Gtid object from another one, by deep copying its contents. More...
 

Static Public Attributes

static const std::string SEPARATOR_UUID_SEQNO {":"}
 In 'UUID:SEQNO', this is the ':'. More...
 

Protected Attributes

Uuid m_uuid
 
gno_t m_gno {0}
 

Detailed Description

Represents a MySQL Global Transaction Identifier.

This class abstracts the representation of a Global Transaction Identifier.

It contains two fields, a UUID and a sequence number.

Constructor & Destructor Documentation

◆ Gtid() [1/2]

Gtid::Gtid ( const Uuid uuid,
gno_t  gno 
)

Construct a new Gtid object.

Parameters
uuidthe uuid part of the transaction identifier.
gnoThe gno part of the transaction identfier.

◆ ~Gtid()

Gtid::~Gtid ( )
virtualdefault

Destroy the Gtid object.

◆ Gtid() [2/2]

Gtid::Gtid ( const Gtid other)

Construct a new Gtid object from another one, by deep copying its contents.

Parameters
otherthe other gtid to construct this gtid from.

Member Function Documentation

◆ get_gno()

gno_t Gtid::get_gno ( ) const
virtual

Get the sequence number of this transaction identifier.

Returns
The sequence number part of this transaction identifier.

◆ get_uuid()

const Uuid & Gtid::get_uuid ( ) const
virtual

Get the uuid of this transaction identifier.

Returns
The uuid part of this transaction identifier.

◆ operator!=()

bool Gtid::operator!= ( const Gtid other) const
virtual

Compares two identifiers and returns whether they are different.

Parameters
otherThe other transaction identifier to compare to this one.
Returns
true if the identifiers are different.
false otherwise.

◆ operator=()

Gtid & Gtid::operator= ( const Gtid other)
virtual

Copy assignment.

Note that this operator will do a deep copy of the other identifier.

Parameters
otherCopies the uuid and gno of the other identifier.
Returns
a copy of the other identifier.

◆ operator==()

bool Gtid::operator== ( const Gtid other) const
virtual

Compares two identifiers and returns whether they match or not.

Parameters
otherThe other transaction identifier to compare to this one.
Returns
true if the identifiers are equal.
false otherwise.

◆ to_string()

std::string Gtid::to_string ( ) const
virtual

Gets a human readable representation of this transaction identifier.

Returns
A human readable representation of this transaction identifier.

Member Data Documentation

◆ m_gno

gno_t binary_log::gtids::Gtid::m_gno {0}
protected

◆ m_uuid

Uuid binary_log::gtids::Gtid::m_uuid
protected

◆ SEPARATOR_UUID_SEQNO

const std::string binary_log::gtids::Gtid::SEPARATOR_UUID_SEQNO {":"}
inlinestatic

In 'UUID:SEQNO', this is the ':'.


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