zookeeper-cpp
ZooKeeper Client for C++
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Groups
Client

Interacting with ZooKeeper as a client. More...

Classes

class  zk::acl_rule
 An individual rule in an acl. More...
 
class  zk::acl
 An access control list is a wrapper around acl_rule instances. More...
 
class  zk::acls
 Commonly-used ACLs. More...
 
class  zk::client
 A ZooKeeper client connection. More...
 
class  zk::connection
 An actual connection to the server. More...
 
class  zk::connection_params
 Used to specify parameters for a connection. More...
 
class  zk::connection_zk
 
class  zk::error
 Base error type for all errors raised by this library. More...
 
class  zk::transport_error
 Base types for errors that occurred while transporting data across a network. More...
 
class  zk::connection_loss
 Connection to the server has been lost before the attempted operation was verified as completed. More...
 
class  zk::marshalling_error
 An error occurred while marshalling data. More...
 
class  zk::not_implemented
 Operation was attempted that was not implemented. More...
 
class  zk::invalid_arguments
 Arguments to an operation were invalid. More...
 
class  zk::authentication_failed
 The server rejected the connection due to invalid authentication information. More...
 
class  zk::invalid_ensemble_state
 Base exception for cases where the ensemble is in an invalid state to perform a given action. More...
 
class  zk::new_configuration_no_quorum
 Raised when attempting an ensemble reconfiguration, but the proposed new ensemble would not be able to form quorum. More...
 
class  zk::reconfiguration_in_progress
 An attempt was made to reconfigure the ensemble, but there is already a reconfiguration in progress. More...
 
class  zk::reconfiguration_disabled
 The ensemble does not support reconfiguration. More...
 
class  zk::invalid_connection_state
 Base type for errors generated because the connection is misconfigured. More...
 
class  zk::session_expired
 The client session has been ended by the server. More...
 
class  zk::not_authorized
 An attempt was made to read or write to a ZNode when the connection does not have permission to do. More...
 
class  zk::closed
 The connection is closed. More...
 
class  zk::ephemeral_on_local_session
 An attempt was made to create an ephemeral entry, but the connection has a local session. More...
 
class  zk::read_only_connection
 A write operation was attempted on a read-only connection. More...
 
class  zk::check_failed
 Base exception for cases where a write operation was rolled back due to a failed check. More...
 
class  zk::no_entry
 Thrown from read operations when attempting to read a ZNode that does not exist. More...
 
class  zk::entry_exists
 Thrown when attempting to create a ZNode, but one already exists at the specified path. More...
 
class  zk::not_empty
 Thrown when attempting to erase a ZNode that has children. More...
 
class  zk::version_mismatch
 Thrown from modification operations when a version check is specified and the value in the database does not match the expected. More...
 
class  zk::no_children_for_ephemerals
 Ephemeral ZNodes cannot have children. More...
 
class  zk::transaction_failed
 Thrown from client::commit when a transaction cannot be committed to the system. More...
 
class  zk::op
 Represents a single operation of a multi_op. More...
 
class  zk::multi_op
 A collection of operations that will be performed atomically. More...
 
class  zk::multi_result
 The result of a successful client::commit operation. More...
 
class  zk::get_result
 The result type of client::get. More...
 
class  zk::get_children_result
 The result type of client::get_children. More...
 
class  zk::exists_result
 The result type of client::exists. More...
 
class  zk::create_result
 The result type of client::create. More...
 
class  zk::set_result
 The result type of client::set. More...
 
class  zk::get_acl_result
 The result type of client::get_acl. More...
 
class  zk::event
 Data delivered when a watched event triggers. More...
 
class  zk::watch_result
 The result type of client::watch. More...
 
class  zk::watch_children_result
 The result type of client::watch_children. More...
 
class  zk::watch_exists_result
 The result type of client::watch_exists. More...
 
struct  zk::strong_id< TReal, TId >
 Base type for creating strong ID types. More...
 
struct  zk::basic_version< TReal >
 Base type for version types. More...
 
struct  zk::version
 Represents a version of the data. More...
 
struct  zk::acl_version
 Represents a version of the ACL of an entry. More...
 
struct  zk::child_version
 Represents a version of the children of an entry. More...
 
