zookeeper-cpp
ZooKeeper Client for C++
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Groups
zk::op Class Referencefinal

Represents a single operation of a multi_op. More...

#include <zk/multi.hpp>

Classes

struct  check_data
 Data for a op::check operation. More...
 
struct  create_data
 Data for a op::create operation. More...
 
struct  erase_data
 Data for a op::erase operation. More...
 
struct  set_data
 Data for a op::set operation. More...
 

Public Member Functions

 op (const op &)
 
 op (op &&) noexcept
 
opoperator= (const op &)=delete
 
opoperator= (op &&)=delete
 
op_type type () const
 Get the underlying type of this operation. More...
 
const check_dataas_check () const
 Get the check-specific data. More...
 
const create_dataas_create () const
 Get the create-specific data. More...
 
const erase_dataas_erase () const
 Get the erase-specific data. More...
 
const set_dataas_set () const
 Get the set-specific data. More...
 

Static Public Member Functions

static op check (std::string path, version check=version::any())
 Check that the given path exists with the provided version check (which can be version::any). More...
 
static op erase (std::string path, version check=version::any())
 Delete the entry at the given path if it matches the version check. More...
 
static op set (std::string path, buffer data, version check=version::any())
 Set the data for the entry at path if it matches the version check. More...
 
static op create (std::string path, buffer data, acl rules, create_mode mode=create_mode::normal)
 
static op create (std::string path, buffer data, create_mode mode=create_mode::normal)
 

Friends

std::ostream & operator<< (std::ostream &, const op &)
 

Detailed Description

Represents a single operation of a multi_op.

Definition at line 37 of file multi.hpp.

Member Function Documentation

const op::check_data & zk::op::as_check ( ) const

Get the check-specific data.

Exceptions
std::logic_errorif the type is not op_type::check.

Definition at line 97 of file multi.cpp.

const op::create_data & zk::op::as_create ( ) const

Get the create-specific data.

Exceptions
std::logic_errorif the type is not op_type::create.

Definition at line 129 of file multi.cpp.

const op::erase_data & zk::op::as_erase ( ) const

Get the erase-specific data.

Exceptions
std::logic_errorif the type is not op_type::erase.

Definition at line 153 of file multi.cpp.

const op::set_data & zk::op::as_set ( ) const

Get the set-specific data.

Exceptions
std::logic_errorif the type is not op_type::set.

Definition at line 178 of file multi.cpp.

op zk::op::check ( std::string  path,
version  check = version::any() 
)
static

Check that the given path exists with the provided version check (which can be version::any).

Definition at line 92 of file multi.cpp.

op zk::op::create ( std::string  path,
buffer  data,
acl  rules,
create_mode  mode = create_mode::normal 
)
static

Create a new entry at the given path with the data.

See also
client::create

Definition at line 119 of file multi.cpp.

op zk::op::erase ( std::string  path,
version  check = version::any() 
)
static

Delete the entry at the given path if it matches the version check.

See also
client::erase

Definition at line 148 of file multi.cpp.

op zk::op::set ( std::string  path,
buffer  data,
version  check = version::any() 
)
static

Set the data for the entry at path if it matches the version check.

See also
client::set

Definition at line 173 of file multi.cpp.

op_type zk::op::type ( ) const

Get the underlying type of this operation.

Definition at line 56 of file multi.cpp.


The documentation for this class was generated from the following files: