1 #ifndef PROTON_CPP_ENDPOINT_H
2 #define PROTON_CPP_ENDPOINT_H
24 #include "proton/config.hpp"
25 #include "proton/export.hpp"
26 #include "proton/condition.hpp"
27 #include "proton/comparable.hpp"
77 template <
class T>
class iter_base :
public comparable<iter_base<T> > {
81 T& operator*()
const {
return *ptr_; }
82 const T* operator->()
const {
return &ptr_; }
83 operator bool()
const {
return !!ptr_; }
84 bool operator !()
const {
return !ptr_; }
85 bool operator==(
const iter_base<T>& x)
const {
return ptr_ == x.ptr_; }
86 bool operator!=(
const iter_base<T>& x)
const {
return ptr_ != x.ptr_; }
89 explicit iter_base(T p = 0,
endpoint::state s = 0) : ptr_(p), state_(s) {}
95 template<
class I>
class range {
99 explicit range(I begin = I(), I end = I()) : begin_(begin), end_(end) {}
100 I begin()
const {
return begin_; }
101 I end()
const {
return end_; }
110 #endif // PROTON_CPP_H
static const state LOCAL_MASK
Mask including all LOCAL_ bits (UNINIT, ACTIVE, CLOSED)
Definition: endpoint.hpp:53
The base class for session, connection, and link.
Definition: endpoint.hpp:32
Describes an endpoint error state.
Definition: condition.hpp:35
static const state REMOTE_UNINIT
Remote endpoint is uninitialized.
Definition: endpoint.hpp:48
int state
A bit mask of state bit values.
Definition: endpoint.hpp:45
static const state LOCAL_CLOSED
Local endpoint has been closed.
Definition: endpoint.hpp:51
virtual condition remote_condition() const =0
Get the error condition of the remote endpoint.
static const state REMOTE_ACTIVE
Remote endpoint is active.
Definition: endpoint.hpp:50
static const state REMOTE_CLOSED
Remote endpoint has been closed.
Definition: endpoint.hpp:52
static const state LOCAL_ACTIVE
Local endpoint is active.
Definition: endpoint.hpp:49
static const state REMOTE_MASK
Mask including all REMOTE_ bits (UNINIT, ACTIVE, CLOSED)
Definition: endpoint.hpp:54
virtual condition local_condition() const =0
Get the local error condition.
static const state LOCAL_UNINIT
Local endpoint is uninitialized.
Definition: endpoint.hpp:47