|
HikoGUI
A low latency retained GUI
|
#include <TTauri/Foundation/notifier.hpp>
Public Types | |
| using | callback_type = std::function<void(Args const &...)> |
Public Member Functions | |
| size_t | add (callback_type callback) noexcept |
| Add a callback to the notifier. | |
| size_t | add_and_call (callback_type callback, Args const &... args) noexcept |
| Add a callback to the notifier and invoke it. | |
| void | remove (size_t id) noexcept |
| Remove a callback from the notifier. | |
| void | operator() (Args const &... args) const noexcept |
| Call the registerd callbacks with the given arguments. | |
A notifier which can be used to call a set of registred callbacks.
This class is thread-safe; however you must not use this object from within the callback.
| Args | The argument types of the callback function. |
|
inlinenoexcept |
Add a callback to the notifier.
| callback | The callback to register. |
|
inlinenoexcept |
Add a callback to the notifier and invoke it.
| callback | The callback to register. |
| args | The arguments to pass with the invocation of the callback |
|
inlinenoexcept |
Call the registerd callbacks with the given arguments.
| args | The arguments to pass with the invocation of the callback |
|
inlinenoexcept |
Remove a callback from the notifier.
| id | The id returned from add() and add_and_call(). |