Thread-safe event value that blocks readers until a value is raised.
More...
#include <src/thread_safe.h>
|
| bool | peek () |
| | Inspect the next queued value without popping it.
|
| |
| status_t | pop () |
| | Remove and return the next queued item, waiting when requested.
|
| |
| template<typename Rep , typename Period > |
| status_t | pop (std::chrono::duration< Rep, Period > delay) |
| | Remove and return the next queued item, waiting when requested.
|
| |
| template<class... Args> |
| void | raise (Args &&...args) |
| | Notify waiters that a new event value is available.
|
| |
|
void | reset () |
| | Reset the object to its initial empty state.
|
| |
| bool | running () const |
| | Return whether the queue is still running.
|
| |
|
void | stop () |
| | Raise the alarm and wake all waiting threads.
|
| |
| status_t | try_pop () |
| | Try to remove and return the next queued item without any further wait.
|
| |
| status_t | view () |
| | Read the current value without removing it from the queue.
|
| |
| template<class Rep , class Period > |
| status_t | view (std::chrono::duration< Rep, Period > delay) |
| | Read the current value without removing it from the queue.
|
| |
template<class T>
class safe::event_t< T >
Thread-safe event value that blocks readers until a value is raised.
◆ peek()
Inspect the next queued value without popping it.
- Returns
- True when a value is available to inspect.
◆ pop() [1/2]
Remove and return the next queued item, waiting when requested.
- Returns
- Removed queue item, or empty result when the queue is stopped or empty.
◆ pop() [2/2]
template<class T >
template<typename Rep , typename Period >
Remove and return the next queued item, waiting when requested.
- Parameters
-
| delay | Maximum wait duration before timing out. |
- Returns
- Removed queue item, or empty result when the queue is stopped or empty.
◆ raise()
template<class T >
template<class... Args>
Notify waiters that a new event value is available.
- Parameters
-
| args | Arguments forwarded to the callable or parser. |
◆ running()
Return whether the queue is still running.
- Returns
- True while the queue accepts producers and consumers.
◆ try_pop()
Try to remove and return the next queued item without any further wait.
- Returns
- Removed queue item, or empty result when the queue is stopped or empty.
◆ view() [1/2]
Read the current value without removing it from the queue.
- Returns
- Optional copy of the front item, or empty status when the queue is closed.
◆ view() [2/2]
template<class T >
template<class Rep , class Period >
Read the current value without removing it from the queue.
- Parameters
-
| delay | Maximum wait duration before timing out. |
- Returns
- Optional copy of the front item, or empty status after timeout/closure.
The documentation for this class was generated from the following file: