summaryrefslogtreecommitdiff
path: root/src/signals.hh
blob: f387f9f36b264ce931f412caa5a3b9333cd18583 (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
30
31
32
33
#ifndef SIGNALS_HH
#define SIGNALS_HH

#include <functional>
#include <memory>

namespace looper {
class Looper;
}  // namespace looper

namespace signals {

enum class Signal {
  INT,
  TERM,
};

class Handler {
 public:
  virtual ~Handler() = default;

  static std::unique_ptr<Handler> create(looper::Looper& looper, Signal signal,
                                         std::function<void()> callback);

 protected:
  Handler() = default;
  Handler(Handler const&) = delete;
  Handler& operator=(Handler const&) = delete;
};

}  // namespace signals

#endif  // SIGNALS_HH