Files
cppcourse/397/SolutionEx21/TimerSet.h
T
2026-10-05 11:27:21 +02:00

30 lines
507 B
C++

#ifndef TIMERSET_H
#define TIMERSET_H
#include <ctime>
class Timer;
class TimerSet {
public:
void pollAllTimers();
void addATimer(Timer *);
private:
TimerSet();
Timer *timers[40];
int timersInUse;
std::time_t previousTime;
// Meyer's singleton
public:
static TimerSet &Instance();
private:
// prevent copying and assignment of the singleton
TimerSet(const TimerSet &);
TimerSet &operator=(const TimerSet &);
};
#endif