BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
PosixSignal.h
1 #pragma once
2 
3 #include <functional>
4 #include <string>
5 
6 namespace Poco {
7 
8 class Thread;
9 
10 }
11 
12 namespace BeeeOn {
13 
17 class PosixSignal {
18 private:
19  PosixSignal();
20 
21 public:
22  typedef std::function<void(unsigned int)> Handler;
23 
29  static void send(long pid, const std::string name);
30 
39  static void send(const Poco::Thread &thread, const std::string &name);
40 
45  static void ignore(const std::string &name);
46 
52  static void handle(const std::string &name, Handler handler);
53 
60  static void trapFatal();
61 
62 protected:
66  static unsigned int byName(const std::string &name);
67 
68  static void send(long pid, unsigned int num);
69  static void send(const Poco::Thread &thread, unsigned int num);
70  static void ignore(unsigned int num);
71  static void handle(unsigned int num, Handler handler);
72 };
73 
74 }
static unsigned int byName(const std::string &name)
Definition: PosixSignal.cpp:45
The class implements working with POSIX signals.
Definition: PosixSignal.h:17
static void send(long pid, const std::string name)
static void ignore(const std::string &name)
static void handle(const std::string &name, Handler handler)
Definition: PosixSignal.cpp:82
static void trapFatal()
Definition: PosixSignal.cpp:225