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