|
join 1.0
lightweight network framework library
|
base timer class. More...
#include <timer.hpp>


Public Member Functions | |
| BasicTimer (Reactor *reactor=nullptr) | |
| 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 > | |
| void | setOneShot (std::chrono::duration< Rep, Period > duration, Func &&callback) |
| arm the timer as a one-shot timer. | |
| template<class Clock , class Duration , typename Func > | |
| void | setOneShot (std::chrono::time_point< Clock, Duration > timePoint, Func &&callback) |
| arm the timer as a one-shot timer with absolute time. | |
| template<class Rep , class Period , typename Func > | |
| void | setInterval (std::chrono::duration< Rep, Period > duration, Func &&callback) |
| 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. | |
Static Public Member Functions | |
| static constexpr int | type () noexcept |
| get the timer type. | |
Additional Inherited Members | |
Protected Member Functions inherited from join::EventHandler | |
| virtual void | onClose (int fd) |
| method called when handle is closed. | |
| virtual void | onError (int fd) |
| method called when an error occurred on handle. | |
| EventHandler ()=default | |
| create instance. | |
| EventHandler (const EventHandler &other)=default | |
| copy constructor. | |
| EventHandler & | operator= (const EventHandler &other)=default |
| copy assignment operator. | |
| EventHandler (EventHandler &&other)=default | |
| move constructor. | |
| EventHandler & | operator= (EventHandler &&other)=default |
| move assignment operator. | |
| virtual | ~EventHandler ()=default |
| destroy instance. | |
base timer class.
|
inlineexplicit |
create instance.
| reactor | event loop reactor. |
|
delete |
copy constructor.
| other | other object to copy. |
|
delete |
move constructor.
| other | other object to move. |
|
inlinenoexcept |
destroy instance.
|
inlinenoexcept |
check if timer is running.
|
inlinenoexcept |
cancel the timer.
|
inlinenoexcept |
get the interval of the running periodic timer.
|
inlinenoexcept |
check if timer is a one-shot timer.
|
delete |
move assignment operator.
| other | other object to assign. |
|
delete |
copy assignment operator.
| other | other object to assign. |
|
inlinenoexcept |
get the remaining time until expiration.
|
inline |
arm the timer as a periodic timer.
| duration | interval duration between timer expirations. |
| callback | function to call on each timer expiration. |
|
inline |
arm the timer as a one-shot timer.
| duration | timeout duration before timer expires. |
| callback | function to call when timer expires. |
|
inline |
arm the timer as a one-shot timer with absolute time.
| timePoint | absolute time when timer should expire. |
| callback | function to call when timer expires. |
|
inlinestaticconstexprnoexcept |
get the timer type.