ARC SDK
Watchdog.h
1 #ifndef __ARC_WATCHDOG_H__
2 #define __ARC_WATCHDOG_H__
3 
4 #include <arc/Thread.h>
5 
6 namespace Arc {
7 
8  // Internal implementation of watchdog.
9  // Currently only single global watchdog is supported.
10  class Watchdog;
11 
13 
16  private:
17  Watchdog& instance_;
18  time_t last;
19 
20  public:
21  WatchdogListener(void);
22 
24 
26  bool Listen(void);
27 
29 
31  bool Listen(int limit, bool& error);
32  };
33 
35 
38  private:
39  int id_;
40 
41  public:
42 
44 
48  WatchdogChannel(int timeout);
49 
51  ~WatchdogChannel(void);
52 
54  void Kick(void);
55  };
56 
57 } // namespace Arc
58 
59 #endif // __ARC_WATCHDOG_H__
60 
Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
WatchdogChannel(int timeout)
Defines watchdog kicking source with specified timeout.
bool Listen(void)
Waits till timeout occurs and then returns true.
void Kick(void)
Tells watchdog this source is still alive.
This class is meant to provide interface for Watchdog executor part.
Definition: Watchdog.h:15
~WatchdogChannel(void)
Upon destruction channel is closed and watchdog forgets about it.
This class is meant to be used in code which provides "I&#39;m alive" ticks to watchdog.
Definition: Watchdog.h:37