GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::RingBuffer< T, Allocator > Class Template Reference

#include <GREM/core/data/RingBuffer.hpp>

Public Types

using value_type = T
using allocator_type = Allocator
using size_type = std::size_t
using difference_type = std::ptrdiff_t
using reference = T&
using const_reference = const T&
using pointer = typename std::allocator_traits<Allocator>::pointer
using const_pointer = typename std::allocator_traits<Allocator>::const_pointer
using iterator = detail::RingBufferIterator<T>
using const_iterator = detail::RingBufferIterator<const T>
using reverse_iterator = std::reverse_iterator<iterator>
using const_reverse_iterator = std::reverse_iterator<const_iterator>

Public Member Functions

constexpr RingBuffer ()=default
constexpr RingBuffer (const Allocator &allocator) noexcept
constexpr RingBuffer (size_type count, const T &value, const Allocator &allocator=Allocator())
constexpr RingBuffer (size_type count, const Allocator &allocator=Allocator())
template<std::input_iterator InputIterator, std::sentinel_for< InputIterator > Sentinel>
constexpr RingBuffer (InputIterator first, Sentinel last, const Allocator &allocator=Allocator())
constexpr RingBuffer (const RingBuffer &other)
constexpr RingBuffer (const RingBuffer &other, const Allocator &allocator)
constexpr RingBuffer (RingBuffer &&other) noexcept
constexpr RingBuffer (RingBuffer &&other, const Allocator &allocator)
constexpr RingBuffer (std::initializer_list< T > ilist, const Allocator &allocator=Allocator())
constexpr ~RingBuffer ()
constexpr RingBuffer & operator= (const RingBuffer &other)
constexpr RingBuffer & operator= (RingBuffer &&other) noexcept(std::allocator_traits< Allocator >::is_always_equal::value)
constexpr RingBuffer & operator= (std::initializer_list< T > ilist)
constexpr void assign (size_type count, const T &value)
template<std::input_iterator InputIterator, std::sentinel_for< InputIterator > Sentinel>
constexpr void assign (InputIterator first, Sentinel last)
constexpr void assign (std::initializer_list< T > ilist)
template<typename R>
constexpr void assign_range (R &&r)
constexpr allocator_type get_allocator () const noexcept
constexpr reference at (size_type pos)
constexpr const_reference at (size_type pos) const
constexpr reference operator[] (size_type pos)
constexpr const_reference operator[] (size_type pos) const
constexpr reference front ()
constexpr const_reference front () const
constexpr reference back ()
constexpr const_reference back () const
constexpr iterator begin () noexcept
constexpr const_iterator begin () const noexcept
constexpr const_iterator cbegin () const noexcept
constexpr iterator end () noexcept
constexpr const_iterator end () const noexcept
constexpr const_iterator cend () const noexcept
constexpr reverse_iterator rbegin () noexcept
constexpr const_reverse_iterator rbegin () const noexcept
constexpr const_reverse_iterator crbegin () const noexcept
constexpr reverse_iterator rend () noexcept
constexpr const_reverse_iterator rend () const noexcept
constexpr const_reverse_iterator crend () const noexcept
constexpr bool empty () const noexcept
constexpr size_type size () const noexcept
constexpr size_type max_size () const noexcept
constexpr void reserve (size_type newCapacity)
constexpr size_type capacity () const noexcept
constexpr void shrink_to_fit ()
constexpr void clear () noexcept
constexpr iterator insert (const_iterator pos, const T &value)
constexpr iterator insert (const_iterator pos, T &&value)
constexpr iterator insert (const_iterator pos, size_type count, const T &value)
template<std::input_iterator InputIterator, std::sentinel_for< InputIterator > Sentinel>
constexpr iterator insert (const_iterator pos, InputIterator first, Sentinel last)
constexpr iterator insert (const_iterator pos, std::initializer_list< T > ilist)
template<typename R>
constexpr iterator insert_range (const_iterator pos, R &&r)
template<typename R>
constexpr void append_range (R &&r)
constexpr iterator insert_unspecified_value (const_iterator pos)
constexpr iterator insert_unspecified_value (const_iterator pos, size_type count)
constexpr iterator erase (const_iterator pos)
constexpr iterator erase (const_iterator first, const_iterator last)
constexpr reference push_back_and_overwrite (auto overwrite)
constexpr reference push_back_unspecified_value ()
constexpr void push_back (const T &value)
constexpr void push_back (T &&value)
constexpr void pop_back ()
constexpr reference push_front_and_overwrite (auto overwrite)
constexpr reference push_front_unspecified_value ()
constexpr void push_front (const T &value)
constexpr void push_front (T &&value)
constexpr void pop_front ()
constexpr void resize (size_type count)
constexpr void resize (size_type count, const T &value)
constexpr void resize_and_overwrite_added_values (size_type count, auto overwrite)
constexpr void swap (RingBuffer &other) noexcept(std::allocator_traits< Allocator >::is_always_equal::value)
constexpr bool operator== (const RingBuffer &other) const
constexpr bool operator< (const RingBuffer &other) const
constexpr bool operator<= (const RingBuffer &other) const
constexpr bool operator> (const RingBuffer &other) const
constexpr bool operator>= (const RingBuffer &other) const

