Scope
|
#include <SyncQueues.h>
Public Member Functions | |
SynchronizedQueue () | |
size_t | Size () const |
void | Clear () |
void | Enqueue (const T &elem) |
void | Enqueue (T &&elem) |
T | Dequeue () |
T | Dequeue (const std::chrono::milliseconds &timeout) |
Protected Attributes | |
std::deque< T > | queue |
std::mutex | mut |
std::condition_variable | not_empty |
Private Member Functions | |
SynchronizedQueue (SynchronizedQueue< T > &) | |
SynchronizedQueue< T > | operator= (SynchronizedQueue< T > &) |
A synchronized, thread-safe queue was modeled after ringbuffer example from boost?! and/or a Herb Sutter column?!
Definition at line 7 of file DaqController.h.
|
private |
disable copy
|
inline |
We need a default constructor here.
Definition at line 27 of file SyncQueues.h.
|
private |
disable assignment
|
inline |
Definition at line 31 of file SyncQueues.h.
|
inline |
Clears the queue.
Definition at line 37 of file SyncQueues.h.
|
inline |
Enqueues an element and notifies one waiting operation that queue is not empty.
Definition at line 43 of file SyncQueues.h.
|
inline |
Enqueues an element by moving and notifies one waiting operation that queue is not empty.
Definition at line 52 of file SyncQueues.h.
|
inline |
Dequeues front element, waits indefinitely if queue is empty.
Definition at line 61 of file SyncQueues.h.
|
inline |
Dequeues front element, waits timeout if queue is empty.
Definition at line 71 of file SyncQueues.h.
|
protected |
STL dequeue.
Definition at line 17 of file SyncQueues.h.
|
mutableprotected |
mutex for protection
Definition at line 20 of file SyncQueues.h.
|
protected |
condition variable for not empty notification
Definition at line 23 of file SyncQueues.h.