A simple, thread safe queue.
The queue is templated so that any data type can be used with it.
#include <utility/YiConcurrentQueue.h>
Public Member Functions | |
| CYIConcurrentQueue () | |
| CYIConcurrentQueue (const CYIConcurrentQueue< YI_DATA > &other) | |
| CYIConcurrentQueue & | operator= (const CYIConcurrentQueue< YI_DATA > &rhs) |
| void | Push (const YI_DATA &rData) |
| void | WaitEmpty () |
| bool | Empty () const |
| bool | TryPop (YI_DATA &rValue) |
| bool | WaitAndPop (YI_DATA &rValue) |
| void | StopWaiting () |
|
inline |
Default constructor.
|
inline |
Copy constructor.
|
inline |
Checks if the queue is empty.
|
inline |
Overloaded assignment operator.
|
inline |
Push a new piece of data into the queue.
|
inline |
Wakes the queue, if it is waiting for a message to arrive.
|
inline |
Attempt to remove an element from the queue, unless the queue is empty or a mutext lock cannot be obtained.
|
inline |
Wait for the queue to become available, and then remove an element from the queue. If the waiting is interrupted via StopWaiting(), returns false with no valid rValue. User should check the return code before reading rValue.
|
inline |
Returns when the queue is empty.