Friends

constexpr void swap (RingBuffer &a, RingBuffer &b) noexcept(noexcept(a.swap(b)))
template<typename U>
constexpr size_type erase (RingBuffer &c, const U &value)
template<typename Predicate>
constexpr size_type erase_if (RingBuffer &c, Predicate predicate)

Member Typedef Documentation

◆ value_type

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::value_type = T

◆ allocator_type

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::allocator_type = Allocator

◆ size_type

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::size_type = std::size_t

◆ difference_type

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::difference_type = std::ptrdiff_t

◆ reference

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::reference = T&

◆ const_reference

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::const_reference = const T&

◆ pointer

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::pointer = typename std::allocator_traits<Allocator>::pointer

◆ const_pointer

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::const_pointer = typename std::allocator_traits<Allocator>::const_pointer

◆ iterator

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::iterator = detail::RingBufferIterator<T>

◆ const_iterator

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::const_iterator = detail::RingBufferIterator<const T>

◆ reverse_iterator

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::reverse_iterator = std::reverse_iterator<iterator>

◆ const_reverse_iterator

template<typename T, typename Allocator = std::allocator<T>>
using grem::RingBuffer< T, Allocator >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Constructor & Destructor Documentation

◆ RingBuffer() [1/10]

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::RingBuffer ( )
constexprdefault

◆ RingBuffer() [2/10]

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::RingBuffer ( const Allocator & allocator)
inlineexplicitconstexprnoexcept

◆ RingBuffer() [3/10]

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::RingBuffer ( size_type count,
const T & value,
const Allocator & allocator = Allocator() )
inlineconstexpr

◆ RingBuffer() [4/10]

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::RingBuffer ( size_type count,
const Allocator & allocator = Allocator() )
inlineexplicitconstexpr

◆ RingBuffer() [5/10]

template<typename T, typename Allocator = std::allocator<T>>
template<std::input_iterator InputIterator, std::sentinel_for< InputIterator > Sentinel>
grem::RingBuffer< T, Allocator >::RingBuffer ( InputIterator first,
Sentinel last,
const Allocator & allocator = Allocator() )
inlineconstexpr

◆ RingBuffer() [6/10]

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::RingBuffer ( const RingBuffer< T, Allocator > & other)
inlineconstexpr

◆ RingBuffer() [7/10]

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::RingBuffer ( const RingBuffer< T, Allocator > & other,
const Allocator & allocator )
inlineconstexpr

◆ RingBuffer() [8/10]

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::RingBuffer ( RingBuffer< T, Allocator > && other)
inlineconstexprnoexcept

◆ RingBuffer() [9/10]

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::RingBuffer ( RingBuffer< T, Allocator > && other,
const Allocator & allocator )
inlineconstexpr

◆ RingBuffer() [10/10]

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::RingBuffer ( std::initializer_list< T > ilist,
const Allocator & allocator = Allocator() )
inlineconstexpr

◆ ~RingBuffer()

template<typename T, typename Allocator = std::allocator<T>>
grem::RingBuffer< T, Allocator >::~RingBuffer ( )
inlineconstexpr

Member Function Documentation

◆ operator=() [1/3]

template<typename T, typename Allocator = std::allocator<T>>
RingBuffer & grem::RingBuffer< T, Allocator >::operator= ( const RingBuffer< T, Allocator > & other)
inlineconstexpr

◆ operator=() [2/3]

template<typename T, typename Allocator = std::allocator<T>>
RingBuffer & grem::RingBuffer< T, Allocator >::operator= ( RingBuffer< T, Allocator > && other)
inlineconstexprnoexcept

◆ operator=() [3/3]

template<typename T, typename Allocator = std::allocator<T>>
RingBuffer & grem::RingBuffer< T, Allocator >::operator= ( std::initializer_list< T > ilist)
inlineconstexpr

◆ assign() [1/3]

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::assign ( size_type count,
const T & value )
inlineconstexpr

◆ assign() [2/3]

template<typename T, typename Allocator = std::allocator<T>>
template<std::input_iterator InputIterator, std::sentinel_for< InputIterator > Sentinel>
void grem::RingBuffer< T, Allocator >::assign ( InputIterator first,
Sentinel last )
inlineconstexpr

◆ assign() [3/3]

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::assign ( std::initializer_list< T > ilist)
inlineconstexpr

