BRE12
Public Types | Public Member Functions | Friends | List of all members
tbb::strict_ppl::concurrent_queue< T, A > Class Template Reference

A high-performance thread-safe non-blocking concurrent queue. More...

#include <concurrent_queue.h>

Inheritance diagram for tbb::strict_ppl::concurrent_queue< T, A >:

Public Types

typedef T value_type
 Element type in the queue.
 
typedef T & reference
 Reference type.
 
typedef const T & const_reference
 Const reference type.
 
typedef size_t size_type
 Integral type for representing size of the queue.
 
typedef ptrdiff_t difference_type
 Difference type for iterator.
 
typedef A allocator_type
 Allocator type.
 
typedef internal::concurrent_queue_iterator< concurrent_queue, T > iterator
 
typedef internal::concurrent_queue_iterator< concurrent_queue, const T > const_iterator
 

Public Member Functions

 concurrent_queue (const allocator_type &a=allocator_type())
 Construct empty queue.
 
template<typename InputIterator >
 concurrent_queue (InputIterator begin, InputIterator end, const allocator_type &a=allocator_type())
 [begin,end) constructor
 
 concurrent_queue (const concurrent_queue &src, const allocator_type &a=allocator_type())
 Copy constructor.
 
 ~concurrent_queue ()
 Destroy queue.
 
void push (const T &source)
 Enqueue an item at tail of queue.
 
bool try_pop (T &result)
 Attempt to dequeue an item from head of queue. More...
 
size_type unsafe_size () const
 Return the number of items in the queue; thread unsafe.
 
bool empty () const
 Equivalent to size()==0.
 
void clear ()
 Clear the queue. not thread-safe.
 
allocator_type get_allocator () const
 Return allocator object.
 
iterator unsafe_begin ()
 
iterator unsafe_end ()
 
const_iterator unsafe_begin () const
 
const_iterator unsafe_end () const
 

Friends

template<typename Container , typename Value >
class internal::concurrent_queue_iterator
 

Detailed Description

template<typename T, typename A = cache_aligned_allocator<T>>
class tbb::strict_ppl::concurrent_queue< T, A >

A high-performance thread-safe non-blocking concurrent queue.

Multiple threads may each push and pop concurrently. Assignment construction is not allowed.

Member Function Documentation

§ try_pop()

template<typename T, typename A = cache_aligned_allocator<T>>
bool tbb::strict_ppl::concurrent_queue< T, A >::try_pop ( T &  result)
inline

Attempt to dequeue an item from head of queue.

Does not wait for item to become available. Returns true if successful; false otherwise.


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