TwiceAsNice  2019-02-18
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Nice::RingBuffer< T > Class Template Reference

Threadsafe ringbuffer with blocking read. More...

#include <RingBuffer.hh>

Collaboration diagram for Nice::RingBuffer< T >:
Collaboration graph

Public Types

typedef boost::circular_buffer< T > container_type
 
typedef container_type::size_type size_type
 
typedef container_type::value_type value_type
 
typedef boost::circular_buffer< T > container_type
 
typedef container_type::size_type size_type
 
typedef container_type::value_type value_type
 

Public Member Functions

 RingBuffer (size_type _capacity)
 
void pushAndNotify (const value_type &item)
 
value_typepopAndBlock (bool &_overrun=bool())
 
std::vector< T > popAllAndBlock (bool &_overrun=bool())
 
void waitUntilEmpty ()
 
void terminate ()
 
short isTerminated ()
 
bool empty () const
 
bool full () const
 
bool overrun () const
 
size_t left () const
 
 RingBuffer (size_type _capacity)
 
void pushAndNotify (const value_type &item)
 
value_typepopAndBlock (bool &_overrun=bool())
 
std::vector< T > popAllAndBlock (bool &_overrun=bool())
 
void waitUntilEmpty ()
 
void terminate ()
 
short isTerminated ()
 
bool empty () const
 
bool full () const
 
bool overrun () const
 
size_t left () const
 

Private Member Functions

 RingBuffer (const RingBuffer &)
 
RingBufferoperator= (const RingBuffer &)
 
 RingBuffer (const RingBuffer &)
 
RingBufferoperator= (const RingBuffer &)
 

Private Attributes

Nice::Atomic< size_typem_unread
 
bool m_overrun
 
size_type m_capacity
 
container_type m_container
 
Nice::Monitor m_monitor
 
Nice::Atomic< boolm_terminated
 

Detailed Description

template<class T>
class Nice::RingBuffer< T >

Threadsafe ringbuffer with blocking read.

Author
Florian Briegel
Version
11.02.04
Date
2012-08-10 11:04:58 AM

Member Typedef Documentation

◆ container_type [1/2]

template<class T>
typedef boost::circular_buffer<T> Nice::RingBuffer< T >::container_type

◆ container_type [2/2]

template<class T>
typedef boost::circular_buffer<T> Nice::RingBuffer< T >::container_type

◆ size_type [1/2]

template<class T>
typedef container_type::size_type Nice::RingBuffer< T >::size_type

◆ size_type [2/2]

template<class T>
typedef container_type::size_type Nice::RingBuffer< T >::size_type

◆ value_type [1/2]

template<class T>
typedef container_type::value_type Nice::RingBuffer< T >::value_type

◆ value_type [2/2]

template<class T>
typedef container_type::value_type Nice::RingBuffer< T >::value_type

Constructor & Destructor Documentation

◆ RingBuffer() [1/4]

template<class T>
Nice::RingBuffer< T >::RingBuffer ( size_type  _capacity)
inlineexplicit

◆ RingBuffer() [2/4]

template<class T>
Nice::RingBuffer< T >::RingBuffer ( const RingBuffer< T > &  )
private

◆ RingBuffer() [3/4]

template<class T>
Nice::RingBuffer< T >::RingBuffer ( size_type  _capacity)
inlineexplicit

◆ RingBuffer() [4/4]

template<class T>
Nice::RingBuffer< T >::RingBuffer ( const RingBuffer< T > &  )
private

Member Function Documentation

◆ empty() [1/2]

template<class T>
bool Nice::RingBuffer< T >::empty ( void  ) const
inline

◆ empty() [2/2]

template<class T>
bool Nice::RingBuffer< T >::empty ( void  ) const
inline

◆ full() [1/2]

template<class T>
bool Nice::RingBuffer< T >::full ( ) const
inline

◆ full() [2/2]

template<class T>
bool Nice::RingBuffer< T >::full ( ) const
inline

◆ isTerminated() [1/2]

template<class T>
short Nice::RingBuffer< T >::isTerminated ( )
inline

◆ isTerminated() [2/2]

template<class T>
short Nice::RingBuffer< T >::isTerminated ( )
inline

◆ left() [1/2]

template<class T>
size_t Nice::RingBuffer< T >::left ( ) const
inline

◆ left() [2/2]

template<class T>
size_t Nice::RingBuffer< T >::left ( ) const
inline

◆ operator=() [1/2]

template<class T>
RingBuffer& Nice::RingBuffer< T >::operator= ( const RingBuffer< T > &  )
private

◆ operator=() [2/2]

template<class T>
RingBuffer& Nice::RingBuffer< T >::operator= ( const RingBuffer< T > &  )
private

◆ overrun() [1/2]

template<class T>
bool Nice::RingBuffer< T >::overrun ( ) const
inline

◆ overrun() [2/2]

template<class T>
bool Nice::RingBuffer< T >::overrun ( ) const
inline

◆ popAllAndBlock() [1/2]

template<class T>
std::vector<T> Nice::RingBuffer< T >::popAllAndBlock ( bool _overrun = bool())
inline

◆ popAllAndBlock() [2/2]

template<class T>
std::vector<T> Nice::RingBuffer< T >::popAllAndBlock ( bool _overrun = bool())
inline

◆ popAndBlock() [1/2]

template<class T>
value_type& Nice::RingBuffer< T >::popAndBlock ( bool _overrun = bool())
inline

◆ popAndBlock() [2/2]

template<class T>
value_type& Nice::RingBuffer< T >::popAndBlock ( bool _overrun = bool())
inline

◆ pushAndNotify() [1/2]

template<class T>
void Nice::RingBuffer< T >::pushAndNotify ( const value_type item)
inline

◆ pushAndNotify() [2/2]

template<class T>
void Nice::RingBuffer< T >::pushAndNotify ( const value_type item)
inline

◆ terminate() [1/2]

template<class T>
void Nice::RingBuffer< T >::terminate ( )
inline

◆ terminate() [2/2]

template<class T>
void Nice::RingBuffer< T >::terminate ( )
inline

◆ waitUntilEmpty() [1/2]

template<class T>
void Nice::RingBuffer< T >::waitUntilEmpty ( )
inline

◆ waitUntilEmpty() [2/2]

template<class T>
void Nice::RingBuffer< T >::waitUntilEmpty ( )
inline

Member Data Documentation

◆ m_capacity

template<class T>
size_type Nice::RingBuffer< T >::m_capacity
private

◆ m_container

template<class T>
container_type Nice::RingBuffer< T >::m_container
private

◆ m_monitor

template<class T>
Nice::Monitor Nice::RingBuffer< T >::m_monitor
private

◆ m_overrun

template<class T>
bool Nice::RingBuffer< T >::m_overrun
private

◆ m_terminated

template<class T>
Nice::Atomic< bool > Nice::RingBuffer< T >::m_terminated
private

◆ m_unread

template<class T>
Nice::Atomic< size_type > Nice::RingBuffer< T >::m_unread
private

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