40#include <boost/bind.hpp>
64 template <
typename Context>
66 timer{ aTask, dynamic_cast<const
i_lifetime&>(aContext), aDuration_s, aInitialWait } {}
92 virtual void ready() = 0;
106#if !defined(NDEBUG) || defined(DEBUG_TIMER_OBJECTS)
116 template <
typename Context>
121 virtual void ready();
callback_timer(i_async_task &aTask, std::function< void(callback_timer &)> aCallback, const duration_type &aDuration_s, bool aInitialWait=true)
callback_timer(i_async_task &aTask, const Context &aContext, std::function< void(callback_timer &)> aCallback, const duration_type &aDuration_s, bool aInitialWait=true)
callback_timer(i_async_task &aTask, const i_lifetime &aContext, std::function< void(callback_timer &)> aCallback, const duration_type &aDuration_s, bool aInitialWait=true)
timer & operator=(const timer &aOther)
const duration_type & duration() const
void set_duration(const duration_type &aDuration_s, bool aEffectiveImmediately=false)
void set_debug(bool aDebug)
timer(const timer &aOther)
timer(i_async_task &aTask, const Context &aContext, const duration_type &aDuration_s, bool aInitialWait=true)
void enable(bool aWait=true)
timer(i_async_task &aTask, const i_lifetime &aContext, const duration_type &aDuration_s, bool aInitialWait=true)
i_async_task & owner_task() const
timer(i_async_task &aTask, const duration_type &aDuration_s, bool aInitialWait=true)
std::chrono::duration< double > duration_type
std::optional< destroyed_flag > optional_destroyed_flag