|
Flow
Documentation for the Flow C++ Library
|
#include <flow_concurrent_queue.h>
Public Member Functions | |
| ConcurrentQueue ()=default | |
| Constructs a concurrent FIFO queue. | |
| ConcurrentQueue (const allocator_type &allocator) | |
| Constructs a concurrent FIFO queue. | |
| ConcurrentQueue (const ConcurrentQueue &)=delete | |
| ConcurrentQueue (ConcurrentQueue &&)=delete | |
| ConcurrentQueue & | operator= (const ConcurrentQueue &)=delete |
| ConcurrentQueue & | operator= (ConcurrentQueue &&)=delete |
| bool | empty () const |
| Checks if the queue is empty. Value can be obsolete in concurrency code. | |
| std::size_t | size () const |
| Returns the number of elements in the queue. Value can be obsolete in concurrency code. | |
| void | push (const T &value) |
| Pushes a new element into the queue. | |
| void | push (T &&value) |
| Pushes a new element into the queue. | |
| template<typename... Args> | |
| void | emplace (Args &&... args) |
| Constructs a new element in place at the end of the queue. | |
| std::optional< T > | tryFront () const |
| Tries to get a copy of the first element without removing it. | |
| std::optional< T > | tryPop () |
| Tries to pop and return the first element. | |
| T | waitPop () |
| Waits until the queue is not empty, then pops and returns the first element. | |
Private Types | |
| using | allocator_type = typename Container::allocator_type |
Private Attributes | |
| std::mutex | mux_ |
| std::condition_variable | blocked_ |
| std::queue< T, Container > | queue_ |
Definition at line 10 of file flow_concurrent_queue.h.
|
private |
Definition at line 11 of file flow_concurrent_queue.h.
|
default |
Constructs a concurrent FIFO queue.
Referenced by ConcurrentQueue(), ConcurrentQueue(), operator=(), and operator=().
|
inlineexplicit |
Constructs a concurrent FIFO queue.
Definition at line 22 of file flow_concurrent_queue.h.
References queue_.
|
delete |
References ConcurrentQueue().
|
delete |
References ConcurrentQueue().
|
inline |
Constructs a new element in place at the end of the queue.
Definition at line 64 of file flow_concurrent_queue.h.
|
inline |
Checks if the queue is empty. Value can be obsolete in concurrency code.
Definition at line 33 of file flow_concurrent_queue.h.
|
delete |
References ConcurrentQueue().
|
delete |
References ConcurrentQueue().
|
inline |
|
inline |
|
inline |
Returns the number of elements in the queue. Value can be obsolete in concurrency code.
Definition at line 39 of file flow_concurrent_queue.h.
|
inline |
Tries to get a copy of the first element without removing it.
Definition at line 74 of file flow_concurrent_queue.h.
|
inline |
Tries to pop and return the first element.
Definition at line 84 of file flow_concurrent_queue.h.
|
inline |
Waits until the queue is not empty, then pops and returns the first element.
Definition at line 97 of file flow_concurrent_queue.h.
|
private |
|
mutableprivate |
Definition at line 13 of file flow_concurrent_queue.h.
Referenced by emplace(), empty(), push(), push(), size(), tryFront(), tryPop(), and waitPop().
|
private |
Definition at line 15 of file flow_concurrent_queue.h.
Referenced by ConcurrentQueue(), emplace(), empty(), push(), push(), size(), tryFront(), tryPop(), and waitPop().