MatLogger2  1.0.0
Library for logging of numeric data to HDF5 MAT-files, which is RT-safe and multithreaded.
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
boost::lockfree::detail::ringbuffer_base< T > Class Template Reference

#include <spsc_queue_logger.hpp>

+ Inheritance diagram for boost::lockfree::detail::ringbuffer_base< T >:
+ Collaboration diagram for boost::lockfree::detail::ringbuffer_base< T >:

Public Member Functions

void reset (void)
 reset the ringbuffer More...
 
bool empty (void)
 Check if the ringbuffer is empty. More...
 
bool is_lock_free (void) const
 

Protected Types

typedef std::size_t size_t
 

Protected Member Functions

 ringbuffer_base (void)
 
size_t read_available (size_t max_size) const
 
size_t write_available (size_t max_size) const
 
bool push (T const &t, T *buffer, size_t max_size)
 
size_t push (const T *input_buffer, size_t input_count, T *internal_buffer, size_t max_size)
 
template<typename ConstIterator >
ConstIterator push (ConstIterator begin, ConstIterator end, T *internal_buffer, size_t max_size)
 
template<typename Functor >
bool consume_one (Functor &functor, T *buffer, size_t max_size)
 
template<typename Functor >
bool consume_one (Functor const &functor, T *buffer, size_t max_size)
 
template<typename Functor >
size_t consume_all (Functor const &functor, T *internal_buffer, size_t max_size)
 
template<typename Functor >
size_t consume_all (Functor &functor, T *internal_buffer, size_t max_size)
 
size_t pop (T *output_buffer, size_t output_count, T *internal_buffer, size_t max_size)
 
template<typename OutputIterator >
size_t pop_to_output_iterator (OutputIterator it, T *internal_buffer, size_t max_size)
 
const T & front (const T *internal_buffer) const
 
T & front (T *internal_buffer)
 

Static Protected Member Functions

static size_t next_index (size_t arg, size_t max_size)
 
static size_t read_available (size_t write_index, size_t read_index, size_t max_size)
 
static size_t write_available (size_t write_index, size_t read_index, size_t max_size)
 

Protected Attributes

atomic< size_twrite_index_
 
char padding1 [padding_size]
 
atomic< size_tread_index_
 

Static Protected Attributes

static const int padding_size = BOOST_LOCKFREE_CACHELINE_BYTES - sizeof(size_t)
 

Detailed Description

template<typename T>
class boost::lockfree::detail::ringbuffer_base< T >

Definition at line 52 of file spsc_queue_logger.hpp.

Member Typedef Documentation

template<typename T >
typedef std::size_t boost::lockfree::detail::ringbuffer_base< T >::size_t
protected

Definition at line 56 of file spsc_queue_logger.hpp.

Constructor & Destructor Documentation

template<typename T >
boost::lockfree::detail::ringbuffer_base< T >::ringbuffer_base ( void  )
inlineprotected

Definition at line 66 of file spsc_queue_logger.hpp.

Member Function Documentation

template<typename T >
template<typename Functor >
size_t boost::lockfree::detail::ringbuffer_base< T >::consume_all ( Functor const &  functor,
T *  internal_buffer,
size_t  max_size 
)
inlineprotected

Definition at line 204 of file spsc_queue_logger.hpp.

template<typename T >
template<typename Functor >
size_t boost::lockfree::detail::ringbuffer_base< T >::consume_all ( Functor &  functor,
T *  internal_buffer,
size_t  max_size 
)
inlineprotected

Definition at line 239 of file spsc_queue_logger.hpp.

template<typename T >
template<typename Functor >
bool boost::lockfree::detail::ringbuffer_base< T >::consume_one ( Functor &  functor,
T *  buffer,
size_t  max_size 
)
inlineprotected

Definition at line 170 of file spsc_queue_logger.hpp.

template<typename T >
template<typename Functor >
bool boost::lockfree::detail::ringbuffer_base< T >::consume_one ( Functor const &  functor,
T *  buffer,
size_t  max_size 
)
inlineprotected

Definition at line 187 of file spsc_queue_logger.hpp.

template<typename T >
bool boost::lockfree::detail::ringbuffer_base< T >::empty ( void  )
inline

Check if the ringbuffer is empty.

Returns
true, if the ringbuffer is empty, false otherwise
Note
Due to the concurrent nature of the ringbuffer the result may be inaccurate.

