The spsc_queue class provides a single-writer/single-reader fifo queue, pushing and popping is wait-free. More...
#include <spsc_queue.hpp>


Public Types | |
| typedef T | value_type |
| typedef implementation_defined::allocator | allocator |
| typedef implementation_defined::size_type | size_type |
| typedef T | type |
Public Member Functions | |
| bool | push (T const &t) |
| Pushes object t to the ringbuffer. More... | |
| bool | pop () |
| Pops one object from ringbuffer. More... | |
| template<typename U > | |
| boost::enable_if< typename is_convertible< T, U >::type, bool >::type | pop (U &ret) |
| Pops one object from ringbuffer. More... | |
| size_type | push (T const *t, size_type size) |
| Pushes as many objects from the array t as there is space. More... | |
| template<size_type size> | |
| size_type | push (T const (&t)[size]) |
| Pushes as many objects from the array t as there is space available. More... | |
| template<typename ConstIterator > | |
| ConstIterator | push (ConstIterator begin, ConstIterator end) |
| Pushes as many objects from the range [begin, end) as there is space . More... | |
| size_type | pop (T *ret, size_type size) |
| Pops a maximum of size objects from ringbuffer. More... | |
| template<size_type size> | |
| size_type | pop (T(&ret)[size]) |
| Pops a maximum of size objects from spsc_queue. More... | |
| template<typename OutputIterator > | |
| boost::disable_if< typename is_convertible< T, OutputIterator >::type, size_type >::type | pop (OutputIterator it) |
| Pops objects to the output iterator it. More... | |
| template<typename Functor > | |
| bool | consume_one (Functor &f) |
| consumes one element via a functor More... | |
| template<typename Functor > | |
| bool | consume_one (Functor const &f) |
| consumes one element via a functor More... | |
| template<typename Functor > | |
| size_type | consume_all (Functor &f) |
| consumes all elements via a functor More... | |
| template<typename Functor > | |
| size_type | consume_all (Functor const &f) |
| consumes all elements via a functor More... | |
| size_type | read_available () const |
| get number of elements that are available for read More... | |
| size_type | write_available () const |
| get write space to write elements More... | |
| const T & | front () const |
| get reference to element in the front of the queue More... | |
| T & | front () |
| get reference to element in the front of the queue More... | |
| spsc_queue (void) | |
| Constructs a spsc_queue. More... | |
| template<typename U > | |
| spsc_queue (typename allocator::template rebind< U >::other const &alloc) | |
| Constructs a spsc_queue. More... | |
| spsc_queue (allocator const &alloc) | |
| Constructs a spsc_queue. More... | |
| spsc_queue (size_type element_count) | |
| Constructs a spsc_queue for element_count elements. More... | |
| template<typename U > | |
| spsc_queue (size_type element_count, typename allocator::template rebind< U >::other const &alloc) | |
| Constructs a spsc_queue for element_count elements. More... | |
| spsc_queue (size_type element_count, allocator_arg const &alloc) | |
| Constructs a spsc_queue for element_count elements. More... | |
The spsc_queue class provides a single-writer/single-reader fifo queue, pushing and popping is wait-free.
Policies:
boost::lockfree::capacity<>, optional boost::lockfree::allocator<>, defaults to boost::lockfree::allocator<std::allocator<T>> Requirements:
| typedef implementation_defined::allocator boost::lockfree::spsc_queue< T, A0, A1 >::allocator |
| typedef implementation_defined::size_type boost::lockfree::spsc_queue< T, A0, A1 >::size_type |
|
inherited |
| typedef T boost::lockfree::spsc_queue< T, A0, A1 >::value_type |
|
inline |
Constructs a spsc_queue.
References BOOST_ASSERT.
|
inlineexplicit |
Constructs a spsc_queue.
References boost::BOOST_STATIC_ASSERT().
|
inlineexplicit |
Constructs a spsc_queue.
References BOOST_ASSERT.
|
inlineexplicit |
Constructs a spsc_queue for element_count elements.
References BOOST_ASSERT.
|
inline |
Constructs a spsc_queue for element_count elements.
References boost::BOOST_STATIC_ASSERT().
|
inline |
Constructs a spsc_queue for element_count elements.
References BOOST_ASSERT.
|
inline |
consumes all elements via a functor
sequentially pops all elements from the queue and applies the functor on each object
|
inline |
consumes all elements via a functor
sequentially pops all elements from the queue and applies the functor on each object
|
inline |
consumes one element via a functor
pops one element from the queue and applies the functor on this object
Referenced by boost::lockfree::spsc_queue< T, A0, A1 >::pop().
|
inline |
consumes one element via a functor
pops one element from the queue and applies the functor on this object
|
inline |
get reference to element in the front of the queue
Availability of front element can be checked using read_available().
References BOOST_ASSERT, boost::xpressive::front, and boost::lockfree::spsc_queue< T, A0, A1 >::read_available().
|
inline |
get reference to element in the front of the queue
Availability of front element can be checked using read_available().
References BOOST_ASSERT, boost::xpressive::front, and boost::lockfree::spsc_queue< T, A0, A1 >::read_available().
|
inline |
Pops one object from ringbuffer.
References boost::lockfree::spsc_queue< T, A0, A1 >::consume_one().
Referenced by boost::lockfree::spsc_queue< T, A0, A1 >::pop().
|
inline |
Pops one object from ringbuffer.
References boost::lockfree::spsc_queue< T, A0, A1 >::consume_one().
|
inline |
Pops a maximum of size objects from ringbuffer.
References boost::xpressive::pop.
|
inline |
Pops a maximum of size objects from spsc_queue.
References boost::lockfree::spsc_queue< T, A0, A1 >::pop().
|
inline |
Pops objects to the output iterator it.
|
inline |
Pushes object t to the ringbuffer.
References boost::xpressive::push.
Referenced by boost::lockfree::spsc_queue< T, A0, A1 >::push().
|
inline |
Pushes as many objects from the array t as there is space.
References boost::xpressive::push.
|
inline |
Pushes as many objects from the array t as there is space available.
References boost::lockfree::spsc_queue< T, A0, A1 >::push(), and boost::flyweights::t.
|
inline |
Pushes as many objects from the range [begin, end) as there is space .
References boost::xpressive::push.
|
inline |
get number of elements that are available for read
Referenced by boost::lockfree::spsc_queue< T, A0, A1 >::front().
|
inline |
get write space to write elements