ADTF  3.18.3
timer_impl.h
Go to the documentation of this file.
1 
15 #ifndef A_UTIL_UTIL_SYSTEM_DETAIL_TIMER_IMPL_INCLUDED
16 #define A_UTIL_UTIL_SYSTEM_DETAIL_TIMER_IMPL_INCLUDED
17 
18 #include <a_util/base/delegate.h>
20 
21 namespace a_util {
22 namespace system {
23 template <typename M, typename T>
24 inline Timer::Timer(std::uint64_t period_us, M method, T& instance)
25  : Timer() // necessary to prevent incomplete type error in IntrusivePtr<>
26 {
27  setPeriod(period_us);
28  setCallback(method, instance);
29 }
30 
31 template <typename M, typename T>
32 inline void Timer::setCallback(M method, T& instance)
33 {
35 }
36 
37 } // namespace system
38 } // namespace a_util
39 
40 #endif // A_UTIL_UTIL_SYSTEM_DETAIL_TIMER_IMPL_INCLUDED
General delegate template: encapsulates a function or a method without a parameter.
Periodic timer running in a separate thread.
Definition: timer_decl.h:45
void setCallback(void(*function)())
Set the callback for the timer.
Timer()
Default CTOR.
void setPeriod(std::uint64_t period_us)
Set the period used by this timer, restarting the timer if already running.
Common include for delegate functionality.
Serves as the root component, with common functionality documented in core functionality.
Definition: base.h:24
Public API for Timer class.