22 template <
typename TBuffer>
24 -> decltype((os << buf),
void())
29 template <
typename TBuffer>
30 void print_buffer(std::ostream& os,
const TBuffer& buf,
struct print_buffer_length_tag)
32 os <<
"size=" << buf.size();
35 template <
typename TRange>
36 void print_range(std::ostream& os,
const TRange& range)
40 for (
const auto& x : range)
52 std::string to_string_generic(
const T& x)
54 std::ostringstream os;
63 get_result::get_result(
buffer data,
const zk::stat& stat) noexcept :
64 _data(std::move(data)),
68 get_result::~get_result() noexcept
71 std::ostream& operator<<(std::ostream& os,
const get_result&
self)
74 print_buffer(os,
self.data(), print_buffer_content_tag {});
75 os <<
' ' <<
self.stat();
79 std::string to_string(
const get_result&
self)
81 return to_string_generic(
self);
88 get_children_result::get_children_result(children_list_type children,
const stat& parent_stat) noexcept :
89 _children(std::move(children)),
90 _parent_stat(parent_stat)
93 get_children_result::~get_children_result() noexcept
96 std::ostream& operator<<(std::ostream& os,
const get_children_result&
self)
98 os <<
"get_children_result{";
99 print_range(os,
self.children());
100 os <<
" parent=" <<
self.parent_stat();
104 std::string to_string(
const get_children_result&
self)
106 return to_string_generic(
self);
113 exists_result::exists_result(
const optional<zk::stat>& stat) noexcept :
117 exists_result::~exists_result() noexcept
120 std::ostream& operator<<(std::ostream& os,
const exists_result&
self)
122 os <<
"exists_result{";
130 std::string to_string(
const exists_result&
self)
132 return to_string_generic(
self);
139 create_result::create_result(std::string name) noexcept :
140 _name(std::move(name))
143 create_result::~create_result() noexcept
146 std::ostream& operator<<(std::ostream& os,
const create_result&
self)
148 return os <<
"create_result{name=" <<
self.name() <<
'}';
151 std::string to_string(
const create_result&
self)
153 return to_string_generic(
self);
160 set_result::set_result(
const zk::stat& stat) noexcept :
164 set_result::~set_result() noexcept
167 std::ostream& operator<<(std::ostream& os,
const set_result&
self)
169 return os <<
"set_result{" <<
self.stat() <<
'}';
172 std::string to_string(
const set_result&
self)
174 return to_string_generic(
self);
181 get_acl_result::get_acl_result(
zk::acl acl,
const zk::stat& stat) noexcept :
182 _acl(std::move(acl)),
186 get_acl_result::~get_acl_result() noexcept
189 std::ostream& operator<<(std::ostream& os,
const get_acl_result&
self)
191 return os <<
"get_acl_result{" <<
self.acl() <<
' ' <<
self.stat() <<
'}';
194 std::string to_string(
const get_acl_result&
self)
196 return to_string_generic(
self);
208 std::ostream& operator<<(std::ostream& os,
const event&
self)
210 return os <<
"event{" <<
self.type() <<
" | " <<
self.state() <<
'}';
213 std::string to_string(
const event&
self)
215 return to_string_generic(
self);
222 watch_result::watch_result(get_result initial, future<event> next) noexcept :
223 _initial(std::move(initial)),
224 _next(std::move(next))
227 watch_result::~watch_result() noexcept
230 std::ostream& operator<<(std::ostream& os,
const watch_result&
self)
232 return os <<
"watch_result{initial=" <<
self.initial() <<
'}';
235 std::string to_string(
const watch_result&
self)
237 return to_string_generic(
self);
244 watch_children_result::watch_children_result(get_children_result initial, future<event> next) noexcept :
245 _initial(std::move(initial)),
246 _next(std::move(next))
249 watch_children_result::~watch_children_result() noexcept
252 std::ostream& operator<<(std::ostream& os,
const watch_children_result&
self)
254 return os <<
"watch_children_result{initial=" <<
self.initial() <<
'}';
257 std::string to_string(
const watch_children_result&
self)
259 return to_string_generic(
self);
266 watch_exists_result::watch_exists_result(exists_result initial, future<event> next) noexcept :
267 _initial(std::move(initial)),
268 _next(std::move(next))
271 watch_exists_result::~watch_exists_result() noexcept
274 std::ostream& operator<<(std::ostream& os,
const watch_exists_result&
self)
276 return os <<
"watch_exists_result{initial=" <<
self.initial() <<
'}';
279 std::string to_string(
const watch_exists_result&
self)
281 return to_string_generic(
self);
Describes the various result types of client operations.
state
Enumeration of states the client may be at when a watch triggers.
Statistics about a ZooKeeper entry, similar to the UNIX stat structure.
event_type
Enumeration of types of events that may occur.
An access control list is a wrapper around acl_rule instances.
ZKPP_BUFFER_TYPE buffer
The buffer type.