Motorcortex Core  version: 2.7.6
wd_taskmonitor.h
1 /*
2  * Developer : Alexey Zakharov (alexey.zakharov@vectioneer.com)
3  * All rights reserved. Copyright (c) 2018 VECTIONEER.
4  */
5 
6 #ifndef MOTORCORTEX_CORE_WD_TASKMONITOR_H
7 #define MOTORCORTEX_CORE_WD_TASKMONITOR_H
8 
9 #include <vector>
10 
11 namespace mcx {
12 
13 namespace container {
14 class Task;
15 }
16 
17 namespace watchdog {
18 
19 class TaskMonitor {
20 
21  struct TaskState {
22  const container::Task* task;
23  int counter;
24  unsigned long prev_nr_of_cycles;
25  bool error;
26  };
27 
28 public:
29 
30  TaskMonitor();
31 
32  void add(const container::Task* task);
33 
34  bool update(double cycle_time_sec);
35 
36 private:
37 
38  std::vector<TaskState> task_state_list_;
39 
40 };
41 
42 } // namespace mcx
43 
44 } // namespace watchdog
45 
46 #endif //MOTORCORTEX_CORE_WD_TASKMONITOR_H
mcx::watchdog::TaskMonitor
Definition: wd_taskmonitor.h:19
mcx::container::Task
Event loop and concurrency primitive for Motorcortex modules.
Definition: ct_task.h:31