![]() |
Utilities
Utilities header only library
|
A notifier is a mechanism to allow inter-object notifications. More...
Public Types | |
| using | CallbackType = std::function< void(Args...)> |
| The callback is a void function taking the variadic templated arguments of the Notifier class. | |
Public Member Functions | |
| void | AddCallback (CallbackType callback) |
| Add a single callback function. | |
| virtual void | Notify (Args... args) |
| Send all notifications at this moment. | |
| bool | HasCallback () const |
| Returns whether it has any callback registered. | |
Protected Attributes | |
| std::vector< CallbackType > | callbacks_ |
| The callbacks. | |
| std::mutex | notifier_access_ |
| mutex to ensure thread safety. | |
A notifier is a mechanism to allow inter-object notifications.