openMSX
Public Types | Public Member Functions | Friends | List of all members
circular_buffer< T > Class Template Reference

Circular buffer class, based on boost::circular_buffer/. More...

#include <circular_buffer.hh>

Inheritance diagram for circular_buffer< T >:
Inheritance graph
[legend]

Public Types

using iterator = cb_iterator< circular_buffer< T >, T >
 
using const_iterator = cb_iterator< circular_buffer< T >, const T >
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using value_type = T
 
using pointer = T *
 
using reference = T &
 
using difference_type = ptrdiff_t
 
using size_type = size_t
 

Public Member Functions

 circular_buffer ()=default
 
 circular_buffer (size_t buffer_capacity)
 
 circular_buffer (const circular_buffer &cb)
 
 circular_buffer (circular_buffer &&cb) noexcept
 
 ~circular_buffer ()
 
circular_bufferoperator= (const circular_buffer &cb)
 
circular_bufferoperator= (circular_buffer &&cb) noexcept
 
void swap (circular_buffer &cb) noexcept
 
auto begin ()
 
auto begin () const
 
auto end ()
 
auto end () const
 
auto rbegin ()
 
auto rbegin () const
 
auto rend ()
 
auto rend () const
 
auto & operator[] (size_t i)
 
auto & operator[] (size_t i) const
 
auto & front ()
 
auto & front () const
 
auto & back ()
 
auto & back () const
 
size_t size () const
 
bool empty () const
 
bool full () const
 
size_t reserve () const
 
size_t capacity () const
 
void set_capacity (size_t new_capacity)
 
template<typename T2 >
void push_back (T2 &&t)
 
template<typename T2 >
void push_front (T2 &&t)
 
void push_back (std::initializer_list< T > list)
 
void pop_back ()
 
void pop_front ()
 
void clear ()
 

Friends

template<typename BUF , typename T2 >
class cb_iterator
 

Detailed Description

template<typename T>
class circular_buffer< T >

Circular buffer class, based on boost::circular_buffer/.

Definition at line 92 of file circular_buffer.hh.

Member Typedef Documentation

◆ const_iterator

template<typename T >
using circular_buffer< T >::const_iterator = cb_iterator<circular_buffer<T>, const T>

Definition at line 96 of file circular_buffer.hh.

◆ const_reverse_iterator

template<typename T >
using circular_buffer< T >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 98 of file circular_buffer.hh.

◆ difference_type

template<typename T >
using circular_buffer< T >::difference_type = ptrdiff_t

Definition at line 102 of file circular_buffer.hh.

◆ iterator

template<typename T >
using circular_buffer< T >::iterator = cb_iterator<circular_buffer<T>, T>

Definition at line 95 of file circular_buffer.hh.

◆ pointer

template<typename T >
using circular_buffer< T >::pointer = T*

Definition at line 100 of file circular_buffer.hh.

◆ reference

template<typename T >
using circular_buffer< T >::reference = T&

Definition at line 101 of file circular_buffer.hh.

◆ reverse_iterator

template<typename T >
using circular_buffer< T >::reverse_iterator = std::reverse_iterator< iterator>

Definition at line 97 of file circular_buffer.hh.

◆ size_type

template<typename T >
using circular_buffer< T >::size_type = size_t

Definition at line 103 of file circular_buffer.hh.

◆ value_type

template<typename T >
using circular_buffer< T >::value_type = T

Definition at line 99 of file circular_buffer.hh.

Constructor & Destructor Documentation

◆ circular_buffer() [1/4]

template<typename T >
circular_buffer< T >::circular_buffer ( )
default

◆ circular_buffer() [2/4]

template<typename T >
circular_buffer< T >::circular_buffer ( size_t  buffer_capacity)
inlineexplicit

Definition at line 108 of file circular_buffer.hh.

◆ circular_buffer() [3/4]

template<typename T >
circular_buffer< T >::circular_buffer ( const circular_buffer< T > &  cb)
inline

◆ circular_buffer() [4/4]

template<typename T >
circular_buffer< T >::circular_buffer ( circular_buffer< T > &&  cb)
inlinenoexcept

Definition at line 130 of file circular_buffer.hh.

◆ ~circular_buffer()

template<typename T >
circular_buffer< T >::~circular_buffer ( )
inline

Definition at line 135 of file circular_buffer.hh.

Member Function Documentation

◆ back() [1/2]

template<typename T >
auto & circular_buffer< T >::back ( )
inline

Definition at line 185 of file circular_buffer.hh.

◆ back() [2/2]

template<typename T >
auto & circular_buffer< T >::back ( ) const
inline

Definition at line 186 of file circular_buffer.hh.

◆ begin() [1/2]

template<typename T >
auto circular_buffer< T >::begin ( )
inline

