3 #include <zk/config.hpp> 5 #include <initializer_list> 12 #include "forwards.hpp" 23 enum class op_type : int
31 std::ostream& operator<<(std::ostream&,
const op_type&);
33 std::string to_string(
const op_type&);
90 op& operator=(
const op&) =
delete;
91 op& operator=(
op&&) =
delete;
95 op_type type()
const {
return _type; }
113 any_data(std::nullptr_t) noexcept;
119 ~any_data() noexcept;
132 std::ostream& operator<<(std::ostream&,
const op&);
134 std::string to_string(
const op&);
139 using iterator = std::vector<op>::iterator;
140 using const_iterator = std::vector<op>::const_iterator;
141 using size_type = std::vector<op>::size_type;
147 multi_op(std::vector<op> ops) noexcept;
149 multi_op(std::initializer_list<op> ops) :
155 size_type size()
const {
return _ops.size(); }
157 op& operator[](size_type idx) {
return _ops[idx]; }
158 const op& operator[](size_type idx)
const {
return _ops[idx]; }
160 iterator begin() {
return _ops.begin(); }
161 const_iterator begin()
const {
return _ops.begin(); }
162 const_iterator cbegin()
const {
return _ops.begin(); }
164 iterator end() {
return _ops.end(); }
165 const_iterator end()
const {
return _ops.end(); }
166 const_iterator cend()
const {
return _ops.end(); }
168 void reserve(size_type capacity) { _ops.reserve(capacity); }
170 template <
typename... TArgs>
171 void emplace_back(TArgs&&... args)
173 _ops.emplace_back(std::forward<TArgs>(args)...);
176 void push_back(
op&& x)
178 emplace_back(std::move(x));
181 void push_back(
const op& x)
187 std::vector<op> _ops;
190 std::ostream& operator<<(std::ostream&,
const multi_op&);
192 std::string to_string(
const multi_op&);
202 any_result(std::nullptr_t) noexcept;
206 ~any_result() noexcept;
214 explicit part(op_type, std::nullptr_t) noexcept;
221 part& operator=(
const part&) =
delete;
227 op_type
type()
const {
return _type; }
238 using iterator = std::vector<part>::iterator;
239 using const_iterator = std::vector<part>::const_iterator;
240 using size_type = std::vector<part>::size_type;
250 size_type size()
const {
return _parts.size(); }
252 part& operator[](size_type idx) {
return _parts[idx]; }
253 const part& operator[](size_type idx)
const {
return _parts[idx]; }
255 iterator begin() {
return _parts.begin(); }
256 const_iterator begin()
const {
return _parts.begin(); }
257 const_iterator cbegin()
const {
return _parts.begin(); }
259 iterator end() {
return _parts.end(); }
260 const_iterator end()
const {
return _parts.end(); }
261 const_iterator cend()
const {
return _parts.end(); }
263 void reserve(size_type capacity) { _parts.reserve(capacity); }
265 template <
typename... TArgs>
266 void emplace_back(TArgs&&... args)
268 _parts.emplace_back(std::forward<TArgs>(args)...);
271 void push_back(
part&& x)
273 emplace_back(std::move(x));
276 void push_back(
const part& x)
282 std::vector<part> _parts;
286 std::ostream& operator<<(std::ostream&,
const multi_result&);
Describes the various result types of client operations.
The result type of client::create.
create_mode
When used in client::set, this value determines how the znode is created on the server.
Standard behavior of a znode – the opposite of doing any of the options.
You can create a child node.
The result type of client::set.
An access control list is a wrapper around acl_rule instances.
Controls the buffer type.
op_type type() const
The op_type of the op that caused this result.
You can erase a child node (but not necessarily this one).
static constexpr version any()
When specified in an operation, this version specifier will always pass.
Represents a version of the data.
ZKPP_BUFFER_TYPE buffer
The buffer type.