chore: Add course material

This commit is contained in:
2026-10-05 11:27:21 +02:00
parent 971813c351
commit e8241fd1ff
660 changed files with 26658 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
#include "TimerSet.h"
#include "Timer.h"
#include <iostream>
TimerSet::TimerSet() : timersInUse(0), previousTime(time(NULL)) {}
void TimerSet::addATimer(Timer *t) { timers[timersInUse++] = t; }
void TimerSet::pollAllTimers() {
std::time_t timeNow;
if (time(&timeNow) > previousTime) {
previousTime = timeNow;
for (int i = 0; i < timersInUse; ++i) {
timers[i]->tick();
}
}
}
TimerSet &TimerSet::Instance() {
// Meyer's Singleton implementation
static TimerSet pInstance;
return pInstance;
}