blob: dbbe6d48bb67ce17e64c5dd7fd57e8b67a6358d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#ifndef SIGNAL_HANDLER_HH
#define SIGNAL_HANDLER_HH
#include <functional>
#include <memory>
class Looper;
class SignalHandler {
public:
virtual ~SignalHandler() = default;
enum class Signal {
INT,
TERM,
HUP,
};
static std::unique_ptr<SignalHandler> create(std::shared_ptr<Looper> looper,
Signal signal,
std::function<void()> callback);
protected:
SignalHandler() = default;
SignalHandler(SignalHandler const&) = delete;
SignalHandler& operator=(SignalHandler const&) = delete;
};
#endif // SIGNAL_HANDLER_HH
|