Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc > Class Template Reference

#include <spsc_queue.hpp>

Inheritance diagram for boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >:
Collaboration diagram for boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >:

Public Member Functions

 runtime_sized_ringbuffer (size_type max_elements)
 
template<typename U >
 runtime_sized_ringbuffer (typename Alloc::template rebind< U >::other const &alloc, size_type max_elements)
 
 runtime_sized_ringbuffer (Alloc const &alloc, size_type max_elements)
 
 ~runtime_sized_ringbuffer (void)
 
bool push (T const &t)
 
template<typename Functor >
bool consume_one (Functor &f)
 
template<typename Functor >
bool consume_one (Functor const &f)
 
template<typename Functor >
size_type consume_all (Functor &f)
 
template<typename Functor >
size_type consume_all (Functor const &f)
 
size_type push (T const *t, size_type size)
 
template<size_type size>
size_type push (T const (&t)[size])
 
template<typename ConstIterator >
ConstIterator push (ConstIterator begin, ConstIterator end)
 
size_type pop (T *ret, size_type size)
 
template<typename OutputIterator >
size_type pop_to_output_iterator (OutputIterator it)
 
const Tfront (void) const
 
Tfront (void)
 
void reset (void)
 reset the ringbuffer More...
 
bool empty (void)
 Check if the ringbuffer is empty. More...
 
bool is_lock_free (void) const
 

Protected Member Functions

size_type max_number_of_elements () const
 
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 Tfront (const T *internal_buffer) const
 
Tfront (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)
 

Constructor & Destructor Documentation

template<typename T , typename Alloc >
boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::runtime_sized_ringbuffer ( size_type  max_elements)
inlineexplicit
template<typename T , typename Alloc >
template<typename U >
boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::runtime_sized_ringbuffer ( typename Alloc::template rebind< U >::other const &  alloc,
size_type  max_elements 
)
inline
template<typename T , typename Alloc >
boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::runtime_sized_ringbuffer ( Alloc const &  alloc,
size_type  max_elements 
)
inline

Member Function Documentation

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 
)
inlineprotectedinherited
template<typename T , typename Alloc >
template<typename Functor >
size_type boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::consume_all ( Functor &  f)
inline
template<typename T , typename Alloc >
template<typename Functor >
size_type boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::consume_all ( Functor const &  f)
inline
template<typename T >
template<typename Functor >
bool boost::lockfree::detail::ringbuffer_base< T >::consume_one ( Functor const &  functor,
T buffer,
size_t  max_size 
)
inlineprotectedinherited
template<typename T , typename Alloc >
template<typename Functor >
bool boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::consume_one ( Functor &  f)
inline
template<typename T , typename Alloc >
template<typename Functor >
bool boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::consume_one ( Functor const &  f)
inline
template<typename T >
bool boost::lockfree::detail::ringbuffer_base< T >::empty ( void  )
inlineinherited

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.

References boost::memory_order_relaxed.

Referenced by boost::lockfree::detail::ringbuffer_base< T >::consume_one().

template<typename T >
T& boost::lockfree::detail::ringbuffer_base< T >::front ( T internal_buffer)
inlineprotectedinherited
template<typename T , typename Alloc >
const T& boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::front ( void  ) const
inline
template<typename T , typename Alloc >
T& boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::front ( void  )
inline
template<typename T >
bool boost::lockfree::detail::ringbuffer_base< T >::is_lock_free ( void  ) const
inlineinherited
Returns
true, if implementation is lock-free.
template<typename T , typename Alloc >
size_type boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::max_number_of_elements ( ) const
inlineprotected
template<typename T >
static size_t boost::lockfree::detail::ringbuffer_base< T >::next_index ( size_t  arg,
size_t  max_size 
)
inlinestaticprotectedinherited
template<typename T , typename Alloc >
size_type boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::pop ( T ret,
size_type  size 
)
inline
template<typename T , typename Alloc >
template<typename OutputIterator >
size_type boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::pop_to_output_iterator ( OutputIterator  it)
inline
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 
)
inlineprotectedinherited
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 
)
inlineprotectedinherited
template<typename T , typename Alloc >
size_type boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::push ( T const *  t,
size_type  size 
)
inline
template<typename T , typename Alloc >
template<size_type size>
size_type boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::push ( T const (&)  t[size])
inline
template<typename T , typename Alloc >
template<typename ConstIterator >
ConstIterator boost::lockfree::detail::runtime_sized_ringbuffer< T, Alloc >::push ( ConstIterator  begin,
ConstIterator  end 
)
inline
template<typename T >
size_t boost::lockfree::detail::ringbuffer_base< T >::read_available ( size_t  max_size) const
inlineprotectedinherited
template<typename T >
void boost::lockfree::detail::ringbuffer_base< T >::reset ( void  )
inlineinherited
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 
)
inlinestaticprotectedinherited
template<typename T >
size_t boost::lockfree::detail::ringbuffer_base< T >::write_available ( size_t  max_size) const
inlineprotectedinherited

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