|
|
using | result_type = Result |
|
using | callback_proto = Result(Args...) |
|
using | function_type = std::function<callback_proto> |
|
using | callback_token = std::shared_ptr<function_type> |
|
using | weak_callback_token = std::weak_ptr<function_type> |
|
| constexpr | notifier () noexcept=default |
| | Create a notifier.
|
|
constexpr | notifier (notifier &&) noexcept=default |
|
constexpr | notifier (notifier const &) noexcept=default |
|
constexpr notifier & | operator= (notifier &&) noexcept=default |
|
constexpr notifier & | operator= (notifier const &) noexcept=default |
| awaiter_type | operator co_await () const noexcept |
| | Create an awaiter that can await on this notifier.
|
| callback_token | subscribe (forward_of< callback_proto > auto &&callback, callback_flags flags=callback_flags::synchronous) noexcept |
| | Add a callback to the notifier.
|
| void | 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>
Create an awaiter that can await on this notifier.
◆ operator()()
template<typename Result, typename... Args>
| void 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 |
◆ 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
-
| 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 file: