Flair
Framework Libre Air
Watchdog.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef WATCHDOG_H
14 #define WATCHDOG_H
15 
16 #include <Thread.h>
17 #include <functional>
18 
19 namespace flair {
20 namespace core {
21 
29 class Watchdog : public Thread {
30 public:
31  Watchdog(const Object *parent, std::function<void()> _expired, Time _timer);
32  ~Watchdog();
33 
34  // reset the timer
35  void Touch();
36  void SetTimer(Time _Timer);
37 
38 private:
39  void Run();
40  std::function<void()> expired;
41  Time timer;
42 };
43 
44 } // end namespace core
45 } // end namespace flair
46 
47 #endif // WATCHDOG_H
Base class for all Framework's classes.
Definition: Object.h:83
namespace of the flair Framework
Definition: Ahrs.h:19
unsigned long long Time
Time definition, in ns.
Definition: Object.h:55
Abstract class for a thread.
Abstract class for a thread.
Definition: Thread.h:38
Watchdog class.
Definition: Watchdog.h:29