openMSX
|
This code is heavily based on boost circular_buffer: http://www.boost.org/doc/libs/1_55_0/doc/html/circular_buffer.html The interface of this version and the original boost version is (as much as possible identical). More...
#include <circular_buffer.hh>
Public Types | |
using | value_type = T |
using | pointer = T * |
using | reference = T & |
using | difference_type = ptrdiff_t |
using | iterator_category = std::random_access_iterator_tag |
Public Member Functions | |
cb_iterator ()=default | |
cb_iterator (const cb_iterator &it)=default | |
cb_iterator (const BUF *buf_, T *p_) | |
cb_iterator & | operator= (const cb_iterator &it)=default |
T & | operator* () const |
T * | operator-> () const |
cb_iterator & | operator++ () |
cb_iterator & | operator-- () |
cb_iterator | operator++ (int) |
cb_iterator | operator-- (int) |
cb_iterator & | operator+= (difference_type n) |
cb_iterator & | operator-= (difference_type n) |
T & | operator[] (difference_type n) const |
bool | operator== (const cb_iterator &it) const |
auto | operator<=> (const cb_iterator &it) const |
Friends | |
difference_type | operator- (const cb_iterator &l, const cb_iterator &r) |
cb_iterator | operator+ (cb_iterator it, difference_type n) |
cb_iterator | operator+ (difference_type n, cb_iterator it) |
cb_iterator | operator- (cb_iterator it, difference_type n) |
This code is heavily based on boost circular_buffer: http://www.boost.org/doc/libs/1_55_0/doc/html/circular_buffer.html The interface of this version and the original boost version is (as much as possible identical).
I did leave out some of the more fancy methods like insert/remove in the middle of the buffer or linearize the buffer. If we ever need those we can add them of course. So (for now) this class represents a dynamically sized circular buffer with (efficient) {push,pop}_{front,back} and operator[] methods. It also offers random access iterators. For much more details check the boost documentation. Random access iterator for circular_buffer.
Definition at line 23 of file circular_buffer.hh.
using cb_iterator< BUF, T >::difference_type = ptrdiff_t |
Definition at line 29 of file circular_buffer.hh.
using cb_iterator< BUF, T >::iterator_category = std::random_access_iterator_tag |
Definition at line 30 of file circular_buffer.hh.
using cb_iterator< BUF, T >::pointer = T* |
Definition at line 27 of file circular_buffer.hh.
using cb_iterator< BUF, T >::reference = T& |
Definition at line 28 of file circular_buffer.hh.
using cb_iterator< BUF, T >::value_type = T |
Definition at line 26 of file circular_buffer.hh.
|
default |
|
default |
|
inline |
Definition at line 34 of file circular_buffer.hh.
|
inline |
Definition at line 38 of file circular_buffer.hh.
|
inline |
Definition at line 45 of file circular_buffer.hh.
|
inline |
Definition at line 55 of file circular_buffer.hh.
|
inline |
Definition at line 58 of file circular_buffer.hh.
|
inline |
Definition at line 50 of file circular_buffer.hh.
|
inline |
Definition at line 56 of file circular_buffer.hh.
|
inline |
Definition at line 70 of file circular_buffer.hh.
|
inline |
Definition at line 39 of file circular_buffer.hh.
|
inline |
Definition at line 79 of file circular_buffer.hh.
|
default |
|
inline |
Definition at line 78 of file circular_buffer.hh.
|
inline |
Definition at line 76 of file circular_buffer.hh.
|
friend |
Definition at line 72 of file circular_buffer.hh.
|
friend |
Definition at line 73 of file circular_buffer.hh.
|
friend |
Definition at line 74 of file circular_buffer.hh.
|
friend |
Definition at line 41 of file circular_buffer.hh.