1#ifndef PROTON_INTERNAL_DATA_HPP
2#define PROTON_INTERNAL_DATA_HPP
25#include "../internal/object.hpp"
26#include "../types_fwd.hpp"
38class data :
public object<pn_data_t> {
40 data(pn_data_t* d) : internal::object<pn_data_t>(d) {}
44 data() : internal::object<pn_data_t>(0) {}
47 PN_CPP_EXTERN
static data create();
50 PN_CPP_EXTERN
void copy(
const data&);
53 PN_CPP_EXTERN
void clear();
56 PN_CPP_EXTERN
void rewind();
59 PN_CPP_EXTERN
bool empty()
const;
62 PN_CPP_EXTERN
int append(data src);
65 PN_CPP_EXTERN
int appendn(data src,
int limit);
67 PN_CPP_EXTERN
bool next();
68 PN_CPP_EXTERN
const void* point()
const;
69 PN_CPP_EXTERN
void restore(
const void* h);
75 friend class internal::factory<data>;
76 friend struct state_guard;
77 friend PN_CPP_EXTERN std::ostream&
operator<<(std::ostream&,
const data&);
93 state_guard(data& d) : data_(d), point_(data_.point()), cancel_(false) {}
96 ~state_guard() {
if (!cancel_) data_.restore(point_); }
99 void cancel() { cancel_ =
true; }
The main Proton namespace.
Definition annotation_key.hpp:33
std::ostream & operator<<(std::ostream &, const binary &)
Print a binary value.