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

33 lines
531 B
C++

// ======================================================
//
// A general-purpose countdown timer
// To use this class, specialize it
// and override tick()
//
// ======================================================
#ifndef timer_H
#define timer_H
#include <ctime>
class Timer {
public:
Timer();
void timeoutRequest(int seconds);
// template method
void tick();
protected:
bool isExpired();
private:
virtual void doExpired() = 0;
int timeToGo;
};
#endif