|
| constexpr | notifier () noexcept=default |
| | Create a notifier.
|
| |
|
| notifier (notifier &&)=delete |
| |
|
| notifier (notifier const &)=delete |
| |
|
notifier & | operator= (notifier &&)=delete |
| |
|
notifier & | operator= (notifier const &)=delete |
| |
| awaiter_type | operator co_await () const noexcept |
| | Create an awaiter that can await on this notifier.
|
| |
| token_type | subscribe (std::invocable< Args... > auto &&callback) noexcept |
| | Add a callback to the notifier.
|
| |
| void | post (Args const &...args) const noexcept |
| | Post the subscribed callbacks on the current thread's event loop with the given arguments.
|
| |
| void | post_on_main (Args const &...args) const noexcept |
| | Post the subscribed callbacks on the main thread's event loop with the given arguments.
|
| |
| auto | operator() (Args const &...args) const noexcept |
| | Call the subscribed callbacks with the given arguments.
|
| |
◆ notifier()
template<typename Result , typename... Args>
◆ operator co_await()
template<typename Result , typename... Args>
| awaiter_type v1::notifier< Result(Args...)>::operator co_await |
( |
| ) |
const |
|
inlinenoexcept |
Create an awaiter that can await on this notifier.
◆ operator()()
template<typename Result , typename... Args>
| auto v1::notifier< Result(Args...)>::operator() |
( |
Args const &... | 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 |
◆ post()
template<typename Result , typename... Args>
| void v1::notifier< Result(Args...)>::post |
( |
Args const &... | args | ) |
const |
|
inlinenoexcept |
Post the subscribed callbacks on the current thread's event loop with the given arguments.
- Note
- This function is not reentrant.
- Parameters
-
| args | The arguments to pass with the invocation of the callback |
◆ post_on_main()
template<typename Result , typename... Args>
| void v1::notifier< Result(Args...)>::post_on_main |
( |
Args const &... | args | ) |
const |
|
inlinenoexcept |
Post the subscribed callbacks on the main thread's event loop 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 Result , typename... Args>
Add a callback to the notifier.
Ownership of the callback belongs with the caller of subscribe(). The caller will receive a token, a move-only RAII object that will unsubscribe the callback when the token is destroyed.
- Parameters
-
| callback_ptr | A shared_ptr to a callback function. |
- Returns
- A RAII object which when destroyed will unsubscribe the callback.
The documentation for this class was generated from the following file: