Toolbox snapshot
The Reactive C++ Toolbox
|
#include <toolbox/io/Reactor.hpp>
Classes | |
class | Handle |
Public Types | |
enum class | HookType : int { EndOfCycleNoWait = 1 , EndOfEventDispatch = 2 } |
using | Event = EpollEvent |
Public Member Functions | |
Reactor (std::size_t size_hint=0) | |
~Reactor () override | |
Reactor (const Reactor &)=delete | |
Reactor & | operator= (const Reactor &)=delete |
Reactor (Reactor &&)=delete | |
Reactor & | operator= (Reactor &&)=delete |
Handle | subscribe (int fd, unsigned events, IoSlot slot) |
Timer | timer (MonoTime expiry, Duration interval, Priority priority, TimerSlot slot) |
Throws std::bad_alloc only. | |
Timer | timer (MonoTime expiry, Priority priority, TimerSlot slot) |
Throws std::bad_alloc only. | |
void | add_hook (Hook &hook, HookType ht=HookType::EndOfCycleNoWait) noexcept |
int | poll (CyclTime now, Duration timeout=NoTimeout) |
Public Member Functions inherited from toolbox::io::Waker | |
Waker () noexcept=default | |
virtual | ~Waker () |
Waker (const Waker &) noexcept=default | |
Waker & | operator= (const Waker &) noexcept=default |
Waker (Waker &&) noexcept=default | |
Waker & | operator= (Waker &&) noexcept=default |
void | wakeup () noexcept |
Protected Member Functions | |
void | do_wakeup () noexcept final |
Thread-safe. | |
Definition at line 34 of file Reactor.hpp.
Definition at line 36 of file Reactor.hpp.
|
strong |
Enumerator | |
---|---|
EndOfCycleNoWait | |
EndOfEventDispatch |
Definition at line 38 of file Reactor.hpp.
|
explicit |
Definition at line 30 of file Reactor.cpp.
|
override |
Definition at line 37 of file Reactor.cpp.
|
delete |
Reactor::Handle toolbox::io::Reactor::subscribe | ( | int | fd, |
unsigned | events, | ||
IoSlot | slot | ||
) |
Definition at line 42 of file Reactor.cpp.
|
inline |
Throws std::bad_alloc only.
Definition at line 142 of file Reactor.hpp.
Throws std::bad_alloc only.
Definition at line 147 of file Reactor.hpp.
|
inlinenoexcept |
Definition at line 153 of file Reactor.hpp.
Poll for I/O and timer events. The thread-local cycle time is unconditionally updated after the call to epoll() returns. Returns the number of events signalled.
Definition at line 56 of file Reactor.cpp.
|
finalprotectedvirtualnoexcept |