Fawkes API
Fawkes Development Version
|
#include <>>
Public Types | |
typedef size_t | size_type |
The size_type of the buffer. More... | |
typedef std::deque< Type >::const_iterator | const_iterator |
The CircularBuffer's iterator is a std::deque iterator. More... | |
typedef const_iterator | iterator |
iterator is also const, we don't want to manipulate any elements More... | |
Public Member Functions | |
CircularBuffer (size_type n) | |
Constructor. More... | |
CircularBuffer (const CircularBuffer< Type > &other) | |
Copy constructor. More... | |
~CircularBuffer () | |
Destructor. More... | |
CircularBuffer< Type > & | operator= (const CircularBuffer< Type > &other) |
Assignment operator. More... | |
void | push_back (const Type &val) |
Insert an element at the end of the buffer and delete the first element if necessary. More... | |
void | pop_front () |
Delete the first element. More... | |
size_type | get_max_size () const |
Get the maximum size of the buffer. More... | |
std::deque< Type > | get_deque () const |
Get the deque used to store the elements. More... | |
const Type & | operator[] (size_type n) const |
Element access. More... | |
const Type & | at (size_type n) const |
Element access. More... | |
const Type & | front () const |
Access the first element in the buffer. More... | |
const Type & | back () const |
Access the last element in the buffer. More... | |
const_iterator | begin () const |
Get iterator to the beginning. More... | |
const_iterator | end () const |
Get iterator to the end. More... | |
size_type | size () const |
Get actual size of the buffer. More... | |
Protected Attributes | |
std::deque< Type > | deque_ |
The deque used to store the data. More... | |
size_type | max_size_ |
The maximum size of the circular buffer. More... | |
Circular buffer with a fixed size. This class provides a a circular buffer. A circular buffer is a container with a fixed (maximum) size. It automatically maintains its size by removing elements from the front, if necessary. This implementation does not allow any element manipulation other than push_back() and pop_front(). All returned references to elements are constant.
Definition at line 50 of file circular_buffer.h.
typedef std::deque<Type>::const_iterator fawkes::CircularBuffer< Type >::const_iterator |
The CircularBuffer's iterator is a std::deque iterator.
Definition at line 56 of file circular_buffer.h.
typedef const_iterator fawkes::CircularBuffer< Type >::iterator |
iterator is also const, we don't want to manipulate any elements
Definition at line 58 of file circular_buffer.h.
typedef size_t fawkes::CircularBuffer< Type >::size_type |
The size_type of the buffer.
Definition at line 54 of file circular_buffer.h.
|
inline |
Constructor.
n | the maximum size of the buffer |
Definition at line 62 of file circular_buffer.h.
|
inline |
Copy constructor.
other | CircularBuffer to copy |
Definition at line 69 of file circular_buffer.h.
|
inline |
Destructor.
Definition at line 75 of file circular_buffer.h.
|
inline |
Element access.
n | position of the element |
Definition at line 143 of file circular_buffer.h.
|
inline |
Access the last element in the buffer.
Definition at line 161 of file circular_buffer.h.
|
inline |
|
inline |
|
inline |
Access the first element in the buffer.
Definition at line 152 of file circular_buffer.h.
|
inline |
Get the deque used to store the elements.
Definition at line 124 of file circular_buffer.h.
|
inline |
Get the maximum size of the buffer.
Definition at line 115 of file circular_buffer.h.
|
inline |
Assignment operator.
other | CircularBuffer to copy |
Definition at line 84 of file circular_buffer.h.
|
inline |
Element access.
n | position of the element |
Definition at line 133 of file circular_buffer.h.
|
inline |
Delete the first element.
Definition at line 106 of file circular_buffer.h.
|
inline |
Insert an element at the end of the buffer and delete the first element if necessary.
val | the value to insert |
Definition at line 96 of file circular_buffer.h.
Referenced by fawkes::SyncPoint::wait().
|
inline |
Get actual size of the buffer.
Definition at line 188 of file circular_buffer.h.
|
protected |
The deque used to store the data.
Definition at line 195 of file circular_buffer.h.
Referenced by fawkes::CircularBuffer< fawkes::SyncPointCall >::at(), fawkes::CircularBuffer< fawkes::SyncPointCall >::back(), fawkes::CircularBuffer< fawkes::SyncPointCall >::begin(), fawkes::CircularBuffer< fawkes::SyncPointCall >::end(), fawkes::CircularBuffer< fawkes::SyncPointCall >::front(), fawkes::CircularBuffer< fawkes::SyncPointCall >::get_deque(), fawkes::CircularBuffer< fawkes::SyncPointCall >::get_max_size(), fawkes::CircularBuffer< fawkes::SyncPointCall >::operator=(), fawkes::CircularBuffer< fawkes::SyncPointCall >::operator[](), and fawkes::CircularBuffer< fawkes::SyncPointCall >::~CircularBuffer().
|
protected |
The maximum size of the circular buffer.
Definition at line 197 of file circular_buffer.h.
Referenced by fawkes::CircularBuffer< fawkes::SyncPointCall >::operator=(), fawkes::CircularBuffer< fawkes::SyncPointCall >::pop_front(), and fawkes::CircularBuffer< fawkes::SyncPointCall >::~CircularBuffer().