◆ assign_range()

template<typename T, typename Allocator = std::allocator<T>>
template<typename R>
void grem::RingBuffer< T, Allocator >::assign_range ( R && r)
inlineconstexpr

◆ get_allocator()

template<typename T, typename Allocator = std::allocator<T>>
allocator_type grem::RingBuffer< T, Allocator >::get_allocator ( ) const
inlinenodiscardconstexprnoexcept

◆ at() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
reference grem::RingBuffer< T, Allocator >::at ( size_type pos)
inlinenodiscardconstexpr

◆ at() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
const_reference grem::RingBuffer< T, Allocator >::at ( size_type pos) const
inlinenodiscardconstexpr

◆ operator[]() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
reference grem::RingBuffer< T, Allocator >::operator[] ( size_type pos)
inlinenodiscardconstexpr

◆ operator[]() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
const_reference grem::RingBuffer< T, Allocator >::operator[] ( size_type pos) const
inlinenodiscardconstexpr

◆ front() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
reference grem::RingBuffer< T, Allocator >::front ( )
inlinenodiscardconstexpr

◆ front() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
const_reference grem::RingBuffer< T, Allocator >::front ( ) const
inlinenodiscardconstexpr

◆ back() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
reference grem::RingBuffer< T, Allocator >::back ( )
inlinenodiscardconstexpr

◆ back() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
const_reference grem::RingBuffer< T, Allocator >::back ( ) const
inlinenodiscardconstexpr

◆ begin() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::begin ( )
inlinenodiscardconstexprnoexcept

◆ begin() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
const_iterator grem::RingBuffer< T, Allocator >::begin ( ) const
inlinenodiscardconstexprnoexcept

◆ cbegin()

template<typename T, typename Allocator = std::allocator<T>>
const_iterator grem::RingBuffer< T, Allocator >::cbegin ( ) const
inlinenodiscardconstexprnoexcept

◆ end() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::end ( )
inlinenodiscardconstexprnoexcept

◆ end() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
const_iterator grem::RingBuffer< T, Allocator >::end ( ) const
inlinenodiscardconstexprnoexcept

◆ cend()

template<typename T, typename Allocator = std::allocator<T>>
const_iterator grem::RingBuffer< T, Allocator >::cend ( ) const
inlinenodiscardconstexprnoexcept

◆ rbegin() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
reverse_iterator grem::RingBuffer< T, Allocator >::rbegin ( )
inlinenodiscardconstexprnoexcept

◆ rbegin() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
const_reverse_iterator grem::RingBuffer< T, Allocator >::rbegin ( ) const
inlinenodiscardconstexprnoexcept

◆ crbegin()

template<typename T, typename Allocator = std::allocator<T>>
const_reverse_iterator grem::RingBuffer< T, Allocator >::crbegin ( ) const
inlinenodiscardconstexprnoexcept

◆ rend() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
reverse_iterator grem::RingBuffer< T, Allocator >::rend ( )
inlinenodiscardconstexprnoexcept

◆ rend() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
const_reverse_iterator grem::RingBuffer< T, Allocator >::rend ( ) const
inlinenodiscardconstexprnoexcept

◆ crend()

template<typename T, typename Allocator = std::allocator<T>>
const_reverse_iterator grem::RingBuffer< T, Allocator >::crend ( ) const
inlinenodiscardconstexprnoexcept

◆ empty()

template<typename T, typename Allocator = std::allocator<T>>
bool grem::RingBuffer< T, Allocator >::empty ( ) const
inlinenodiscardconstexprnoexcept

◆ size()

template<typename T, typename Allocator = std::allocator<T>>
size_type grem::RingBuffer< T, Allocator >::size ( ) const
inlinenodiscardconstexprnoexcept

◆ max_size()

template<typename T, typename Allocator = std::allocator<T>>
size_type grem::RingBuffer< T, Allocator >::max_size ( ) const
inlinenodiscardconstexprnoexcept

◆ reserve()

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::reserve ( size_type newCapacity)
inlineconstexpr

◆ capacity()

template<typename T, typename Allocator = std::allocator<T>>
size_type grem::RingBuffer< T, Allocator >::capacity ( ) const
inlinenodiscardconstexprnoexcept

◆ shrink_to_fit()

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::shrink_to_fit ( )
inlineconstexpr

◆ clear()

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::clear ( )
inlineconstexprnoexcept

◆ insert() [1/5]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::insert ( const_iterator pos,
const T & value )
inlineconstexpr

◆ insert() [2/5]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::insert ( const_iterator pos,
T && value )
inlineconstexpr

◆ insert() [3/5]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::insert ( const_iterator pos,
size_type count,
const T & value )
inlineconstexpr

◆ insert() [4/5]

