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