struct  zk::transaction_id
 Represents the ZooKeeper transaction ID in which an event happened to an entry. More...
 
struct  zk::stat
 Statistics about a ZooKeeper entry, similar to the UNIX stat structure. More...
 

Macros

#define ZKPP_BUFFER_USE_STD_STRING   0
 
#define ZKPP_BUFFER_USE_CUSTOM   0
 Set this to 1 to use a custom definitions for buffer. More...
 
#define ZKPP_BUFFER_INCLUDE   <vector>
 The header file to use to find the buffer type. More...
 
#define ZKPP_BUFFER_TYPE   std::vector<char>
 The type name to use for the buffer type. More...
 
#define ZKPP_BUFFER_USE_STD_VECTOR   1
 Set this to 1 to use std::vector<char> for the implementation of zk::buffer. More...
 
#define ZKPP_VERSION_MAJOR   0
 
#define ZKPP_VERSION_MINOR   2
 
#define ZKPP_VERSION_PATCH   3
 
#define ZKPP_DEBUG   0
 Was ZooKeeper C++ compiled in debug mode? This value must be the same between when the SO was built and when you are compiling. More...
 
#define ZKPP_FUTURE_USE_STD_EXPERIMENTAL   0
 Set this to 1 to use std::experimental::future and std::experimental::promise as the backing types for zk::future and zk::promise. More...
 
#define ZKPP_FUTURE_USE_CUSTOM   0
 Set this to 1 to use custom definitions of zk::future and zk::promise. More...
 
#define ZKPP_FUTURE_TEMPLATE   std::future
 The template to use for zk::future. More...
 
#define ZKPP_PROMISE_TEMPLATE   std::promise
 The template to use for zk::promise. More...
 
#define ZKPP_FUTURE_INCLUDE   <future>
 The file to include to get the implementation for future and promise. More...
 
#define ZKPP_FUTURE_USE_STD   1
 Set this to 1 to use std::future and std::promise as the backing types for zk::future and zk::promise. More...
 

Typedefs

using zk::buffer = ZKPP_BUFFER_TYPE
 The buffer type. More...
 
template<typename T >
using zk::ptr = T *
 A simple, unowned pointer. More...
 
template<typename T >
using zk::future = ZKPP_FUTURE_TEMPLATE< T >
 
template<typename T >
using zk::promise = ZKPP_PROMISE_TEMPLATE< T >
 
template<typename T >
using zk::optional = std::optional< T >
 
using zk::nullopt_t = std::nullopt_t
 
using zk::string_view = std::string_view
 

Enumerations

enum  zk::permission : unsigned int {
  zk::permission::none = 0b00000, zk::permission::read = 0b00001, zk::permission::write = 0b00010, zk::permission::create = 0b00100,
  zk::permission::erase = 0b01000, zk::permission::admin = 0b10000, zk::permission::all = 0b11111
}
 Describes the ability of a user to perform a certain action. More...
 
enum  zk::error_code : int {
  zk::error_code::ok = 0, zk::error_code::connection_loss = -4, zk::error_code::marshalling_error = -5, zk::error_code::not_implemented = -6,
  zk::error_code::invalid_arguments = -8, zk::error_code::new_configuration_no_quorum = -13, zk::error_code::reconfiguration_in_progress = -14, zk::error_code::no_entry = -101,
  zk::error_code::not_authorized = -102, zk::error_code::version_mismatch = -103, zk::error_code::no_children_for_ephemerals = -108, zk::error_code::entry_exists = -110,
  zk::error_code::not_empty = -111, zk::error_code::session_expired = -112, zk::error_code::authentication_failed = -115, zk::error_code::closed = -116,
  zk::error_code::read_only_connection = -119, zk::error_code::ephemeral_on_local_session = -120, zk::error_code::reconfiguration_disabled = -123, zk::error_code::transaction_failed = -199
}
 Code for all error types thrown by the client library. More...
 
enum  zk::op_type : int { zk::op_type::check, zk::op_type::create, zk::op_type::erase, zk::op_type::set }
 Describes the type of an op. More...
 
enum  zk::create_mode : unsigned int { zk::create_mode::normal = 0b0000, zk::create_mode::ephemeral = 0b0001, zk::create_mode::sequential = 0b0010, zk::create_mode::container = 0b0100 }
 When used in client::set, this value determines how the entry is created on the server. More...
 
