chore: Add course material
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#ifndef TIMERSET_H
|
||||
#define TIMERSET_H
|
||||
|
||||
#include <ctime>
|
||||
#include <vector>
|
||||
|
||||
class Timer;
|
||||
|
||||
class TimerSet {
|
||||
public:
|
||||
void pollAllTimers();
|
||||
void addATimer(Timer *);
|
||||
|
||||
private:
|
||||
TimerSet();
|
||||
std::vector<Timer *> timers; // 3.1 bonus: change from array to vector
|
||||
// int timersInUse; // 3.1 bonus: Not needed
|
||||
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
|
||||
Reference in New Issue
Block a user