M5Utility 0.0.2 git rev:5c1a751
Loading...
Searching...
No Matches
m5::container::FixedCircularBuffer< T, N > Class Template Reference

Type CircularBuffer giving size in template parameter. More...

#include <circular_buffer.hpp>

Inheritance diagram for m5::container::FixedCircularBuffer< T, N >:
m5::container::CircularBuffer< T >

Public Types

using value_type = T
 
using size_type = size_t
 
using reference = T&
 
using const_reference = const T&
 
using return_type = m5::stl::optional<value_type>
 
- Public Types inherited from m5::container::CircularBuffer< T >
using value_type = T
 
using size_type = size_t
 
using reference = T&
 
using const_reference = const T&
 
using return_type = m5::stl::optional<value_type>
 
using reverse_iterator = std::reverse_iterator<iterator>
 
using const_reverse_iterator = std::reverse_iterator<const_iterator>
 

Public Member Functions

 FixedCircularBuffer (const size_type n, const_reference value)
 
template<class InputIter >
 FixedCircularBuffer (InputIter first, InputIter last)
 
 FixedCircularBuffer (std::initializer_list< T > il)
 
 FixedCircularBuffer (const FixedCircularBuffer &)=default
 
 FixedCircularBuffer (FixedCircularBuffer &&)=default
 
FixedCircularBufferoperator= (const FixedCircularBuffer &)=default
 
FixedCircularBufferoperator= (FixedCircularBuffer &&) noexcept=default
 
- Public Member Functions inherited from m5::container::CircularBuffer< T >
 CircularBuffer (const size_t n)
 
 CircularBuffer (const size_type n, const_reference value)
 
template<class InputIter >
 CircularBuffer (const size_type n, InputIter first, InputIter last)
 
 CircularBuffer (const size_type n, std::initializer_list< T > il)
 
 CircularBuffer (const CircularBuffer &)=default
 
 CircularBuffer (CircularBuffer &&) noexcept=default
 
CircularBufferoperator= (const CircularBuffer &)=default
 Copy.
 
CircularBufferoperator= (CircularBuffer &&)=default
 Move.
 
template<class InputIterator >
void assign (InputIterator first, InputIterator last)
 Replaces the contents with copies of those in the range [first, last)
 
void assign (size_type n, const_reference v)
 assigns values to the container
 
void assign (std::initializer_list< T > il)
 assigns values to the container
 
return_type front () const
 Access the first element.
 
return_type back () const
 Access the last element.
 
const_reference operator[] (size_type i) const &
 Access specified element.
 
return_type at (size_type i) const
 Access specified element with bounds checking.
 
size_t read (value_type *outbuf, const size_t num)
 Read from buffer.
 
bool empty () const
 checks whether the container is empty
 
bool full () const
 checks whether the container is full
 
size_type size () const
 returns the number of elements
 
size_type capacity () const
 Returns the number of elements that can be held in currently storage.
 
void clear ()
 Clears the contents.
 
void push_front (const value_type &v)
 Adds an element to the top.
 
void push_back (const value_type &v)
 Adds an element to the end.
 
void pop_front ()
 removes the top element
 
void pop_back ()
 removes the end element
 
void fill (const value_type &v)
 Assigns the value to all elements in the container.
 
void swap (CircularBuffer &o)
 Swaps the contents.
 
iterator begin () noexcept
 
iterator end () noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin () noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 

Additional Inherited Members

Detailed Description

template<typename T, size_t N>
class m5::container::FixedCircularBuffer< T, N >

Type CircularBuffer giving size in template parameter.

Template Parameters
TType of the element @tpatam N Capacity of the buffer