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

34 lines
581 B
C++

#ifndef TIMERSET_H
#define TIMERSET_H
#include <ctime>
#include <thread>
#include <vector>
class Timer;
class TimerSet {
public:
void pollAllTimers();
void addATimer(Timer *);
private:
TimerSet();
std::vector<Timer *> timers;
std::time_t previousTime;
// Exercise 5.1 Threading two new members
std::thread pollingThread;
void poll10Hz();
// Meyer's Singleton
public:
static TimerSet &Instance();
private:
TimerSet(const TimerSet &);
TimerSet &operator=(const TimerSet &);
};
#endif