yat
0.11.3pre
|
Multi-thread safe queue. More...
#include <yat/utility/Queue.h>
Public Types | |
typedef T | value_type |
Type of object stored in Queue. | |
typedef std::deque< T >::size_type | size_type |
Public Member Functions | |
Queue (void) | |
Create a Queue with no elements. | |
Queue (const Queue &other) | |
Copy constructor. | |
bool | empty (void) const |
void | pop (T &value) |
access next element is queue | |
void | push (const T &t) |
insert an element into container | |
size_type | size (void) const |
bool | try_pop (T &value) |
Queue & | operator= (const Queue &lhs) |
assignment operator | |
Multi-thread safe queue.
This class provides a multi-thread safe queue. The Queue is typically shared by multiple threads such that some threads push elements and some pop elements. The Queue is a "first in first out" container and holds the same functionality as the similar std::queue. The difference is that Queue is multi-thread safe, in other words, when one thread access the Queue, other threads are locked out from access so that only one thread touches the Queue at a time and its behaviour is well defined. In a single-thread application there is no point in using the class as std::queue should be prefereble.
typedef std::deque<T>::size_type theplu::yat::utility::Queue< T >::size_type |
An unsigned integral type.
|
inline |
Copy constructor.
|
inline |
true
if container's size is zero
|
inline |
assignment operator
|
inline |
access next element is queue
Access the next element is queue. If container is empty, process is waiting until other process is inserting element into container.
|
inline |
|
inline |