29 : owner (mt), timerID (tid)
55Timer* MultiTimer::getCallback (
int timerID)
const noexcept
57 for (
int i = timers.size(); --i >= 0;)
61 if (t->timerID == timerID)
72 Timer* timer = getCallback (timerID);
84 if (
Timer*
const t = getCallback (timerID))
92 if (
Timer*
const t = getCallback (timerID))
102 if (
Timer*
const t = getCallback (timerID))
Automatically locks and unlocks a mutex object.
A type of timer class that can run multiple timers with different frequencies, all of which share a s...
MultiTimer() noexcept
Creates a MultiTimer.
int getTimerInterval(int timerID) const noexcept
Returns the interval for a specified timer ID.
void stopTimer(int timerID) noexcept
Stops a timer.
virtual void timerCallback(int timerID)=0
The user-defined callback routine that actually gets called by each of the timers that are running.
bool isTimerRunning(int timerID) const noexcept
Checks whether a timer has been started for a specified ID.
void startTimer(int timerID, int intervalInMilliseconds) noexcept
Starts a timer and sets the length of interval required.
virtual ~MultiTimer()
Destructor.
Makes repeated callbacks to a virtual method at a specified time interval.
void stopTimer() noexcept
Stops the timer.
int getTimerInterval() const noexcept
Returns the timer's interval.
bool isTimerRunning() const noexcept
Returns true if the timer is currently running.
void startTimer(int intervalInMilliseconds) noexcept
Starts the timer and sets the length of interval required.
void timerCallback() override
The user-defined callback routine that actually gets called periodically.