17 #include <HAL/Notifier.h> 19 #include "ErrorBase.h" 23 typedef std::function<void()> TimerEventHandler;
27 explicit Notifier(TimerEventHandler handler);
29 template <
typename Callable,
typename Arg,
typename... Args>
30 Notifier(Callable&& f, Arg&& arg, Args&&... args)
31 :
Notifier(std::bind(std::forward<Callable>(f), std::forward<Arg>(arg),
32 std::forward<Args>(args)...)) {}
37 Notifier& operator=(
const Notifier&) =
delete;
47 static void Notify(uint64_t currentTimeInt, HAL_NotifierHandle handle);
50 static std::mutex m_destructorMutex;
52 std::mutex m_processMutex;
54 std::atomic<HAL_NotifierHandle> m_notifier{0};
56 TimerEventHandler m_handler;
58 double m_expirationTime = 0;
62 bool m_periodic =
false;
void Stop()
Stop timer events from occuring.
Definition: Notifier.cpp:133
Definition: Notifier.h:25
void StartPeriodic(double period)
Register for periodic event notification.
Definition: Notifier.cpp:116
void StartSingle(double delay)
Register for single event notification.
Definition: Notifier.cpp:98
Base class for most objects.
Definition: ErrorBase.h:74
Notifier(TimerEventHandler handler)
Create a Notifier for timer event notification.
Definition: Notifier.cpp:26
virtual ~Notifier()
Free the resources for a timer event.
Definition: Notifier.cpp:38