24#ifndef MYSQL_GTIDS_TSID_H
25#define MYSQL_GTIDS_TSID_H
50concept Is_tsid = std::derived_from<Test, detail::Tsid_base>;
54template <
class Self_tp, Is_tag Tag_tp>
75 [[nodiscard]]
const auto &
tag()
const {
return m_tag; }
80 return tag().assign(other.tag());
96 template <
class... Args_t>
98 explicit Tsid(Args_t &&...args) :
Base_t(
std::forward<Args_t>(args)...) {}
107 template <
class... Args_t>
110 :
Base_t(
std::forward<Args_t>(args)...) {}
114 return tsid1.uuid() == tsid2.uuid() && tsid1.tag() == tsid2.tag();
118 return !(tsid1 == tsid2);
122 auto uuid_cmp = tsid1.uuid() <=> tsid2.uuid();
123 if (uuid_cmp != 0)
return uuid_cmp;
124 return tsid1.tag() <=> tsid2.tag();
145template <mysql::gt
ids::Is_ts
id Ts
id_t>
148 return std::hash(tsid.uuid()) ^ std::hash(tsid.tag());
Tsid_trivial(Args_t &&...args)
Definition: tsid.h:109
Tsid(Args_t &&...args)
Definition: tsid.h:98
Top of the hierarchy.
Definition: tsid.h:46
Common interface, parameterized by tag type.
Definition: tsid.h:55
mysql::uuids::Uuid & uuid()
Definition: tsid.h:73
Tsid_interface(const mysql::uuids::Uuid &uuid)
Definition: tsid.h:65
const auto & tag() const
Definition: tsid.h:75
mysql::uuids::Uuid m_uuid
Definition: tsid.h:84
auto & tag()
Definition: tsid.h:76
const mysql::uuids::Uuid & uuid() const
Definition: tsid.h:72
Tag_tp Tag_t
Definition: tsid.h:57
Tag_t m_tag
Definition: tsid.h:85
Tsid_interface(const mysql::uuids::Uuid &uuid, const Is_tag auto &tag)
Definition: tsid.h:62
auto assign(const Is_tsid auto &other)
Definition: tsid.h:78
Tsid_interface(const Is_tsid auto &other)
Definition: tsid.h:68
Holds data for a UUID.
Definition: uuid.h:49
void assign(const Uuid &other)
Copy other to this.
Definition: uuid.h:68
True if Test is one of the tag classes.
Definition: tag.h:192
Definition: fts0fts.cc:236
auto operator<=>(const Is_gtid auto >id1, const Is_gtid auto >id2)
Definition: gtid.h:332
bool operator!=(const Is_gtid auto >id1, const Is_gtid auto >id2)
Definition: gtid.h:328
bool operator==(const Is_gtid auto >id1, const Is_gtid auto >id2)
Definition: gtid.h:323
Define std::hash<Gtid>.
Definition: gtid.h:355
std::size_t operator()(const Tsid_t &tsid) const
Definition: tsid.h:147