qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
base.h
Go to the documentation of this file.
1
24
25#ifndef QB_IO_ASYNC_EVENT_BASE_H
26#define QB_IO_ASYNC_EVENT_BASE_H
27
28#include <ev/ev++.h>
29
30namespace qb::io::async {
31
43public:
47 virtual ~IRegisteredKernelEvent() = default;
48
56 virtual void invoke() = 0;
57};
58
59namespace event {
60
73template <typename _EV_EVENT>
74struct base : public _EV_EVENT {
75 using ev_t = _EV_EVENT;
78
83 explicit base(ev::loop_ref loop)
84 : _EV_EVENT(loop)
85 , _interface(nullptr)
86 , _revents(0) {}
87};
88
89} // namespace event
90} // namespace qb::io::async
91
92#endif // QB_IO_ASYNC_EVENT_BASE_H
Interface for kernel event registration and invocation.
Definition base.h:42
virtual ~IRegisteredKernelEvent()=default
Virtual destructor.
virtual void invoke()=0
Event invocation method, called by the listener when the event triggers.
_EV_EVENT ev_t
Alias for the underlying libev event watcher type.
Definition base.h:75
base(ev::loop_ref loop)
Constructor.
Definition base.h:83
IRegisteredKernelEvent * _interface
Definition base.h:76
int _revents
Definition base.h:77