AlarmNotifications
PANDA Slow Control Alarm Daemon
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
daemon.h
Go to the documentation of this file.
1 
34 #ifndef DAEMON_H
35 #define DAEMON_H
36 
37 #include <signal.h>
38 
39 #include "alarmserverconnector.h"
40 
41 namespace AlarmNotifications
42 {
43 
51 class Daemon
52 {
53 private:
59  static const unsigned short int DaemonSleepTimeout = 3; // seconds
65  bool _run;
71  __sighandler_t hsigint;
77  __sighandler_t hsighup;
83  __sighandler_t hsigquit;
89  __sighandler_t hsigusr1;
95  __sighandler_t hsigusr2;
101  __sighandler_t hsigterm;
108 
118  static void signalReceiver ( int signum );
124  Daemon();
125 public:
132  static Daemon& instance();
138  ~Daemon();
145  Daemon ( const Daemon& other ) = delete;
152  Daemon ( Daemon&& other ) = delete;
160  Daemon& operator= ( const Daemon& other ) = delete;
168  Daemon& operator= ( Daemon&& other ) = delete;
175  void run();
176 };
177 
178 }
179 
180 #endif // DAEMON_H