|
| | BasicTimer (ProactorType &proactor=ProactorThread::proactor()) |
| | create instance.
|
| |
| | BasicTimer (const BasicTimer &other)=delete |
| | copy constructor.
|
| |
| BasicTimer & | operator= (const BasicTimer &other)=delete |
| | copy assignment operator.
|
| |
| | BasicTimer (BasicTimer &&other)=delete |
| | move constructor.
|
| |
| BasicTimer & | operator= (BasicTimer &&other)=delete |
| | move assignment operator.
|
| |
| | ~BasicTimer () noexcept |
| | destroy instance.
|
| |
| template<class Rep , class Period , typename Func , typename... Args> |
| void | setOneShot (std::chrono::duration< Rep, Period > duration, Func &&callback, Args &&... args) |
| | arm the timer as a one-shot timer.
|
| |
| template<class Clock , class Duration , typename Func , typename... Args> |
| void | setOneShot (std::chrono::time_point< Clock, Duration > timePoint, Func &&callback, Args &&... args) |
| | arm the timer as a one-shot timer with absolute time.
|
| |
| template<class Rep , class Period , typename Func , typename... Args> |
| void | setInterval (std::chrono::duration< Rep, Period > duration, Func &&callback, Args &&... args) |
| | arm the timer as a periodic timer.
|
| |
| void | cancel () noexcept |
| | cancel the timer.
|
| |
| bool | active () const noexcept |
| | check if timer is running.
|
| |
| std::chrono::nanoseconds | remaining () const noexcept |
| | get the remaining time until expiration.
|
| |
| std::chrono::nanoseconds | interval () const noexcept |
| | get the interval of the running periodic timer.
|
| |
| bool | oneShot () const noexcept |
| | check if timer is a one-shot timer.
|
| |
template<class ClockPolicy, class ProactorType>
class join::BasicTimer< ClockPolicy, ProactorType >
base timer class.
template<class ClockPolicy , class ProactorType >
template<class Rep , class Period , typename Func , typename... Args>
| void join::BasicTimer< ClockPolicy, ProactorType >::setInterval |
( |
std::chrono::duration< Rep, Period > | duration, |
|
|
Func && | callback, |
|
|
Args &&... | args ) |
|
inline |
arm the timer as a periodic timer.
- Parameters
-
| duration | interval duration between timer expirations. |
| callback | function to call on each timer expiration. |
| args | callback arguments. |
template<class ClockPolicy , class ProactorType >
template<class Rep , class Period , typename Func , typename... Args>
| void join::BasicTimer< ClockPolicy, ProactorType >::setOneShot |
( |
std::chrono::duration< Rep, Period > | duration, |
|
|
Func && | callback, |
|
|
Args &&... | args ) |
|
inline |
arm the timer as a one-shot timer.
- Parameters
-
| duration | timeout duration before timer expires. |
| callback | function to call when timer expires. |
| args | callback arguments. |
template<class ClockPolicy , class ProactorType >
template<class Clock , class Duration , typename Func , typename... Args>
| void join::BasicTimer< ClockPolicy, ProactorType >::setOneShot |
( |
std::chrono::time_point< Clock, Duration > | timePoint, |
|
|
Func && | callback, |
|
|
Args &&... | args ) |
|
inline |
arm the timer as a one-shot timer with absolute time.
- Parameters
-
| timePoint | absolute time when timer should expire. |
| callback | function to call when timer expires. |
| args | callback arguments. |