22 friend class cKernelTimerHelperRunnable;
24 typedef std::shared_ptr<ImplBase> shared_base_type;
30 virtual void Run() = 0;
33 template<
typename Callable>
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>
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>
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>
105 Callable&& pFunc, Args&&... args):
107 adtf::services::IKernel::tSchedulingInfo(), strName,
108 tmPeriod, tmInitialDelay,
109 std::forward<Callable>(pFunc),
110 std::forward<Args>(args)...)
tInt64 tTimeStamp
type definition for a time value.
A common result class usable as return value throughout.
tTimerClock
Enum for different time sources for timers.
Class that wraps a kernel timer to call a method at specified intervals.
kernel_timer(kernel_timer &&)
Move constructor.
tResult SetScheduling(const adtf::services::IKernel::tSchedulingInfo &sScheduling)
Changes the scheduling parameters of the timer.
bool Stoppable() const
Whether or not the timer is stoppable, i.e.
kernel_timer()
Default constructor.
kernel_timer(adtf::services::IKernel::tTimerClock eClock, const adtf::services::IKernel::tSchedulingInfo &sScheduling, const char *strName, tTimeStamp tmPeriod, tTimeStamp tmInitialDelay, Callable &&pFunc, Args &&... args)
Constructor that creates a new timer with a given clock and scheduling parameters.
tResult Stop()
Stop the timer.
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)
Constructor that creates a new timer with a given clock, scheduling parameters and flags.
tResult GetScheduling(adtf::services::IKernel::tSchedulingInfo &sScheduling) const
Retrieves the scheduling parameters of the thread.
void Swap(kernel_timer &oOther)
Swaps two timers.
kernel_timer & operator=(kernel_timer &&oOther)
Move assignment operator.
~kernel_timer()
Destructor.
kernel_timer(const char *strName, tTimeStamp tmPeriod, tTimeStamp tmInitialDelay, Callable &&pFunc, Args &&... args)
Constructor that creates a new timer.
Object pointer implementation used for reference counting on objects of type IObject.
Copyright © Audi Electronics Venture GmbH.
Namespace for entire ADTF SDK.
Struct for defining scheduling settings of a thread or timer.