A simple, thread safe deque.
The deque is templated so that any data type can be used with it.
#include <utility/YiConcurrentDeque.h>
Public Member Functions | |
| CYIConcurrentDeque () | |
| CYIConcurrentDeque (const CYIConcurrentDeque< YI_DATA > &other) | |
| CYIConcurrentDeque & | operator= (const CYIConcurrentDeque< YI_DATA > &rhs) |
| void | PushFront (const YI_DATA &rData) |
| void | PushBack (const YI_DATA &rData) |
| void | WaitEmpty () |
| bool | Empty () const |
| bool | TryPopFront (YI_DATA &rValue) |
| bool | TryPopBack (YI_DATA &rValue) |
| bool | WaitAndPopFront (YI_DATA &rValue) |
| bool | WaitAndPopFront (YI_DATA &rValue, uint64_t uTimeoutMs) |
| bool | WaitAndPopBack (YI_DATA &rValue) |
| void | StopWaiting () |
| uint32_t | GetSize () const |
|
inline |
|
inline |
|
inline |
Checks if the queue is empty.
|
inline |
Returns the current number of items in the queue.
|
inline |
|
inline |
|
inline |
Add a new piece of data to the front of the deque.
|
inline |
Wakes the queue, if it is waiting for a message to arrive.
|
inline |
|
inline |
Attempt to remove an element from the queue, unless the queue is empty or a mutext lock cannot be obtained.
|
inline |
|
inline |
Wait for the queue to become available, and then remove the element at the front of 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 |
Wait for the queue to become available, and then remove the element at the front of the queue. If the waiting is interrupted via StopWaiting(), returns false with no valid rValue. If uTimeoutMs milliseconds ellapse without an item becoming available, false is returned. User should check the return code before reading rValue.
|
inline |
Returns when the queue is empty.