Files
2026-10-05 11:27:21 +02:00

23 lines
561 B
C++

// ======================================================
//
// Template for derievd Timers
//
// ======================================================
#ifndef TIMERT_H
#define TIMERT_H
#include "Timer.h"
template <class Target> class TimerT : public Timer {
public:
typedef void (Target::*TargetFunc)();
TimerT(Target &target, TargetFunc targetFunc) : myTarget(target), myTargetFunc(targetFunc) {}
private:
void doExpired() { (myTarget.*myTargetFunc)(); }
Target &myTarget;
TargetFunc myTargetFunc;
};
#endif