|
| template<typename... Args> |
| | BasicWheel (Args &&... args) |
| | create instance.
|
| |
| | BasicWheel (const BasicWheel &other)=delete |
| | copy constructor.
|
| |
| BasicWheel & | operator= (const BasicWheel &other)=delete |
| | copy assignment operator.
|
| |
| | BasicWheel (BasicWheel &&other)=delete |
| | move constructor.
|
| |
| BasicWheel & | operator= (BasicWheel &&other)=delete |
| | move assignment operator.
|
| |
| | ~BasicWheel () noexcept |
| | destroy instance.
|
| |
| template<class Rep , class Period , typename Func , typename... Args> |
| ssize_t | setOneShot (std::chrono::duration< Rep, Period > duration, Func &&callback, Args &&... args) noexcept |
| | arm a one-shot timer.
|
| |
| template<class Rep , class Period , typename Func , typename... Args> |
| ssize_t | setInterval (std::chrono::duration< Rep, Period > duration, Func &&callback, Args &&... args) noexcept |
| | arm a periodic timer.
|
| |
| int | cancel (ssize_t id, bool sync=false) noexcept |
| | cancel a timer.
|
| |
| bool | active (ssize_t id) const noexcept |
| | check if a timer is armed.
|
| |
| std::chrono::nanoseconds | remaining (ssize_t id) const noexcept |
| | get the time left.
|
| |
| std::chrono::nanoseconds | interval (ssize_t id) const noexcept |
| | get the interval.
|
| |
| bool | oneShot (ssize_t id) const noexcept |
| | check if a timer is one-shot.
|
| |
| int | mlock () const noexcept |
| | lock wheel memory in RAM.
|
| |
| const RunPolicy & | runner () const noexcept |
| | get the run policy.
|
| |
template<class ClockPolicy, class RunPolicy, size_t Capacity, uint64_t TickNs>
class join::BasicWheel< ClockPolicy, RunPolicy, Capacity, TickNs >
timing wheel.
template<class ClockPolicy , class RunPolicy , size_t Capacity, uint64_t TickNs>
template<class Rep , class Period , typename Func , typename... Args>
| ssize_t join::BasicWheel< ClockPolicy, RunPolicy, Capacity, TickNs >::setInterval |
( |
std::chrono::duration< Rep, Period > | duration, |
|
|
Func && | callback, |
|
|
Args &&... | args ) |
|
inlinenoexcept |
arm a periodic timer.
- Parameters
-
| duration | interval, rounded up to a tick. |
| callback | callback. |
| args | callback arguments. |
- Returns
- timer handle on success, -1 on failure.
template<class ClockPolicy , class RunPolicy , size_t Capacity, uint64_t TickNs>
template<class Rep , class Period , typename Func , typename... Args>
| ssize_t join::BasicWheel< ClockPolicy, RunPolicy, Capacity, TickNs >::setOneShot |
( |
std::chrono::duration< Rep, Period > | duration, |
|
|
Func && | callback, |
|
|
Args &&... | args ) |
|
inlinenoexcept |
arm a one-shot timer.
- Parameters
-
| duration | delay, rounded up to a tick. |
| callback | callback. |
| args | callback arguments. |
- Returns
- timer handle on success, -1 on failure.