enum  zk::event_type : int {
  zk::event_type::error = 0, zk::event_type::created = 1, zk::event_type::erased = 2, zk::event_type::changed = 3,
  zk::event_type::child = 4, zk::event_type::session = -1, zk::event_type::not_watching = -2
}
 Enumeration of types of events that may occur. More...
 
enum  zk::state : int {
  zk::state::closed = 0, zk::state::connecting = 1, zk::state::connected = 3, zk::state::read_only = 5,
  zk::state::expired_session = -112, zk::state::authentication_failed = -113
}
 Enumeration of states the client may be at when a watch triggers. More...
 

Functions

constexpr permission zk::operator| (permission a, permission b)
 Set union operation of permission. More...
 
constexpr permission zk::operator& (permission a, permission b)
 Set intersection operation of permission. More...
 
constexpr permission zk::operator~ (permission a)
 Set inverse operation of permission. More...
 
constexpr bool zk::allows (permission self, permission perform)
 Check that self allows it perform all operations. More...
 
std::ostream & zk::operator<< (std::ostream &os, const permission &self)
 
std::string zk::to_string (const permission &self)
 
std::size_t zk::hash (const acl_rule &rule)
 Compute a hash for the given rule. More...
 
bool zk::operator== (const acl_rule &lhs, const acl_rule &rhs)
 
bool zk::operator!= (const acl_rule &lhs, const acl_rule &rhs)
 
bool zk::operator< (const acl_rule &lhs, const acl_rule &rhs)
 
bool zk::operator<= (const acl_rule &lhs, const acl_rule &rhs)
 
bool zk::operator> (const acl_rule &lhs, const acl_rule &rhs)
 
bool zk::operator>= (const acl_rule &lhs, const acl_rule &rhs)
 
std::ostream & zk::operator<< (std::ostream &os, const acl_rule &self)
 
std::string zk::to_string (const acl_rule &self)
 
bool zk::operator== (const acl &lhs, const acl &rhs)
 
bool zk::operator!= (const acl &lhs, const acl &rhs)
 
std::ostream & zk::operator<< (std::ostream &os, const acl &self)
 
std::string zk::to_string (const acl &self)
 
bool zk::operator== (const connection_params &lhs, const connection_params &rhs)
 
bool zk::operator!= (const connection_params &lhs, const connection_params &rhs)
 
std::string zk::to_string (const connection_params &x)
 
std::ostream & zk::operator<< (std::ostream &os, const connection_params &x)
 
constexpr bool zk::is_transport_error (error_code code)
 Check if the provided code is an exception code for a transport_error type of exception. More...
 
constexpr bool zk::is_invalid_arguments (error_code code)
 Check if the provided code is an exception code for a invalid_arguments type of exception. More...
 
constexpr bool zk::is_invalid_ensemble_state (error_code code)
 Check if the provided code is an exception code for a invalid_ensemble_state type of exception. More...
 
constexpr bool zk::is_invalid_connection_state (error_code code)
 Check if the provided code is an exception code for a invalid_connection_state type of exception. More...
 
constexpr bool zk::is_check_failed (error_code code)
 Check if the provided code is an exception code for a check_failed type of exception. More...
 
std::ostream & zk::operator<< (std::ostream &os, const error_code &code)
 
std::string zk::to_string (const error_code &code)
 
void zk::throw_error (error_code code)
 Throw an exception for the given code. More...
 
std::exception_ptr zk::get_exception_ptr_of (error_code code)
 Get an std::exception_ptr containing an exception with the proper type for the given code. More...
 
const std::error_category & zk::error_category ()
 Get the std::error_category capable of describing ZooKeeper-provided error codes. More...
 
std::ostream & zk::operator<< (std::ostream &os, const op_type &self)
 
std::string zk::to_string (const op_type &self)
 
std::ostream & zk::operator<< (std::ostream &os, const op &self)
 
std::string zk::to_string (const op &self)
 
std::ostream & zk::operator<< (std::ostream &os, const multi_op &self)
 
std::string zk::to_string (const multi_op &)
 
std::ostream & zk::operator<< (std::ostream &os, const multi_result::part &self)
 
