GDAL
|
This is a thread-safe queue. More...
#include <notifyqueue.h>
Public Member Functions | |
~NotifyQueue () | |
Destructor. | |
void | push (T &&t) |
Push an object on the queue and notify readers. More... | |
bool | pop (T &t) |
Get an item from the queue. More... | |
void | done () |
When we're done putting things in the queue, set the end condition. | |
void | stop () |
Unblock all readers regardless of queue state. | |
bool | isDone () |
Determine if the queue was emptied completely. More... | |
bool | isStopped () |
Determine if the queue was stopped. More... | |
size_t | size () const |
Get the current size of the queue. More... | |
This is a thread-safe queue.
Things placed in the queue must be move-constructible. Readers will wait until there is something in the queue or the queue is empty or stopped. If the queue is stopped (error), it will never be in the done state. If in the done state (all writers have finished), it will never be in the error state.
|
inline |
Determine if the queue was emptied completely.
Call after pop() returns false to check queue state.
|
inline |
Determine if the queue was stopped.
Call after pop() returns false to check queue state.
|
inline |
Get an item from the queue.
t | Reference to an item to to which a queued item will be moved. |
|
inline |
Push an object on the queue and notify readers.
t | Object to be moved onto the queue. |
|
inline |
Get the current size of the queue.