22 friend class cKernelTimerHelperRunnable;
24 typedef std::shared_ptr<ImplBase> shared_base_type;
29 inline virtual ~ImplBase() {}
30 virtual void Run() = 0;
33 template<
typename Callable>
34 struct Impl :
public ImplBase
38 Impl(Callable&& pFunc) : pFunc(std::forward<Callable>(pFunc))
48 template<
typename Callable>
49 std::shared_ptr<Impl<Callable>> MakeCallable(Callable&& pFunc)
51 return std::make_shared<Impl<Callable>>(std::forward<Callable>(pFunc));
54 shared_base_type m_pCallable;
72 template<
typename Callable,
typename ...Args>
76 tTimeStamp tmPeriod, tTimeStamp tmInitialDelay,
79 m_pCallable = MakeCallable(std::bind(std::forward<Callable>(pFunc),
80 std::forward<Args>(args)...));
81 Create(strName, sScheduling, eClock, tmPeriod, tmInitialDelay);
87 template<
typename Callable,
typename ...Args>
92 tTimeStamp tmPeriod, tTimeStamp tmInitialDelay, uint32_t nFlags,
95 m_pCallable = MakeCallable(std::bind(std::forward<Callable>(pFunc),
96 std::forward<Args>(args)...));
97 Create(strName, sScheduling, eClock, tmPeriod, tmInitialDelay, tmMaximumExectionTime, nFlags);
103 template<
typename Callable,
typename ...Args>
104 kernel_timer(
const char* strName, tTimeStamp tmPeriod, tTimeStamp tmInitialDelay,
105 Callable&& pFunc, Args&&... args):
108 tmPeriod, tmInitialDelay,
109 std::forward<Callable>(pFunc),
110 std::forward<Args>(args)...)
163 tTimeStamp tmInitialDelay);
167 tTimeStamp tmInitialDelay, tTimeStamp tmMaximumExecutionTime, uint32_t nFlags);
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
kernel_timer(adtf::services::IKernel::tTimerClock eClock, const adtf::services::IKernel::tSchedulingInfo &sScheduling, const char *strName, tTimeStamp tmPeriod, tTimeStamp tmInitialDelay, Callable &&pFunc, Args &&... args)
Definition kernel_timer.h:73
kernel_timer(tTimeStamp tmMaximumExectionTime, adtf::services::IKernel::tTimerClock eClock, const adtf::services::IKernel::tSchedulingInfo &sScheduling, const char *strName, tTimeStamp tmPeriod, tTimeStamp tmInitialDelay, uint32_t nFlags, Callable &&pFunc, Args &&... args)
Definition kernel_timer.h:88
kernel_timer(const char *strName, tTimeStamp tmPeriod, tTimeStamp tmInitialDelay, Callable &&pFunc, Args &&... args)
Definition kernel_timer.h:104