7 #ifndef PROJECT_PERIODICTASK_H 8 #define PROJECT_PERIODICTASK_H 28 virtual void init() = 0;
29 virtual void run() = 0;
63 void printStatusOfSlowTasks();
76 std::string name,
void (*
function)())
77 :
PeriodicTask(taskManager, period, name), _function(function) {}
80 void run() { _function(); }
85 void (*_function)() =
nullptr;
95 void run()
override { _tm->printStatus(); }
108 template <
typename T>
112 std::string name,
void (T::*
function)(), T* obj)
119 void run() { (_obj->*_function)(); }
122 void (T::*_function)();
126 #endif // PROJECT_PERIODICTASK_H
std::vector< PeriodicTask * > _tasks
PeriodicMemberFunction(PeriodicTaskManager *taskManager, float period, std::string name, void(T::*function)(), T *obj)
PeriodicTask(PeriodicTaskManager *taskManager, float period, std::string name)
PrintTaskStatus(PeriodicTaskManager *tm, float period)
PeriodicTaskManager * _tm
PeriodicFunction(PeriodicTaskManager *taskManager, float period, std::string name, void(*function)())