10#include "../core/FunctionConnector.h"
19 static void single(
int ms, T function) {
20 new SingleTimerTask(ms, function);
26 void start(
int,
bool =
false);
31 FunctionConnectorProtected<Timer>::Connector<>
timeout;
37 SingleTimerTask(
int ms, T _f) : f(std::move(_f)) {
41 void operator()()
override {
The AbstractThread class provides the base functionality for thread management.
Definition AbstractThread.h:46
virtual int appendTimer(int, AbstractTask *)
Append timer.
Definition AbstractThread.cpp:675
AbstractFunction<> AbstractTask
The AbstractTask type.
Definition AbstractThread.h:56
static AbstractThread * currentThread()
Returns a pointer to the AsyncFw::AbstractThread that manages the currently executing thread.
Definition AbstractThread.cpp:295
virtual void removeTimer(int)
Remove timer.
Definition AbstractThread.cpp:712
The Timer class.
Definition Timer.h:15
void start(int, bool=false)
Starts or restarts a timer with the specified timeout. If the timer is already running,...
Definition Timer.cpp:29
void stop()
Stops the timer.
Definition Timer.cpp:34
FunctionConnectorProtected< Timer >::Connector<> timeout
The Timer::timeout connector.
Definition Timer.h:31
static void single(int ms, T function)
Starts a single shot timer with the specified timeout.
Definition Timer.h:19