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 48 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 54 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 56 of file circular_buffer.h.
typedef size_t fawkes::CircularBuffer< Type >::size_type |
The size_type of the buffer.
Definition at line 52 of file circular_buffer.h.
|
inline |
Constructor.
n | the maximum size of the buffer |
Definition at line 60 of file circular_buffer.h.
|
inline |
Copy constructor.
other | CircularBuffer to copy |
Definition at line 67 of file circular_buffer.h.
|
inline |
Destructor.
Definition at line 73 of file circular_buffer.h.
|
inline |
Element access.
n | position of the element |
Definition at line 141 of file circular_buffer.h.
|
inline |
Access the last element in the buffer.
Definition at line 159 of file circular_buffer.h.
|
inline |
|
inline |
|
inline |
Access the first element in the buffer.
Definition at line 150 of file circular_buffer.h.
|
inline |
Get the deque used to store the elements.
Definition at line 122 of file circular_buffer.h.
|
inline |
Get the maximum size of the buffer.
Definition at line 113 of file circular_buffer.h.
|
inline |
Assignment operator.
other | CircularBuffer to copy |
Definition at line 82 of file circular_buffer.h.
|
inline |
Element access.
n | position of the element |
Definition at line 131 of file circular_buffer.h.
|
inline |
Delete the first element.
Definition at line 104 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 94 of file circular_buffer.h.
Referenced by fawkes::SyncPoint::wait().
|
inline |
Get actual size of the buffer.
Definition at line 186 of file circular_buffer.h.
|
protected |
The deque used to store the data.
Definition at line 193 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[](), and fawkes::CircularBuffer< fawkes::SyncPointCall >::~CircularBuffer().
|
protected |
The maximum size of the circular buffer.
Definition at line 195 of file circular_buffer.h.
Referenced by fawkes::CircularBuffer< fawkes::SyncPointCall >::pop_front(), and fawkes::CircularBuffer< fawkes::SyncPointCall >::~CircularBuffer().