template<typename T, typename Allocator = std::allocator<T>>
template<std::input_iterator InputIterator, std::sentinel_for< InputIterator > Sentinel>
iterator grem::RingBuffer< T, Allocator >::insert ( const_iterator pos,
InputIterator first,
Sentinel last )
inlineconstexpr

◆ insert() [5/5]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::insert ( const_iterator pos,
std::initializer_list< T > ilist )
inlineconstexpr

◆ insert_range()

template<typename T, typename Allocator = std::allocator<T>>
template<typename R>
iterator grem::RingBuffer< T, Allocator >::insert_range ( const_iterator pos,
R && r )
inlineconstexpr

◆ append_range()

template<typename T, typename Allocator = std::allocator<T>>
template<typename R>
void grem::RingBuffer< T, Allocator >::append_range ( R && r)
inlineconstexpr

◆ insert_unspecified_value() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::insert_unspecified_value ( const_iterator pos)
inlineconstexpr

◆ insert_unspecified_value() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::insert_unspecified_value ( const_iterator pos,
size_type count )
inlineconstexpr

◆ erase() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::erase ( const_iterator pos)
inlineconstexpr

◆ erase() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
iterator grem::RingBuffer< T, Allocator >::erase ( const_iterator first,
const_iterator last )
inlineconstexpr

◆ push_back_and_overwrite()

template<typename T, typename Allocator = std::allocator<T>>
reference grem::RingBuffer< T, Allocator >::push_back_and_overwrite ( auto overwrite)
inlineconstexpr

◆ push_back_unspecified_value()

template<typename T, typename Allocator = std::allocator<T>>
reference grem::RingBuffer< T, Allocator >::push_back_unspecified_value ( )
inlineconstexpr

◆ push_back() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::push_back ( const T & value)
inlineconstexpr

◆ push_back() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::push_back ( T && value)
inlineconstexpr

◆ pop_back()

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::pop_back ( )
inlineconstexpr

◆ push_front_and_overwrite()

template<typename T, typename Allocator = std::allocator<T>>
reference grem::RingBuffer< T, Allocator >::push_front_and_overwrite ( auto overwrite)
inlineconstexpr

◆ push_front_unspecified_value()

template<typename T, typename Allocator = std::allocator<T>>
reference grem::RingBuffer< T, Allocator >::push_front_unspecified_value ( )
inlineconstexpr

◆ push_front() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::push_front ( const T & value)
inlineconstexpr

◆ push_front() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::push_front ( T && value)
inlineconstexpr

◆ pop_front()

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::pop_front ( )
inlineconstexpr

◆ resize() [1/2]

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::resize ( size_type count)
inlineconstexpr

◆ resize() [2/2]

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::resize ( size_type count,
const T & value )
inlineconstexpr

◆ resize_and_overwrite_added_values()

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::resize_and_overwrite_added_values ( size_type count,
auto overwrite )
inlineconstexpr

◆ swap()

template<typename T, typename Allocator = std::allocator<T>>
void grem::RingBuffer< T, Allocator >::swap ( RingBuffer< T, Allocator > & other)
inlineconstexprnoexcept

◆ operator==()

template<typename T, typename Allocator = std::allocator<T>>
bool grem::RingBuffer< T, Allocator >::operator== ( const RingBuffer< T, Allocator > & other) const
inlinenodiscardconstexpr

◆ operator<()

template<typename T, typename Allocator = std::allocator<T>>
bool grem::RingBuffer< T, Allocator >::operator< ( const RingBuffer< T, Allocator > & other) const
inlinenodiscardconstexpr

◆ operator<=()

template<typename T, typename Allocator = std::allocator<T>>
bool grem::RingBuffer< T, Allocator >::operator<= ( const RingBuffer< T, Allocator > & other) const
inlinenodiscardconstexpr

◆ operator>()

template<typename T, typename Allocator = std::allocator<T>>
bool grem::RingBuffer< T, Allocator >::operator> ( const RingBuffer< T, Allocator > & other) const
inlinenodiscardconstexpr

◆ operator>=()

template<typename T, typename Allocator = std::allocator<T>>
bool grem::RingBuffer< T, Allocator >::operator>= ( const RingBuffer< T, Allocator > & other) const
inlinenodiscardconstexpr

◆ swap

template<typename T, typename Allocator = std::allocator<T>>
void swap ( RingBuffer< T, Allocator > & a,
RingBuffer< T, Allocator > & b )
friend

◆ erase

template<typename T, typename Allocator = std::allocator<T>>
template<typename U>
size_type erase ( RingBuffer< T, Allocator > & c,
const U & value )
friend

◆ erase_if

template<typename T, typename Allocator = std::allocator<T>>
template<typename Predicate>
size_type erase_if ( RingBuffer< T, Allocator > & c,
Predicate predicate )
friend

The documentation for this class was generated from the following file: