uvw 2.12.1
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 "handle.hpp"
6#include "loop.h"
7
8namespace uvw {
9
16 explicit SignalEvent(int sig) noexcept;
17
18 int signum;
19};
20
34class SignalHandle final: public Handle<SignalHandle, uv_signal_t> {
35 static void startCallback(uv_signal_t *handle, int signum);
36
37public:
38 using Handle::Handle;
39
44 bool init();
45
53 void start(int signum);
54
63 void oneShot(int signum);
64
68 void 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:26
The SignalHandle handle.
Definition signal.h:34
void start(int signum)
Starts the handle.
void stop()
Stops the handle.
bool init()
Initializes the handle.
void oneShot(int signum)
Starts the handle.
int signal() const noexcept
Gets the signal being monitored.
uvw default namespace.
Definition async.h:8
SignalEvent event.
Definition signal.h:15