3 #include <zk/config.hpp>
27 template <
typename TReal,
typename TId>
60 return *
static_cast<TReal*
>(
this);
77 return *
static_cast<TReal*
>(
this);
89 template <
typename TReal,
typename TId>
90 constexpr
bool operator==(
const strong_id<TReal, TId>& a,
const strong_id<TReal, TId>& b)
92 return a.value == b.value;
95 template <
typename TReal,
typename TId>
96 constexpr
bool operator!=(
const strong_id<TReal, TId>& a,
const strong_id<TReal, TId>& b)
98 return a.value != b.value;
101 template <
typename TReal,
typename TId>
102 constexpr
bool operator<(const strong_id<TReal, TId>& a,
const strong_id<TReal, TId>& b)
104 return a.value < b.value;
107 template <
typename TReal,
typename TId>
108 constexpr
bool operator<=(const strong_id<TReal, TId>& a,
const strong_id<TReal, TId>& b)
110 return a.value <= b.value;
113 template <
typename TReal,
typename TId>
114 constexpr
bool operator>(
const strong_id<TReal, TId>& a,
const strong_id<TReal, TId>& b)
116 return a.value > b.value;
119 template <
typename TReal,
typename TId>
120 constexpr
bool operator>=(
const strong_id<TReal, TId>& a,
const strong_id<TReal, TId>& b)
122 return a.value >= b.value;
126 template <
typename TReal,
typename TId>
129 return std::hash<TId>()(x.
value);
139 template <
typename TReal>
145 static constexpr TReal
invalid() {
return TReal(-42); };
150 static constexpr TReal
any() {
return TReal(-1); };
164 std::ostream& operator<<(std::ostream&,
const version&);
166 std::string to_string(
const version&);
177 std::ostream& operator<<(std::ostream&,
const acl_version&);
190 std::ostream& operator<<(std::ostream&,
const child_version&);
200 public strong_id<transaction_id, std::size_t>
223 using time_point = std::chrono::system_clock::time_point;
277 std::ostream& operator<<(std::ostream&,
const stat&);
279 std::string to_string(
const stat&);
304 return create_mode(static_cast<unsigned int>(a) | static_cast<unsigned int>(b));
310 return create_mode(static_cast<unsigned int>(a) & static_cast<unsigned int>(b));
317 return create_mode(~static_cast<unsigned int>(a) & 0b0111);
323 return (
self & flags) == flags;
326 std::ostream& operator<<(std::ostream&,
const create_mode&);
346 std::ostream& operator<<(std::ostream&,
const event_type&);
403 std::ostream& operator<<(std::ostream&,
const state&);
419 using result_type = std::size_t;
431 using result_type = std::size_t;
443 using result_type = std::size_t;
452 struct hash<zk::transaction_id>
455 using result_type = std::size_t;
time_point modified_time
Last time the entry was last modified. Like create_time, this is not a reliable source.
constexpr create_mode operator&(create_mode a, create_mode b)
Set intersection operation of create_mode.
transaction_id child_modified_transaction
The transaction ID that last modified the children of the entry.
std::size_t children_count
The number of children this entry has.
This value is issued as part of an event when the state changes.
The client is connected to a read-only server, that is the server which is not currently connected to...
Issued when an entry at a given path is erased.
Base type for creating strong ID types.
constexpr bool is_set(create_mode self, create_mode flags)
Check that self has flags set.
transaction_id modified_transaction
The last transaction that modified the entry.
state
Enumeration of states the client may be at when a watch triggers.
The client is connecting.
zk::version data_version
The number of changes to the data of the entry.
std::uint64_t ephemeral_owner
The session ID of the owner of this entry, if it is an ephemeral entry.
strong_id() noexcept=default
Default construct the ID.
The connection is closed.
Represents a version of the ACL of an entry.
Base error type for all errors raised by this library.
constexpr create_mode operator~(create_mode a)
Set inverse operation of create_mode.
create_mode
When used in client::set, this value determines how the entry is created on the server.
std::size_t data_size
The size of the data field of the entry.
Standard behavior of an entry – the opposite of doing any of the options.
Statistics about a ZooKeeper entry, similar to the UNIX stat structure.
std::size_t hash(const strong_id< TReal, TId > &x)
Compute the std::hash of the given x.
constexpr create_mode operator|(create_mode a, create_mode b)
Set union operation of create_mode.
The server rejected the connection due to invalid authentication information.
bool is_ephemeral() const
Is the entry an ephemeral entry?
std::int32_t value_type
The representation type of this ID.
The client is in the connected state – it is connected to a server in the ensemble (one of the serve...
The entry will be deleted when the client session expires.
Issued when an entry for a given path is created.
Issued when the data of a watched entry is altered.
The serving cluster has expired this session.
time_point create_time
Time the entry was created.
Watch has been forcefully removed.
event_type
Enumeration of types of events that may occur.
The name of the entry will be appended with a monotonically increasing number.
transaction_id create_transaction
The transaction ID that created the entry.
Represents a version of the children of an entry.
static constexpr TReal any()
When specified in an operation, this version specifier will always pass.
Represents a version of the data.
value_type value
Underlying value of this ID.
Base type for version types.
static constexpr TReal invalid()
An invalid version specifier.
Represents the ZooKeeper transaction ID in which an event happened to an entry.
zk::child_version child_version
The number of changes to the children of the entry.
Container entries are special purpose entries useful for recipes such as leader, lock, etc.
Issued when the children of a watched entry are created or deleted.
zk::acl_version acl_version
The number of changes to the ACL of the entry.