std::ostream & zk::operator<< (std::ostream &os, const multi_result &self)
 
std::string zk::to_string (const multi_result::part &self)
 
std::string zk::to_string (const multi_result &self)
 
template<typename FUnary , typename... T>
auto zk::map (FUnary &&transform, const optional< T > &...x) -> optional< decltype(transform(x.value()...))>
 Apply transform with the arguments in x iff all of them have a value. Otherwise, nullopt will be returned. More...
 
template<typename T >
optional< T > zk::some (T x)
 
std::ostream & zk::operator<< (std::ostream &os, const get_result &self)
 
std::string zk::to_string (const get_result &self)
 
std::ostream & zk::operator<< (std::ostream &os, const get_children_result &self)
 
std::string zk::to_string (const get_children_result &self)
 
std::ostream & zk::operator<< (std::ostream &os, const exists_result &self)
 
std::string zk::to_string (const exists_result &self)
 
std::ostream & zk::operator<< (std::ostream &os, const create_result &self)
 
std::string zk::to_string (const create_result &self)
 
std::ostream & zk::operator<< (std::ostream &os, const set_result &self)
 
std::string zk::to_string (const set_result &self)
 
std::ostream & zk::operator<< (std::ostream &os, const get_acl_result &self)
 
std::string zk::to_string (const get_acl_result &self)
 
std::ostream & zk::operator<< (std::ostream &os, const event &self)
 
std::string zk::to_string (const event &self)
 
std::ostream & zk::operator<< (std::ostream &os, const watch_result &self)
 
std::string zk::to_string (const watch_result &self)
 
std::ostream & zk::operator<< (std::ostream &os, const watch_children_result &self)
 
std::string zk::to_string (const watch_children_result &self)
 
std::ostream & zk::operator<< (std::ostream &os, const watch_exists_result &self)
 
std::string zk::to_string (const watch_exists_result &self)
 
template<typename TReal , typename TId >
constexpr bool zk::operator== (const strong_id< TReal, TId > &a, const strong_id< TReal, TId > &b)
 
template<typename TReal , typename TId >
constexpr bool zk::operator!= (const strong_id< TReal, TId > &a, const strong_id< TReal, TId > &b)
 
template<typename TReal , typename TId >
constexpr bool zk::operator< (const strong_id< TReal, TId > &a, const strong_id< TReal, TId > &b)
 
template<typename TReal , typename TId >
constexpr bool zk::operator<= (const strong_id< TReal, TId > &a, const strong_id< TReal, TId > &b)
 
template<typename TReal , typename TId >
constexpr bool zk::operator> (const strong_id< TReal, TId > &a, const strong_id< TReal, TId > &b)
 
template<typename TReal , typename TId >
constexpr bool zk::operator>= (const strong_id< TReal, TId > &a, const strong_id< TReal, TId > &b)
 
template<typename TReal , typename TId >
std::size_t zk::hash (const strong_id< TReal, TId > &x)
 Compute the std::hash of the given x. More...
 
std::ostream & zk::operator<< (std::ostream &os, const version &self)
 
std::string zk::to_string (const version &self)
 
std::ostream & zk::operator<< (std::ostream &os, const acl_version &self)
 
std::string zk::to_string (const acl_version &self)
 
std::ostream & zk::operator<< (std::ostream &os, const child_version &self)
 
std::string zk::to_string (const child_version &self)
 
std::ostream & zk::operator<< (std::ostream &os, const transaction_id &self)
 
std::string zk::to_string (const transaction_id &self)
 
std::ostream & zk::operator<< (std::ostream &os, const stat &self)
 
std::string zk::to_string (const stat &self)
 
constexpr create_mode zk::operator| (create_mode a, create_mode b)
 Set union operation of create_mode. More...
 
constexpr create_mode zk::operator& (create_mode a, create_mode b)
 Set intersection operation of create_mode. More...
 
constexpr create_mode zk::operator~ (create_mode a)
 Set inverse operation of create_mode. More...
 
constexpr bool zk::is_set (create_mode self, create_mode flags)
 Check that self has flags set. More...
 
std::ostream & zk::operator<< (std::ostream &os, const create_mode &mode)
 
std::string zk::to_string (const create_mode &self)
 