◆ begin() [2/2]

template<typename T >
auto circular_buffer< T >::begin ( ) const
inline

Definition at line 170 of file circular_buffer.hh.

References circular_buffer< T >::empty().

◆ capacity()

template<typename T >
size_t circular_buffer< T >::capacity ( ) const
inline

◆ clear()

template<typename T >
void circular_buffer< T >::clear ( )
inline

Definition at line 244 of file circular_buffer.hh.

References circular_buffer< T >::size().

Referenced by TEST_CASE(), and TEST_CASE().

◆ empty()

template<typename T >
bool circular_buffer< T >::empty ( ) const
inline

◆ end() [1/2]

template<typename T >
auto circular_buffer< T >::end ( )
inline

◆ end() [2/2]

template<typename T >
auto circular_buffer< T >::end ( ) const
inline

Definition at line 174 of file circular_buffer.hh.

◆ front() [1/2]

template<typename T >
auto & circular_buffer< T >::front ( )
inline

Definition at line 183 of file circular_buffer.hh.

◆ front() [2/2]

template<typename T >
auto & circular_buffer< T >::front ( ) const
inline

Definition at line 184 of file circular_buffer.hh.

◆ full()

template<typename T >
bool circular_buffer< T >::full ( ) const
inline

◆ operator=() [1/2]

template<typename T >
circular_buffer & circular_buffer< T >::operator= ( circular_buffer< T > &&  cb)
inlinenoexcept

◆ operator=() [2/2]

template<typename T >
circular_buffer & circular_buffer< T >::operator= ( const circular_buffer< T > &  cb)
inline

◆ operator[]() [1/2]

template<typename T >
auto & circular_buffer< T >::operator[] ( size_t  i)
inline

Definition at line 180 of file circular_buffer.hh.

◆ operator[]() [2/2]

template<typename T >
auto & circular_buffer< T >::operator[] ( size_t  i) const
inline

Definition at line 181 of file circular_buffer.hh.

◆ pop_back()

template<typename T >
void circular_buffer< T >::pop_back ( )
inline

Definition at line 232 of file circular_buffer.hh.

Referenced by TEST_CASE(), and TEST_CASE().

◆ pop_front()

template<typename T >
void circular_buffer< T >::pop_front ( )
inline

Definition at line 238 of file circular_buffer.hh.

Referenced by TEST_CASE(), and TEST_CASE().

◆ push_back() [1/2]

template<typename T >
void circular_buffer< T >::push_back ( std::initializer_list< T >  list)
inline

Definition at line 228 of file circular_buffer.hh.

References circular_buffer< T >::push_back().

◆ push_back() [2/2]

template<typename T >
template<typename T2 >
void circular_buffer< T >::push_back ( T2 &&  t)
inline

Definition at line 210 of file circular_buffer.hh.

References t.

Referenced by circular_buffer< T >::push_back(), TEST_CASE(), and TEST_CASE().

◆ push_front()

template<typename T >
template<typename T2 >
void circular_buffer< T >::push_front ( T2 &&  t)
inline

Definition at line 217 of file circular_buffer.hh.

References t.

Referenced by TEST_CASE(), and TEST_CASE().

◆ rbegin() [1/2]

template<typename T >
auto circular_buffer< T >::rbegin ( )
inline

Definition at line 175 of file circular_buffer.hh.

References circular_buffer< T >::end().

◆ rbegin() [2/2]

template<typename T >
auto circular_buffer< T >::rbegin ( ) const
inline

Definition at line 176 of file circular_buffer.hh.

References circular_buffer< T >::end().

◆ rend() [1/2]

template<typename T >
auto circular_buffer< T >::rend ( )
inline

Definition at line 177 of file circular_buffer.hh.

References circular_buffer< T >::begin().

◆ rend() [2/2]

template<typename T >
auto circular_buffer< T >::rend ( ) const
inline

Definition at line 178 of file circular_buffer.hh.

References circular_buffer< T >::begin().

◆ reserve()

template<typename T >
size_t circular_buffer< T >::reserve ( ) const
inline

◆ set_capacity()

template<typename T >
void circular_buffer< T >::set_capacity ( size_t  new_capacity)
inline

◆ size()

template<typename T >
size_t circular_buffer< T >::size ( ) const
inline

◆ swap()

template<typename T >
void circular_buffer< T >::swap ( circular_buffer< T > &  cb)
inlinenoexcept

Definition at line 159 of file circular_buffer.hh.

Referenced by circular_buffer< T >::operator=().

Friends And Related Symbol Documentation

◆ cb_iterator

template<typename T >
template<typename BUF , typename T2 >
friend class cb_iterator
friend

Definition at line 327 of file circular_buffer.hh.


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