qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
signal.h
Go to the documentation of this file.
1
24
25#ifndef QB_IO_ASYNC_EVENT_SIGNAL_H
26#define QB_IO_ASYNC_EVENT_SIGNAL_H
27
28#include "base.h"
29
30namespace qb::io::async::event {
31
81template <int _SIG = -1>
82struct signal : public base<ev::sig> {
84
91 explicit signal(ev::loop_ref loop)
92 : base_t(loop) {
93 if constexpr (_SIG != -1) {
94 this->set(_SIG); // `this->` is needed here for dependent name in template
95 }
96 }
97};
98
108template <>
109struct signal<-1> : public base<ev::sig> {
111
119 explicit signal(ev::loop_ref loop)
120 : base_t(loop) {}
121};
122
123} // namespace qb::io::async::event
124
125#endif // QB_IO_ASYNC_EVENT_SIGNAL_H
Base class for asynchronous events in the QB IO library.
base(ev::loop_ref loop)
Definition base.h:83
signal(ev::loop_ref loop)
Constructor.
Definition signal.h:119
base< ev::sig > base_t
Base type alias for base<ev::sig>.
Definition signal.h:110
base< ev::sig > base_t
Base type alias for base<ev::sig>.
Definition signal.h:83
signal(ev::loop_ref loop)
Constructor.
Definition signal.h:91