![]() |
mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
Event that can be used to trigger coroutines. More...
#include <event.hpp>
Public Member Functions | |
| Event (const Event &)=delete | |
| Event & | operator= (const Event &)=delete |
| Event (Event &&other) noexcept | |
| Event & | operator= (Event &&other) noexcept |
| bool | try_trigger () |
| Try triggering the event. | |
| bool | try_cancel () |
| Try cancelling the event. | |
Friends | |
| std::pair< Event, EventAwaitable > | make_event () |
| Create Event and its bound awaitable. | |
Event that can be used to trigger coroutines.
This is the write part of a onedirectional oneshot communication channel. To create the pair, use mrs_lib::coro::make_event.
| bool mrs_lib::coro::Event::try_cancel | ( | ) |
Try cancelling the event.
The call will fail (return false) if the event was already triggered or cancelled.
| bool mrs_lib::coro::Event::try_trigger | ( | ) |
Try triggering the event.
The call will fail (return false) if the event was already triggered or cancelled.
|
friend |
Create Event and its bound awaitable.
Together, the Event and EventAwaitable form a onedirectional oneshot communication channel.