|
|
using | result_type = R |
| |
|
using | callback_proto = R(Args...) |
| |
|
using | callback_type = callback<R(Args...)> |
| |
|
using | weak_callback_type = weak_callback<R(Args...)> |
| |
|
| constexpr | notifier () noexcept=default |
| | Create a notifier.
|
| |
|
constexpr | notifier (notifier &&) noexcept=delete |
| |
|
constexpr | notifier (notifier const &) noexcept=delete |
| |
|
constexpr notifier & | operator= (notifier &&) noexcept=delete |
| |
|
constexpr notifier & | operator= (notifier const &) noexcept=delete |
| |
| awaiter_type | operator co_await () const noexcept |
| | Create an awaiter that can await on this notifier.
|
| |
| template<forward_of< callback_proto > Func> |
| callback_type | subscribe (Func &&func, callback_flags flags=callback_flags::synchronous) noexcept |
| | Add a callback to the notifier.
|
| |
|
template<forward_of< void()> F> |
| void | loop_local_post_function (F &&) const noexcept |
| |
|
template<forward_of< void()> F> |
| void | loop_main_post_function (F &&) const noexcept |
| |
|
template<forward_of< void()> F> |
| void | loop_timer_post_function (F &&) const noexcept |
| |
| void | operator() (Args... args) const noexcept |
| | Call the subscribed callbacks with the given arguments.
|
| |
|
template<forward_of< void()> Func> |
| void | loop_local_post_function (Func &&func) const noexcept |
| |
|
template<forward_of< void()> Func> |
| void | loop_main_post_function (Func &&func) const noexcept |
| |
|
template<forward_of< void()> Func> |
| void | loop_timer_post_function (Func &&func) const noexcept |
| |
◆ notifier()
template<typename R , typename... Args>
◆ operator co_await()
template<typename R , typename... Args>
| awaiter_type v1::notifier< R(Args...)>::operator co_await |
( |
| ) |
const |
|
inlinenoexcept |
Create an awaiter that can await on this notifier.
◆ operator()()
template<typename R , typename... Args>
| void v1::notifier< R(Args...)>::operator() |
( |
Args... | args | ) |
const |
|
inlinenoexcept |
Call the subscribed callbacks with the given arguments.
- Note
- This function is not reentrant.
- Parameters
-
| args | The arguments to pass with the invocation of the callback |
◆ subscribe()
template<typename R , typename... Args>
template<forward_of< callback_proto > Func>
Add a callback to the notifier.
After the call the caller will take ownership of the returned callback object.
The callback object is a move-only RAII object that will automatically unsubscribe the callback when the token is destroyed.
- Parameters
-
| flags | The callback-flags used to determine how the callback is called. |
| callback | A function object to call when being notified. |
- Returns
- A RAII object which when destroyed will unsubscribe the callback.
The documentation for this class was generated from the following files: