diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2021-11-17 22:34:57 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2021-11-17 22:34:57 +0100 |
| commit | 6232d13f5321b87ddf12a1aa36b4545da45f173d (patch) | |
| tree | 23f3316470a14136debd9d02f9e920ca2b06f4cc /src/signal_handler.hh | |
Travel3: Simple image and video display site
Reads the images and videos from filesystem and builds a site in
memroy.
Diffstat (limited to 'src/signal_handler.hh')
| -rw-r--r-- | src/signal_handler.hh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/signal_handler.hh b/src/signal_handler.hh new file mode 100644 index 0000000..dbbe6d4 --- /dev/null +++ b/src/signal_handler.hh @@ -0,0 +1,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 |
