42 DECLARE_PRIVATE(
Timer)
85 static void singleShot(
int msec,
const std::function<
void()> &callback);
92 std::unique_ptr<TimerPrivate>
d_ptr;
The Timer class provides repetitive and single-shot timers.
int interval() const
Returns the timeout interval in milliseconds.
void setSingleShot(bool singleShot)
Set whether the timer is a single-shot timer.
void callOnTimeout(const std::function< void()> &callback)
void start()
Starts or restarts the timer with the timeout specified in interval.
static void singleShot(int msec, const std::function< void()> &callback)
This static function calls a the given function after a given time interval.
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
int remainingTime() const
Returns the timer's remaining value in milliseconds left until the timeout. If the timer not exists,...
void setInterval(int msec)
Set the timeout interval in milliseconds.
void stop()
Stops the timer.
virtual void timeout()
This function is called when the timer times out.
std::unique_ptr< TimerPrivate > d_ptr
bool isSingleShot() const
Returns whether the timer is a single-shot timer.
Namespace to encapsulate INDI client, drivers, and mediator classes.