uvw 3.1.0
Loading...
Searching...
No Matches
signal.h
1#ifndef UVW_SIGNAL_INCLUDE_H
2#define UVW_SIGNAL_INCLUDE_H
3
4#include <uv.h>
5#include "config.h"
6#include "handle.hpp"
7#include "loop.h"
8
9namespace uvw {
10
13 explicit signal_event(int sig) noexcept;
14
15 int signum;
16};
17
31class signal_handle final: public handle<signal_handle, uv_signal_t, signal_event> {
32 static void start_callback(uv_signal_t *hndl, int signum);
33
34public:
35 using handle::handle;
36
41 int init() final;
42
51 int start(int signum);
52
62 int one_shot(int signum);
63
68 int stop();
69
74 int signal() const noexcept;
75};
76
77} // namespace uvw
78
79#ifndef UVW_AS_LIB
80# include "signal.cpp"
81#endif
82
83#endif // UVW_SIGNAL_INCLUDE_H
Handle base class.
Definition: handle.hpp:23
The signal handle.
Definition: signal.h:31
int one_shot(int signum)
Starts the handle.
int signal() const noexcept
Gets the signal being monitored.
int start(int signum)
Starts the handle.
int init() final
Initializes the handle.
int stop()
Stops the handle.
uvw default namespace.
Definition: async.h:8
Signal event.
Definition: signal.h:12