std::ostream & zk::operator<< (std::ostream &os, const event_type &self)
 
std::string zk::to_string (const event_type &self)
 
std::ostream & zk::operator<< (std::ostream &os, const state &self)
 
std::string zk::to_string (const state &state)
 Get the string representation of the provided state. More...
 

Detailed Description

Interacting with ZooKeeper as a client.

Macro Definition Documentation

#define ZKPP_BUFFER_INCLUDE   <vector>

The header file to use to find the buffer type.

This value is set automatically if using built-in configuration options (such as ZKPP_BUFFER_USE_STD_VECTOR) and must be set manually if using ZKPP_BUFFER_USE_CUSTOM.

Definition at line 45 of file buffer.hpp.

#define ZKPP_BUFFER_TYPE   std::vector<char>

The type name to use for the buffer type.

This value is set automatically if using built-in configuration options (such as ZKPP_BUFFER_USE_STD_VECTOR) and must be set manually if using ZKPP_BUFFER_USE_CUSTOM.

Definition at line 46 of file buffer.hpp.

#define ZKPP_BUFFER_USE_CUSTOM   0

Set this to 1 to use a custom definitions for buffer.

If this is set, you must also set ZKPP_BUFFER_INCLUDE and ZKPP_BUFFER_TYPE.

Definition at line 31 of file buffer.hpp.

#define ZKPP_BUFFER_USE_STD_VECTOR   1

Set this to 1 to use std::vector<char> for the implementation of zk::buffer.

This is the default behavior.

Definition at line 40 of file buffer.hpp.

#define ZKPP_DEBUG   0

Was ZooKeeper C++ compiled in debug mode? This value must be the same between when the SO was built and when you are compiling.

In general, this is not useful outside of library maintainers.

Warning
Keep in mind this value is always defined. Use #if ZKPP_DEBUG, not #ifdef ZKPP_DEBUG.

Definition at line 23 of file config.hpp.

#define ZKPP_FUTURE_INCLUDE   <future>

The file to include to get the implementation for future and promise.

If you define ZKPP_FUTURE_TEMPLATE and ZKPP_PROMISE_TEMPLATE, you must also define this.

Definition at line 52 of file future.hpp.

#define ZKPP_FUTURE_TEMPLATE   std::future

The template to use for zk::future.

By default, this is std::future.

Definition at line 53 of file future.hpp.

#define ZKPP_FUTURE_USE_CUSTOM   0

Set this to 1 to use custom definitions of zk::future and zk::promise.

If this is set, you must also set ZKPP_FUTURE_TEMPLATE, ZKPP_PROMISE_TEMPLATE, and ZKPP_FUTURE_INCLUDE.

Definition at line 36 of file future.hpp.

#define ZKPP_FUTURE_USE_STD   1

Set this to 1 to use std::future and std::promise as the backing types for zk::future and zk::promise.

This is the default behavior.

Definition at line 47 of file future.hpp.

#define ZKPP_FUTURE_USE_STD_EXPERIMENTAL   0

Set this to 1 to use std::experimental::future and std::experimental::promise as the backing types for zk::future and zk::promise.

Definition at line 18 of file future.hpp.

#define ZKPP_PROMISE_TEMPLATE   std::promise

The template to use for zk::promise.

This should be highly related to ZKPP_FUTURE_TEMPLATE

Definition at line 54 of file future.hpp.

Typedef Documentation

using zk::buffer = typedef ZKPP_BUFFER_TYPE

The buffer type.

By default, this is an std::vector<char>, but this can be altered by compile-time flags such as ZKPP_BUFFER_USE_CUSTOM. The requirements for a custom buffer are minimal – the type must fit this criteria:

expression type description
buffer::value_type char Buffers must be made of single-byte elements
buffer::size_type std::size_t
buffer(ib, ie) buffer Constructs a buffer with the range [ib, ie)
buffer(buffer&&) buffer Move constructible.
size() size_type Get the length of the buffer
data() const value_type* Get a pointer to the beginning of the contents

Definition at line 79 of file buffer.hpp.

template<typename T >
using zk::ptr = typedef T*

A simple, unowned pointer.

It operates exactly like using *, but removes the question of * associativity and is easier to read when const qualifiers are involved.

Definition at line 37 of file config.hpp.

