|
MLIB
|
Circular buffer. More...
#include <ringbuf.h>
Classes | |
| class | const_iterator |
| Iterator through the circular buffer. More... | |
| class | iterator |
Public Member Functions | |
| ring_buffer (size_t size) | |
| Constructor. | |
| ring_buffer () | |
| Default constructor. | |
| ring_buffer (const ring_buffer &other) | |
| Copy constructor. | |
| ring_buffer (std::initializer_list< T > il) | |
| Initializer list constructor. | |
| ring_buffer & | operator= (const ring_buffer &rhs) |
| Assignment operator. | |
| bool | operator== (const ring_buffer< T > &other) const |
| Equality operator. | |
| bool | operator!= (const ring_buffer< T > &other) const |
| Inequality operator. | |
| operator std::vector< T > () const | |
| Vector conversion operator. | |
| void | push_back (const T &item) |
| Inserts new element in buffer. | |
| iterator | begin () |
| Return an iterator pointing to first (oldest) element in buffer. | |
| const_iterator | begin () const |
| Return a const iterator pointing to first (oldest) element in buffer. | |
| const_iterator | cbegin () |
| Return a const iterator pointing to first (oldest) element in buffer. | |
| iterator | end () |
| Return an iterator pointing past the last (newest) element in buffer. | |
| const_iterator | end () const |
| Return a const iterator pointing past the last (newest) element in buffer. | |
| const_iterator | cend () |
| Return an iterator pointing past the last (newest) element in buffer. | |
| void | pop_front () |
| Remove oldest element from buffer. | |
| T & | front () |
| Return a reference to first (oldest) element in buffer. | |
| const T & | front () const |
| Return a reference to first (oldest) element in buffer. | |
| T & | back () |
| Return reference to last (newest) element in buffer. | |
| const T & | back () const |
| Return reference to last (newest) element in buffer. | |
| iterator | erase (const_iterator &ptr) |
| void | clear (void) |
| Remove all elements from buffer. | |
| bool | empty (void) |
| Return true if buffer is empty. | |
| bool | full (void) const |
| Return true if buffer is full. | |
| size_t | capacity (void) const |
| Return maximum buffer size. | |
| void | resize (size_t new_cap) |
| (Re)allocate buffer with a different capacity | |
| size_t | size () const |
| Return number of elements in buffer. | |
Circular buffer.
|
inline |
Erase element at iterator position. SHiftrs all elements between front (oldest) and iterator position.