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))
93 return t->isTimerRunning();
102 if (
Timer*
const t = getCallback (timerID))
103 return t->getTimerInterval();
Holds a resizable array of primitive or copy-by-value objects.
void clear()
Removes all elements from the array.
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 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.