Enumeration Type Documentation

enum zk::create_mode : unsigned int
strong

When used in client::set, this value determines how the entry is created on the server.

These values can be ORed together to create combinations.

Enumerator
normal 

Standard behavior of an entry – the opposite of doing any of the options.

ephemeral 

The entry will be deleted when the client session expires.

sequential 

The name of the entry will be appended with a monotonically increasing number.

The actual path name of a sequential entry will be the given path plus a suffix "i" where i is the current sequential number of the entry. The sequence number is always fixed length of 10 digits, 0 padded. Once such a entry is created, the sequential number will be incremented by one.

container 

Container entries are special purpose entries useful for recipes such as leader, lock, etc.

When the last child of a container is deleted, the container becomes a candidate to be deleted by the server at some point in the future. Given this property, you should be prepared to get no_entry when creating children inside of this container entry.

Definition at line 283 of file types.hpp.

enum zk::error_code : int
strong

Code for all error types thrown by the client library.

See also
error
Enumerator
ok 

Never thrown.

connection_loss 

Code for connection_loss.

marshalling_error 

Code for marshalling_error.

not_implemented 

Code for not_implemented.

invalid_arguments 

Code for invalid_arguments.

new_configuration_no_quorum 

Code for new_configuration_no_quorum.

reconfiguration_in_progress 

Code for reconfiguration_in_progress.

no_entry 

Code for no_entry.

not_authorized 

Code for not_authorized.

version_mismatch 

Code for version_mismatch.

no_children_for_ephemerals 

Code for no_children_for_ephemerals.

entry_exists 

Code for entry_exists.

not_empty 

Code for not_empty.

session_expired 

Code for session_expired.

authentication_failed 

Code for authentication_failed.

closed 

Code for closed.

read_only_connection 

Code for read_only_connection.

ephemeral_on_local_session 

Code for ephemeral_on_local_session.

reconfiguration_disabled 

Code for reconfiguration_disabled.

transaction_failed 

Code for transaction_failed.

Definition at line 18 of file error.hpp.

enum zk::event_type : int
strong

Enumeration of types of events that may occur.

Enumerator
error 

Invalid event (this should never be issued).

created 

Issued when an entry for a given path is created.

erased 

Issued when an entry at a given path is erased.

changed 

Issued when the data of a watched entry is altered.

This event value is issued whenever a set operation occurs without an actual contents check, so there is no guarantee the data actually changed.

child 

Issued when the children of a watched entry are created or deleted.

This event is not issued when the data within children is altered.

session 

This value is issued as part of an event when the state changes.

not_watching 

Watch has been forcefully removed.

This is generated when the server for some reason (probably a resource constraint), will no longer watch an entry for a client.

Definition at line 331 of file types.hpp.

enum zk::op_type : int
strong

Describes the type of an op.

Enumerator
check 

op::check

create 

op::create

erase 

op::erase

set 

op::set

Definition at line 24 of file multi.hpp.

enum zk::permission : unsigned int
strong

Describes the ability of a user to perform a certain action.

Permissions can be mixed together like integers with | and &.

Enumerator
none 

No permissions are set (server could have been configured without ACL support).

read 

You can access the data of a node and can list its children.

write 

You can set the data of a node.

create 

You can create a child node.

erase 

You can erase a child node (but not necessarily this one).

admin 

You can alter permissions on this node.

all 

You can do anything.

Definition at line 21 of file acl.hpp.

enum zk::state : int
strong

Enumeration of states the client may be at when a watch triggers.

It represents the state of the connection at the time the event was generated.

Note
If you are familiar with the C API, notably missing from this list is a ZOO_NOTCONNECTED_STATE equivalent. This state happens in cases where the client disconnects on purpose (either on initial connection or just after ensemble reconfiguration). However, the ability to see this state is limited to times when you call zk_state at just the right moment. This state leads to a bit of confusion with closed and expired_session, so it is not in the list. Instead, these cases are presented as just connecting, as the client is attempting to reconnect to the cluster.
Enumerator
closed 

The client is not connected to any server in the ensemble.

connecting 

The client is connecting.

connected 

The client is in the connected state – it is connected to a server in the ensemble (one of the servers specified in the host connection parameter during ZooKeeper client creation).

