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 ()
 
 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
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
T & operator[] (size_t i)
 
const T & operator[] (size_t i) const
 
T & front ()
 
const T & front () const
 
T & back ()
 
const T & 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)
 
void push_back (const T &t)
 
void push_back (T &&t)
 
void push_front (const T &t)
 
void push_front (T &&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 100 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 104 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 106 of file circular_buffer.hh.

◆ difference_type

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

Definition at line 110 of file circular_buffer.hh.

◆ iterator

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

Definition at line 103 of file circular_buffer.hh.

◆ pointer

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

Definition at line 108 of file circular_buffer.hh.

◆ reference

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

Definition at line 109 of file circular_buffer.hh.

◆ reverse_iterator

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

Definition at line 105 of file circular_buffer.hh.

◆ size_type

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

Definition at line 111 of file circular_buffer.hh.

◆ value_type

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

Definition at line 107 of file circular_buffer.hh.

Constructor & Destructor Documentation

◆ circular_buffer() [1/4]

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

Definition at line 113 of file circular_buffer.hh.

◆ circular_buffer() [2/4]

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

Definition at line 117 of file circular_buffer.hh.

◆ circular_buffer() [3/4]

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

Definition at line 125 of file circular_buffer.hh.

◆ circular_buffer() [4/4]

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

Definition at line 140 of file circular_buffer.hh.

◆ ~circular_buffer()

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

Definition at line 147 of file circular_buffer.hh.

Member Function Documentation

◆ back() [1/2]

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

Definition at line 197 of file circular_buffer.hh.

◆ back() [2/2]

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

Definition at line 198 of file circular_buffer.hh.

◆ begin() [1/2]

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

◆ begin() [2/2]

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

Definition at line 182 of file circular_buffer.hh.

◆ 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 242 of file circular_buffer.hh.

◆ empty()

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

Definition at line 201 of file circular_buffer.hh.

◆ end() [1/2]

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

◆ end() [2/2]

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

Definition at line 186 of file circular_buffer.hh.

◆ front() [1/2]

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

Definition at line 195 of file circular_buffer.hh.

◆ front() [2/2]

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

Definition at line 196 of file circular_buffer.hh.

◆ full()

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

Definition at line 202 of file circular_buffer.hh.

◆ operator=() [1/2]

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

Definition at line 151 of file circular_buffer.hh.

◆ operator=() [2/2]

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

Definition at line 165 of file circular_buffer.hh.

◆ operator[]() [1/2]

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

Definition at line 192 of file circular_buffer.hh.

◆ operator[]() [2/2]

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

Definition at line 193 of file circular_buffer.hh.

◆ pop_back()

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

Definition at line 230 of file circular_buffer.hh.

◆ pop_front()

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

Definition at line 236 of file circular_buffer.hh.

◆ push_back() [1/3]

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

Definition at line 221 of file circular_buffer.hh.

◆ push_back() [2/3]

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

Definition at line 222 of file circular_buffer.hh.

◆ push_back() [3/3]

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

Definition at line 226 of file circular_buffer.hh.

◆ push_front() [1/2]

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

Definition at line 223 of file circular_buffer.hh.

◆ push_front() [2/2]

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

Definition at line 224 of file circular_buffer.hh.

◆ rbegin() [1/2]

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

Definition at line 187 of file circular_buffer.hh.

◆ rbegin() [2/2]

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

Definition at line 188 of file circular_buffer.hh.

◆ rend() [1/2]

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

Definition at line 189 of file circular_buffer.hh.

◆ rend() [2/2]

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

Definition at line 190 of file circular_buffer.hh.

◆ reserve()

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

Definition at line 203 of file circular_buffer.hh.

◆ 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

Definition at line 200 of file circular_buffer.hh.

◆ swap()

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

Friends And Related Function Documentation

◆ cb_iterator

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

Definition at line 342 of file circular_buffer.hh.


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