|
HikoGUI
A low latency retained GUI
|
Data Structures | |
| class | awaiter_type |
| An awaiter object which can wait on a notifier. More... | |
Public Types | |
| 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> |
Public Member Functions | |
| 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. | |
|
constexprdefaultnoexcept |
Create a notifier.
|
inlinenoexcept |
Create an awaiter that can await on this notifier.
|
inlinenoexcept |
Call the subscribed callbacks with the given arguments.
| args | The arguments to pass with the invocation of the callback |
|
inlinenoexcept |
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.
| flags | The callback-flags used to determine how the callback is called. |
| callback | A function object to call when being notified. |