15 typedef SSIZE_T ssize_t;
16 #endif // WITHOUT_POSIX 23 buf_ =
new T[capacity];
30 pos_ = (pos_ + 1) % max_;
32 size_ = std::min(size_ + 1, max_);
34 void push(T
const& value) {
35 pos_ = (pos_ + 1) % max_;
37 size_ = std::min(size_ + 1, max_);
40 pos_ = (pos_ + 1) % max_;
42 size_ = std::min(size_ + 1, max_);
51 T
const&
at(ssize_t pos)
const {
52 pos = (pos + pos_) % max_;
59 pos = (pos + pos_) % max_;
74 ssize_t pos_, size_, max_;
size_t size() const
Definition: circularbuffer.h:45
void push(T &value)
Definition: circularbuffer.h:39
void push(T const &value)
Definition: circularbuffer.h:34
~CircularBuffer()
Definition: circularbuffer.h:25
T & at(ssize_t pos)
Definition: circularbuffer.h:58
CircularBuffer(size_t capacity)
Definition: circularbuffer.h:22
General utilities.
Definition: assert.cpp:7
T const & at(ssize_t pos) const
Definition: circularbuffer.h:51
void push()
Definition: circularbuffer.h:29
Definition: circularbuffer.h:20