Definition at line 375 of file spsc_queue_logger.hpp.

template<typename T >
const T& boost::lockfree::detail::ringbuffer_base< T >::front ( const T *  internal_buffer) const
inlineprotected

Definition at line 337 of file spsc_queue_logger.hpp.

template<typename T >
T& boost::lockfree::detail::ringbuffer_base< T >::front ( T *  internal_buffer)
inlineprotected

Definition at line 343 of file spsc_queue_logger.hpp.

template<typename T >
bool boost::lockfree::detail::ringbuffer_base< T >::is_lock_free ( void  ) const
inline
Returns
true, if implementation is lock-free.

Definition at line 384 of file spsc_queue_logger.hpp.

template<typename T >
static size_t boost::lockfree::detail::ringbuffer_base< T >::next_index ( size_t  arg,
size_t  max_size 
)
inlinestaticprotected

Definition at line 70 of file spsc_queue_logger.hpp.

template<typename T >
size_t boost::lockfree::detail::ringbuffer_base< T >::pop ( T *  output_buffer,
size_t  output_count,
T *  internal_buffer,
size_t  max_size 
)
inlineprotected

Definition at line 273 of file spsc_queue_logger.hpp.

template<typename T >
template<typename OutputIterator >
size_t boost::lockfree::detail::ringbuffer_base< T >::pop_to_output_iterator ( OutputIterator  it,
T *  internal_buffer,
size_t  max_size 
)
inlineprotected

Definition at line 307 of file spsc_queue_logger.hpp.

template<typename T >
bool boost::lockfree::detail::ringbuffer_base< T >::push ( T const &  t,
T *  buffer,
size_t  max_size 
)
inlineprotected

Definition at line 109 of file spsc_queue_logger.hpp.

template<typename T >
size_t boost::lockfree::detail::ringbuffer_base< T >::push ( const T *  input_buffer,
size_t  input_count,
T *  internal_buffer,
size_t  max_size 
)
inlineprotected

Definition at line 126 of file spsc_queue_logger.hpp.

template<typename T >
template<typename ConstIterator >
ConstIterator boost::lockfree::detail::ringbuffer_base< T >::push ( ConstIterator  begin,
ConstIterator  end,
T *  internal_buffer,
size_t  max_size 
)
inlineprotected

Definition at line 132 of file spsc_queue_logger.hpp.

template<typename T >
static size_t boost::lockfree::detail::ringbuffer_base< T >::read_available ( size_t  write_index,
size_t  read_index,
size_t  max_size 
)
inlinestaticprotected

Definition at line 78 of file spsc_queue_logger.hpp.

template<typename T >
size_t boost::lockfree::detail::ringbuffer_base< T >::read_available ( size_t  max_size) const
inlineprotected

Definition at line 95 of file spsc_queue_logger.hpp.

template<typename T >
void boost::lockfree::detail::ringbuffer_base< T >::reset ( void  )
inline

reset the ringbuffer

Note
Not thread-safe

Definition at line 356 of file spsc_queue_logger.hpp.

template<typename T >
static size_t boost::lockfree::detail::ringbuffer_base< T >::write_available ( size_t  write_index,
size_t  read_index,
size_t  max_size 
)
inlinestaticprotected

Definition at line 87 of file spsc_queue_logger.hpp.

template<typename T >
size_t boost::lockfree::detail::ringbuffer_base< T >::write_available ( size_t  max_size) const
inlineprotected

Definition at line 102 of file spsc_queue_logger.hpp.

Member Data Documentation

template<typename T >
char boost::lockfree::detail::ringbuffer_base< T >::padding1[padding_size]
protected

Definition at line 59 of file spsc_queue_logger.hpp.

template<typename T >
const int boost::lockfree::detail::ringbuffer_base< T >::padding_size = BOOST_LOCKFREE_CACHELINE_BYTES - sizeof(size_t)
staticprotected

Definition at line 57 of file spsc_queue_logger.hpp.

template<typename T >
atomic<size_t> boost::lockfree::detail::ringbuffer_base< T >::read_index_
protected

Definition at line 60 of file spsc_queue_logger.hpp.

template<typename T >
atomic<size_t> boost::lockfree::detail::ringbuffer_base< T >::write_index_
protected

Definition at line 58 of file spsc_queue_logger.hpp.


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