The queue class provides a multi-writer/multi-reader queue, pushing and popping is lock-free, construction/destruction has to be synchronized. More...
#include <queue.hpp>
Public Types | |
typedef T | value_type |
typedef implementation_defined::allocator | allocator |
typedef implementation_defined::size_type | size_type |
Public Member Functions | |
bool | is_lock_free (void) const |
void | reserve (size_type n) |
Allocate n nodes for freelist. More... | |
void | reserve_unsafe (size_type n) |
Allocate n nodes for freelist. More... | |
~queue (void) | |
Destroys queue, free all nodes from freelist. More... | |
bool | empty (void) const |
Check if the queue is empty. More... | |
bool | push (T const &t) |
Pushes object t to the queue. More... | |
bool | bounded_push (T const &t) |
Pushes object t to the queue. More... | |
bool | unsynchronized_push (T const &t) |
Pushes object t to the queue. More... | |
bool | pop (T &ret) |
Pops object from queue. More... | |
template<typename U > | |
bool | pop (U &ret) |
Pops object from queue. More... | |
bool | unsynchronized_pop (T &ret) |
Pops object from queue. More... | |
template<typename U > | |
bool | unsynchronized_pop (U &ret) |
Pops object from queue. 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_t | consume_all (Functor &f) |
consumes all elements via a functor More... | |
template<typename Functor > | |
size_t | consume_all (Functor const &f) |
consumes all elements via a functor More... | |
queue (void) | |
Construct queue. More... | |
template<typename U > | |
queue (typename node_allocator::template rebind< U >::other const &alloc) | |
Construct queue. More... | |
queue (allocator const &alloc) | |
Construct queue. More... | |
queue (size_type n) | |
Construct queue, allocate n nodes for the freelist. More... | |
template<typename U > | |
queue (size_type n, typename node_allocator::template rebind< U >::other const &alloc) | |
Construct queue, allocate n nodes for the freelist. More... | |
The queue class provides a multi-writer/multi-reader queue, pushing and popping is lock-free, construction/destruction has to be synchronized.
It uses a freelist for memory management, freed nodes are pushed to the freelist and not returned to the OS before the queue is destroyed.
Policies:
boost::lockfree::fixed_sized<false>
fixed_sized<true>
boost::lockfree::allocator<std::allocator<void>>
Requirements:
typedef implementation_defined::allocator boost::lockfree::queue< T, A0, A1, A2 >::allocator |
typedef implementation_defined::size_type boost::lockfree::queue< T, A0, A1, A2 >::size_type |
typedef T boost::lockfree::queue< T, A0, A1, A2 >::value_type |
|
inline |
Construct queue.
References BOOST_ASSERT.
|
inlineexplicit |
Construct queue.
References boost::BOOST_STATIC_ASSERT().
|
inlineexplicit |
Construct queue.
References BOOST_ASSERT.
|
inlineexplicit |
Construct queue, allocate n nodes for the freelist.
References BOOST_ASSERT.
|
inline |
Construct queue, allocate n nodes for the freelist.
References boost::BOOST_STATIC_ASSERT().
|
inline |
Destroys queue, free all nodes from freelist.
References boost::memory_order_relaxed, and boost::lockfree::queue< T, A0, A1, A2 >::unsynchronized_pop().
|
inline |
Pushes object t to the queue.
if | memory allocator throws |
References boost::flyweights::t.
|
inline |
consumes all elements via a functor
sequentially pops all elements from the queue and applies the functor on each object
References boost::lockfree::queue< T, A0, A1, A2 >::consume_one().
|
inline |
consumes all elements via a functor
sequentially pops all elements from the queue and applies the functor on each object
References boost::lockfree::queue< T, A0, A1, A2 >::consume_one().
|
inline |
consumes one element via a functor
pops one element from the queue and applies the functor on this object
References boost::lockfree::queue< T, A0, A1, A2 >::pop(), and boost::sinks::event_log::success.
Referenced by boost::lockfree::queue< T, A0, A1, A2 >::consume_all().
|
inline |
consumes one element via a functor
pops one element from the queue and applies the functor on this object
References boost::lockfree::queue< T, A0, A1, A2 >::pop(), and boost::sinks::event_log::success.
|
inline |
Check if the queue is empty.
|
inline |
|
inline |
Pops object from queue.
Referenced by boost::lockfree::queue< T, A0, A1, A2 >::consume_one().
|
inline |
Pops object from queue.
References boost::memory_order_acquire.
|
inline |
Pushes object t to the queue.
References boost::flyweights::t.
|
inline |
Allocate n nodes for freelist.
References boost::n.
|
inline |
Allocate n nodes for freelist.
References boost::n.
|
inline |
Pops object from queue.
Referenced by boost::lockfree::queue< T, A0, A1, A2 >::~queue().
|
inline |
Pops object from queue.
References boost::memory_order_relaxed.
|
inline |
Pushes object t to the queue.
if | memory allocator throws |
References boost::memory_order_relaxed, and boost::flyweights::t.