41#include "threadpool/Timer.h"
88 std::atomic_bool mHasExpired;
89 threadpool::Timer mTimer;
90 threadpool::Timer::Interval mInterval;
94 AITimer(CWDEBUG_ONLY(
bool debug =
false)) :
98 mHasExpired(false), mTimer([this](){ expired(); }) { DoutEntering(dc::statefultask(mSMDebug),
"AITimer::AITimer() [" << (
void*)
this <<
"]"); }
107 void set_interval(threadpool::Timer::Interval interval) { mInterval = interval; }
114 threadpool::Timer::Interval
const&
get_interval()
const {
return mInterval; }
118 ~AITimer()
override { DoutEntering(dc::statefultask(mSMDebug),
"AITimer::~AITimer() [" << (
void*)
this <<
"]"); }
Declaration of base class AIStatefulTask.
Definition: AIStatefulTask.h:96
static constexpr state_type state_end
The next state value to use for derived classes.
Definition: AIStatefulTask.h:137
AIStatefulTask(bool debug)
Definition: AIStatefulTask.h:352
uint32_t state_type
The type of run_state.
Definition: AIStatefulTask.h:98
static constexpr state_type state_end
One beyond the largest state of this task.
Definition: AITimer.h:85
timer_state_type
The different states of the stateful task.
Definition: AITimer.h:78
~AITimer() override
Call finish() (or abort()), not delete.
Definition: AITimer.h:118
char const * task_name_impl() const override
This can be used to get a human readable name of the most-derived class. It must be guaranteed to alw...
Definition: AITimer.cxx:51
char const * state_str_impl(state_type run_state) const override
Implementation of virtual functions of AIStatefulTask.
Definition: AITimer.cxx:41
void abort_impl() override
Handle aborting from current bs_run state.
Definition: AITimer.cxx:80
void set_interval(threadpool::Timer::Interval interval)
Definition: AITimer.h:107
AITimer(bool debug=false)
Construct an AITimer object.
Definition: AITimer.h:94
threadpool::Timer::Interval const & get_interval() const
Definition: AITimer.h:114
void multiplex_impl(state_type run_state) override
Handle mRunState.
Definition: AITimer.cxx:62