24 #ifndef _CORE_UTILS_CIRCULAR_BUFFER_H_ 25 #define _CORE_UTILS_CIRCULAR_BUFFER_H_ 43 template <
typename Type>
const_iterator end() const
Get iterator to the end.
const Type & back() const
Access the last element in the buffer.
CircularBuffer< Type > & operator=(const CircularBuffer< Type > &other)
Assignment operator.
const_iterator begin() const
Get iterator to the beginning.
Fawkes library namespace.
~CircularBuffer()
Destructor.
const Type & at(size_type n) const
Element access.
const_iterator iterator
iterator is also const, we don't want to manipulate any elements
size_type size() const
Get actual size of the buffer.
Circular buffer with a fixed size.
CircularBuffer(size_type n)
Constructor.
void pop_front()
Delete the first element.
std::deque< Type >::const_iterator const_iterator
The CircularBuffer's iterator is a std::deque iterator.
std::deque< Type > deque_
The deque used to store the data.
size_type max_size_
The maximum size of the circular buffer.
size_t size_type
The size_type of the buffer.
size_type get_max_size() const
Get the maximum size of the buffer.
const Type & operator[](size_type n) const
Element access.
CircularBuffer(const CircularBuffer< Type > &other)
Copy constructor.
void push_back(const Type &val)
Insert an element at the end of the buffer and delete the first element if necessary.
const Type & front() const
Access the first element in the buffer.
std::deque< Type > get_deque() const
Get the deque used to store the elements.