23 std::vector<NotificationHandler<T>> mSubsribers;
50 mSubsribers.push_back(handler);
57 for (
auto subscriber : mSubsribers)
State changing notifier wrapper.
Definition: notifier.h:20
void Subscribe(NotificationHandler< T > handler)
Subscribe to the state change.
Definition: notifier.h:48
Notifier(T &state)
Constructor.
Definition: notifier.h:28
T Read() const noexcept
Read the current state.
Definition: notifier.h:41
void Notify()
Notify state change.
Definition: notifier.h:55
std::function< void(T)> NotificationHandler
Callback on notification invocation.
Definition: notifier.h:14