chore: Add course material
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// ======================================================
|
||||
//
|
||||
// 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
|
||||
Reference in New Issue
Block a user