56#include <piduino/memory.h>
66 template <
typename T,
typename A = std::allocator<T>>
73 typedef typename allocator_type::pointer
pointer;
75 typedef typename allocator_type::reference
reference;
77 typedef typename allocator_type::size_type
size_type;
128 template <
typename II>
191 template<
typename E,
typename EN>
192 class iterator_ :
public std::iterator<std::random_access_iterator_tag, EN> {
483 new_size <
size() ?
size() - new_size : 0;
696 throw std::out_of_range (
"RingBuffer::at()");
752 template <
typename I>
781 template <
typename T,
typename A>
794 template <
typename T,
typename A>
797 return ! (lhs == rhs);
806 template <
typename T,
typename A>
809 return std::lexicographical_compare (
819 template <
typename T,
typename A>
830 template <
typename T,
typename A>
841 template <
typename T,
typename A>
852 template <
typename T,
typename A>
RingBuffer iterator class template.
self_type & operator+=(difference_type const n)
iterator_(RingBufferType *const buf, size_type const pos)
bool operator<(self_type const &other) const
self_type & operator=(self_type const &other)
friend self_type operator+(typename self_type::difference_type const &lhs, self_type const &rhs)
bool operator<=(self_type const &other) const
friend self_type operator-(typename self_type::difference_type const &lhs, self_type const &rhs)
bool operator>=(self_type const &other) const
bool operator!=(self_type const &other) const
iterator_< elem_type, elem_type_nc > self_type
iterator_(RingBufferType const *const buf, size_type const pos)
bool operator==(self_type const &other) const
iterator_(iterator_< elem_type_nc, elem_type_nc > const &other)
self_type & operator-=(difference_type const n)
RingBuffer< T, A > RingBufferType
bool operator>(self_type const &other) const
STL-style circular buffer.
void swap(self_type &other)
size_type previous_tail()
std::reverse_iterator< const_iterator > const_reverse_iterator
reference at_unchecked(size_type const index) const
const_reference at(size_type const n) const
iterator_< value_type, value_type > iterator
size_type capacity() const
allocator_type::const_pointer const_pointer
void push_back(value_type const &item)
Appends the given item to the end of the container.
const_reference operator[](size_type const n) const
reference back()
access the last element
void push_front(value_type const &item)
Insert a new element at the beginning of the container.
const_reference back() const
access the last element
reference front()
access the first element
std::reverse_iterator< iterator > reverse_iterator
allocator_type::difference_type difference_type
allocator_type::value_type value_type
reference at(size_type const n)
RingBuffer(self_type const &other)
Copy constructor.
allocator_type::reference reference
allocator_type::size_type size_type
RingBuffer< T, A > self_type
void assign_into(I from, I const to)
void pop_back()
Remove the last element from the container.
const_iterator begin() const
void pop_front()
Removes the first element of the container.
size_type max_size() const
reference at_checked(size_type const index) const
allocator_type get_allocator() const
size_type m_contents_size
size_type index_to_subscript(size_type const index) const
const_reverse_iterator rend() const
allocator_type::pointer pointer
const_reference front() const
access the first element
iterator_< const value_type, value_type > const_iterator
void reserve(size_type const new_size)
reserve shrinks or expands the internal buffer to the size given
reverse_iterator rbegin()
const_reverse_iterator rbegin() const
RingBuffer(II const from, II const to)
??
allocator_type m_allocator
RingBuffer & operator=(self_type other)
copy-swap idiom using value parameter
size_type previous_head()
const_iterator end() const
size_type normalise(size_type const n) const
RingBuffer(size_type const capacity=1, allocator_type const &allocator=allocator_type())
Default constructor.
allocator_type::const_reference const_reference
Global namespace for Piduino.
RingBuffer< T, A >::iterator end(RingBuffer< T, A > &cb)
bool operator<(RingBuffer< T, A > const &lhs, RingBuffer< T, A > const &rhs)
bool operator==(RingBuffer< T, A > const &lhs, RingBuffer< T, A > const &rhs)
bool operator!=(RingBuffer< T, A > const &lhs, RingBuffer< T, A > const &rhs)
RingBuffer< T, A >::iterator begin(RingBuffer< T, A > &cb)