27 #ifndef INCLUDED_ADTS_RING_BUF
28 #define INCLUDED_ADTS_RING_BUF
47 size_t idx = (size_t)(
head + ofs);
53 size_t idx = (size_t)(
head + ofs);
116 {
return data[(
pos+idx) % n]; }
122 { ++
pos;
return (*
this); }
124 {
iterator tmp = *
this; ++*
this;
return tmp; }
128 {
return !(*
this == rhs); }
130 {
return (
pos < rhs.
pos); }
132 {
pos += ofs;
return *
this; }
134 {
return (*
this += -ofs); }
136 {
iterator tmp = *
this;
return (tmp += ofs); }
138 {
iterator tmp = *
this;
return (tmp -= ofs); }
162 {
return data[(
pos+idx) % n]; }
168 { ++
pos;
return (*
this); }
174 {
return !(*
this == rhs); }
176 {
return (
pos < rhs.
pos); }
178 {
pos += ofs;
return *
this; }
180 {
return (*
this += -ofs); }
182 {
iterator tmp = *
this;
return (tmp += ofs); }
184 {
iterator tmp = *
this;
return (tmp -= ofs); }
206 const_iterator
end()
const
212 #endif // #ifndef INCLUDED_ADTS_RING_BUF
difference_type operator-(const iterator right) const
bool operator!=(const iterator &rhs) const
bool operator==(const const_iterator &rhs) const
difference_type operator-(const iterator right) const
const_iterator(const T *data_, size_t pos_)
ptrdiff_t difference_type
bool operator==(const iterator &rhs) const
iterator operator-(difference_type ofs) const
const_iterator begin() const
std::random_access_iterator_tag iterator_category
bool operator<(const iterator &rhs) const
iterator & operator-=(difference_type ofs)
T & operator[](int idx) const
const T * operator->() const
const T & operator[](int idx) const
std::random_access_iterator_tag iterator_category
void push_back(const T &item)
const_iterator operator++(int)
ptrdiff_t difference_type
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
iterator & operator+=(difference_type ofs)
bool operator!=(const const_iterator &rhs) const
const T & operator[](int ofs) const
iterator & operator-=(difference_type ofs)
iterator(T *data_, size_t pos_)
iterator operator-(difference_type ofs) const
const_iterator end() const
iterator operator+(difference_type ofs) const
#define T(string_literal)
#define DEBUG_WARN_ERR(status)
display the error dialog with text corresponding to the given error code.
const T & operator*() const
const_iterator & operator++()
bool operator<(const const_iterator &rhs) const
iterator & operator+=(difference_type ofs)
iterator operator+(difference_type ofs) const