D++ (DPP)
C++ Discord API Bot Library
|
Trigger a timed event once. The provided callback is called only once. More...
Public Member Functions | |
oneshot_timer (class cluster *cl, uint64_t duration, timer_callback_t callback) | |
Construct a new oneshot timer object. More... | |
timer | get_handle () |
Get the handle for the created one-shot timer. More... | |
void | cancel () |
Cancel the one shot timer immediately. Callback function is not called. More... | |
~oneshot_timer () | |
Destroy the oneshot timer object. More... | |
Trigger a timed event once. The provided callback is called only once.
dpp::oneshot_timer::oneshot_timer | ( | class cluster * | cl, |
uint64_t | duration, | ||
timer_callback_t | callback | ||
) |
Construct a new oneshot timer object.
cl | cluster owner |
duration | duration before firing |
callback | callback to call on firing |
dpp::oneshot_timer::~oneshot_timer | ( | ) |
Destroy the oneshot timer object.
void dpp::oneshot_timer::cancel | ( | ) |
Cancel the one shot timer immediately. Callback function is not called.
timer dpp::oneshot_timer::get_handle | ( | ) |
Get the handle for the created one-shot timer.