Class that wraps a kernel timer to call a method at specified intervals. More...
#include <kernel_timer.h>
Classes | |
struct | Impl |
struct | ImplBase |
Public Member Functions | |
kernel_timer () | |
Default constructor. | |
kernel_timer (const kernel_timer &)=delete | |
kernel_timer (kernel_timer &&) | |
Move constructor. | |
template<typename Callable, typename ... Args> | |
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. | |
template<typename Callable, typename ... Args> | |
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. | |
template<typename Callable, typename ... Args> | |
kernel_timer (const char *strName, tTimeStamp tmPeriod, tTimeStamp tmInitialDelay, Callable &&pFunc, Args &&... args) | |
Constructor that creates a new timer. | |
~kernel_timer () | |
Destructor. | |
kernel_timer & | operator= (kernel_timer &&oOther) |
Move assignment operator. | |
void | Swap (kernel_timer &oOther) |
Swaps two timers. | |
bool | Stoppable () const |
Whether or not the timer is stoppable, i.e. | |
tResult | Stop () |
Stop the timer. | |
tResult | SetScheduling (const adtf::services::IKernel::tSchedulingInfo &sScheduling) |
Changes the scheduling parameters of the timer. | |
tResult | GetScheduling (adtf::services::IKernel::tSchedulingInfo &sScheduling) const |
Retrieves the scheduling parameters of the thread. | |
Private Types | |
typedef std::shared_ptr< ImplBase > | shared_base_type |
Private Member Functions | |
template<typename Callable> | |
std::shared_ptr< Impl< Callable > > | MakeCallable (Callable &&pFunc) |
tResult | Create (const char *strName, const adtf::services::IKernel::tSchedulingInfo &sScheduling, adtf::services::IKernel::tTimerClock eClock, tTimeStamp tmPeriod, tTimeStamp tmInitialDelay) |
tResult | Create (const char *strName, const adtf::services::IKernel::tSchedulingInfo &sScheduling, adtf::services::IKernel::tTimerClock eClock, tTimeStamp tmPeriod, tTimeStamp tmInitialDelay, tTimeStamp tmMaximumExecutionTime, uint32_t nFlags) |
Private Attributes | |
shared_base_type | m_pCallable |
Class that wraps a kernel timer to call a method at specified intervals.
Definition at line 19 of file kernel_timer.h.
|
private |
Definition at line 24 of file kernel_timer.h.
|
inline |
Constructor that creates a new timer with a given clock and scheduling parameters.
Definition at line 73 of file kernel_timer.h.
References kernel_timer().
|
inline |
Constructor that creates a new timer with a given clock, scheduling parameters and flags.
Definition at line 88 of file kernel_timer.h.
References kernel_timer().
|
inline |
Constructor that creates a new timer.
Definition at line 104 of file kernel_timer.h.
References kernel_timer().
~kernel_timer | ( | ) |
Destructor.
This will stop the timer.
tResult GetScheduling | ( | adtf::services::IKernel::tSchedulingInfo & | sScheduling | ) | const |
Retrieves the scheduling parameters of the thread.
[in] | sScheduling | The scheduling parameters. |
|
inlineprivate |
Definition at line 49 of file kernel_timer.h.
kernel_timer & operator= | ( | kernel_timer && | oOther | ) |
Move assignment operator.
[in,out] | oOther | The object that should be moved. |
References kernel_timer().
tResult SetScheduling | ( | const adtf::services::IKernel::tSchedulingInfo & | sScheduling | ) |
Changes the scheduling parameters of the timer.
[in] | sScheduling | The new scheduling parameters. |
tResult Stop | ( | ) |
Stop the timer.
Mind that the destructor calls this method, so there is no need to call this method directly.
bool Stoppable | ( | ) | const |
Whether or not the timer is stoppable, i.e.
currently running.
void Swap | ( | kernel_timer & | oOther | ) |
|
private |
Definition at line 54 of file kernel_timer.h.