Thread-safe bounded queue with optional busy threshold.
More...
#include <Queue.h>
|
| | Queue () |
| | Constructs an empty running queue.
|
| |
| void | stop () |
| | Stops queue operation and wakes blocked producers/consumers.
|
| |
| void | setMax (uint32_t max) |
| | Sets maximum queue depth before push() blocks.
|
| |
| void | setThold (uint32_t thold) |
| | Sets busy-threshold depth used by busy().
|
| |
| void | push (T const &data) |
| | Pushes one entry, blocking when queue is full.
|
| |
| bool | empty () |
| | Returns whether queue is currently empty.
|
| |
| uint32_t | size () |
| | Returns current queue depth.
|
| |
| bool | busy () |
| | Returns busy state based on configured threshold.
|
| |
| void | reset () |
| | Clears all queued entries and resets busy state.
|
| |
| T | pop () |
| | Pops one entry, blocking until data is available or stopped.
|
| |
template<typename T>
class rogue::Queue< T >
Thread-safe bounded queue with optional busy threshold.
Queue<T> supports producer/consumer usage with blocking push()/pop(). setMax() configures the maximum queued depth before push() blocks. setThold() configures a busy threshold used by busy(). stop() wakes blocked waiters and causes subsequent blocking calls to exit.
Definition at line 38 of file Queue.h.
◆ Queue()
Constructs an empty running queue.
Definition at line 51 of file Queue.h.
◆ busy()
Returns busy state based on configured threshold.
- Returns
true when thold_ > 0 and queue depth is at/above threshold.
Definition at line 123 of file Queue.h.
◆ empty()
Returns whether queue is currently empty.
- Returns
true when no entries are queued.
Definition at line 106 of file Queue.h.
◆ pop()
Pops one entry, blocking until data is available or stopped.
- Returns
- Popped entry when running; default-initialized
T when stopped.
Definition at line 141 of file Queue.h.
◆ push()
Pushes one entry, blocking when queue is full.
- Parameters
-
Definition at line 92 of file Queue.h.
◆ reset()
Clears all queued entries and resets busy state.
Definition at line 130 of file Queue.h.
◆ setMax()
Sets maximum queue depth before push() blocks.
0 disables the depth limit.
- Parameters
-
| max | Maximum queued entries. |
Definition at line 76 of file Queue.h.
◆ setThold()
Sets busy-threshold depth used by busy().
- Parameters
-
| thold | Queue depth threshold. |
Definition at line 84 of file Queue.h.
◆ size()
Returns current queue depth.
- Returns
- Number of queued entries.
Definition at line 114 of file Queue.h.
◆ stop()
Stops queue operation and wakes blocked producers/consumers.
Definition at line 61 of file Queue.h.
The documentation for this class was generated from the following file:
- /home/runner/work/rogue/rogue/include/rogue/Queue.h