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