3 #include <zk/config.hpp> 17 template <
typename TReal,
typename TId>
20 using value_type = TId;
26 constexpr
explicit strong_id(value_type val) noexcept :
30 constexpr value_type
get()
const noexcept {
return value; }
32 explicit constexpr
operator value_type() noexcept {
return value; }
37 return *
static_cast<TReal*
>(
this);
50 return *
static_cast<TReal*
>(
this);;
61 template <
typename TReal,
typename TId>
64 return a.value == b.value;
67 template <
typename TReal,
typename TId>
70 return a.value != b.value;
73 template <
typename TReal,
typename TId>
76 return a.value < b.value;
79 template <
typename TReal,
typename TId>
82 return a.value <= b.value;
85 template <
typename TReal,
typename TId>
88 return a.value > b.value;
91 template <
typename TReal,
typename TId>
94 return a.value >= b.value;
97 template <
typename TReal,
typename TId>
100 return std::hash<TId>()(x.value);
110 template <
typename TReal>
117 static constexpr TReal
invalid() {
return TReal(-42); };
122 static constexpr TReal
any() {
return TReal(-1); };
137 std::ostream& operator<<(std::ostream&,
const version&);
139 std::string to_string(
const version&);
151 std::ostream& operator<<(std::ostream&,
const acl_version&);
165 std::ostream& operator<<(std::ostream&,
const child_version&);
170 public strong_id<transaction_id, std::size_t>
172 using strong_id::strong_id;
194 using time_point = std::chrono::system_clock::time_point;
241 return ephemeral_owner == 0U;
245 std::ostream& operator<<(std::ostream&,
const stat&);
247 std::string to_string(
const stat&);
274 return create_mode(static_cast<unsigned int>(a) | static_cast<unsigned int>(b));
279 return create_mode(static_cast<unsigned int>(a) & static_cast<unsigned int>(b));
290 return (
self & flags) == flags;
293 std::ostream& operator<<(std::ostream&,
const create_mode&);
313 std::ostream& operator<<(std::ostream&,
const event_type&);
340 std::ostream& operator<<(std::ostream&,
const state&);
342 std::string to_string(
const state&);
352 struct hash<
zk::version>
355 using result_type = std::size_t;
357 result_type operator()(
const argument_type& x)
const 364 struct hash<
zk::transaction_id>
367 using result_type = std::size_t;
369 result_type operator()(
const argument_type& x)
const time_point modified_time
Last time the znode was last modified.
transaction_id child_modified_transaction
The transaction ID that last modified the children of the znode.
std::size_t children_count
The number of children this znode 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 a znode 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.
The client is not connected to any server in the ensemble.
transaction_id modified_transaction
The last transaction that modified the znode.
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 znode.
std::uint64_t ephemeral_owner
The session ID of the owner of this znode, if it is an ephemeral entry.
Client is attempting to associate a session.
Represents a version of the ACL of a ZNode.
create_mode
When used in client::set, this value determines how the znode is created on the server.
std::size_t data_size
The size of the data field of the znode.
Standard behavior of a znode – the opposite of doing any of the options.
Statistics about a znode, similar to the UNIX stat structure.
bool is_ephemeral() const
Is the znode an ephemeral entry?
The client is in the connected state – it is connected to a server in the ensemble (one of the serve...
The znode will be deleted upon the client's disconnect.
Issued when a znode at a given path is created.
Issued when the data of a watched znode are altered.
The serving cluster has expired this session.
time_point create_time
Time the znode was created.
Watch has been forcefully removed.
event_type
Enumeration of types of events that may occur.
The name of the znode will be appended with a monotonically increasing number.
transaction_id create_transaction
The transaction ID that created the znode.
Represents a version of the children of a ZNode.
static constexpr TReal any()
When specified in an operation, this version specifier will always pass.
Represents a version of the data.
Base type for version types.
static constexpr TReal invalid()
An invalid version specifier.
zk::child_version child_version
The number of changes to the children of the znode.
Container nodes are special purpose nodes useful for recipes such as leader, lock, etc.
Issued when the children of a watched znode are created or deleted.
zk::acl_version acl_version
The number of changes to the ACL of the znode.