read_only 

The client is connected to a read-only server, that is the server which is not currently connected to the majority.

The only operations allowed after receiving this state is read operations. This state is generated for read-only clients only since read/write clients aren't allowed to connect to read-only servers.

expired_session 

The serving cluster has expired this session.

The ZooKeeper client connection (the session) is no longer valid. You must create a new client connection if you wish to access the ensemble.

authentication_failed 

Authentication has failed – connection requires a new connection instance with different credentials.

Definition at line 385 of file types.hpp.

Function Documentation

constexpr bool zk::allows ( permission  self,
permission  perform 
)

Check that self allows it perform all operations.

For example, allows(permission::read | permission::write, permission::read) will be true, as read|write is allowed to read.

Definition at line 54 of file acl.hpp.

const std::error_category & zk::error_category ( )

Get the std::error_category capable of describing ZooKeeper-provided error codes.

See also
error

Definition at line 87 of file error.cpp.

std::exception_ptr zk::get_exception_ptr_of ( error_code  code)

Get an std::exception_ptr containing an exception with the proper type for the given code.

See also
throw_error

Definition at line 58 of file error.cpp.

std::size_t zk::hash ( const acl_rule &  self)

Compute a hash for the given rule.

Definition at line 53 of file acl.cpp.

template<typename TReal , typename TId >
std::size_t zk::hash ( const strong_id< TReal, TId > &  x)
inline

Compute the std::hash of the given x.

Definition at line 127 of file types.hpp.

constexpr bool zk::is_check_failed ( error_code  code)
inline

Check if the provided code is an exception code for a check_failed type of exception.

Definition at line 75 of file error.hpp.

constexpr bool zk::is_invalid_arguments ( error_code  code)
inline

Check if the provided code is an exception code for a invalid_arguments type of exception.

Definition at line 50 of file error.hpp.

constexpr bool zk::is_invalid_connection_state ( error_code  code)
inline

Check if the provided code is an exception code for a invalid_connection_state type of exception.

Definition at line 65 of file error.hpp.

constexpr bool zk::is_invalid_ensemble_state ( error_code  code)
inline

Check if the provided code is an exception code for a invalid_ensemble_state type of exception.

Definition at line 57 of file error.hpp.

constexpr bool zk::is_set ( create_mode  self,
create_mode  flags 
)

Check that self has flags set.

Definition at line 321 of file types.hpp.

constexpr bool zk::is_transport_error ( error_code  code)
inline

Check if the provided code is an exception code for a transport_error type of exception.

Definition at line 43 of file error.hpp.

template<typename FUnary , typename... T>
auto zk::map ( FUnary &&  transform,
const optional< T > &...  x 
) -> optional<decltype(transform(x.value()...))>

Apply transform with the arguments in x iff all of them have a value. Otherwise, nullopt will be returned.

Definition at line 25 of file optional.hpp.

constexpr permission zk::operator& ( permission  a,
permission  b 
)

Set intersection operation of permission.

Definition at line 39 of file acl.hpp.

constexpr create_mode zk::operator& ( create_mode  a,
create_mode  b 
)

Set intersection operation of create_mode.

Definition at line 308 of file types.hpp.

constexpr permission zk::operator| ( permission  a,
permission  b 
)

Set union operation of permission.

Definition at line 33 of file acl.hpp.

constexpr create_mode zk::operator| ( create_mode  a,
create_mode  b 
)

Set union operation of create_mode.

Definition at line 302 of file types.hpp.

constexpr permission zk::operator~ ( permission  a)

Set inverse operation of permission.

This is not exactly the bitwise complement of a, as the returned value will only include bits set that are valid in permission discriminants.

Definition at line 46 of file acl.hpp.

constexpr create_mode zk::operator~ ( create_mode  a)

Set inverse operation of create_mode.

This is not exactly the bitwise complement of a, as the returned value will only include bits set that are valid in create_mode discriminants.

Definition at line 315 of file types.hpp.

void zk::throw_error ( error_code  code)

Throw an exception for the given code.

This will use the proper refined exception type (such as no_entry) if one exists.

Definition at line 31 of file error.cpp.

std::string zk::to_string ( const state &  self)

Get the string representation of the provided state.

Definition at line 161 of file types.cpp.