![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
Classes | |
| class | BorrowedFd |
| Non-owning wrapper around a file descriptor. More... | |
| class | EPollPoller |
| epoll-based implementation of Poller. More... | |
| class | InotifyWatcher |
| Watches filesystem paths using Linux inotify API and dispatches events through callbacks. More... | |
| class | OwnedFd |
| Owning RAII wrapper around a file descriptor. More... | |
| class | Poller |
| Abstract interface for FD-based event polling. More... | |
| class | PollerFd |
| RAII wrapper for the registration of a FD in a Poller. More... | |
| class | SignalFdWatcher |
| Watches POSIX signals via signalfd and dispatches them through a callback. More... | |
| class | Timer |
| FD-integrated timer utility (timerfd-backed). More... | |
Typedefs | |
| using | FdCallback = std::function<void (BorrowedFd, EventTriggers)> |
| Invoked when events occur on a watched file descriptor. | |
| using | Callback = std::move_only_function<void ()> |
| Generic move-only callback with no arguments. | |
Enumerations | |
| enum class | EventInterest { Read = 0x01 , Write = 0x02 , ReadClose = 0x04 , OneShot = 0x08 } |
| Event types a watcher can subscribe to for a given file descriptor. More... | |
| enum class | EventTrigger { Readable = 0x01 , Writable = 0x02 , PeerClosed = 0x04 , Hangup = 0x08 , Error = 0x10 } |
| Event types that can be delivered by the poller for a given file descriptor. More... | |
Functions | |
| void | swap (BorrowedFd &fd1, BorrowedFd &fd2) noexcept |
| DECLARE_FLAGS (EventInterests, EventInterest) | |
| DECLARE_FLAGS (EventTriggers, EventTrigger) | |
| uint32_t | toNativeEPollEvent (EventInterests events) noexcept |
| Convert abstract interests into a native epoll events bitmask. | |
| EventTriggers | fromNativeEPollEvent (uint32_t events) noexcept |
| Convert a native epoll events bitmask into abstract triggers. | |
| OwnedFd | makeOwnedFd (int fd) noexcept |
| Create a OwnedFd that will automatically close the given fd on destruction. | |
| void | swap (OwnedFd &fd1, OwnedFd &fd2) noexcept |
| PollerFd | makePollerFd (Poller &poller, OwnedFd fd, EventInterests events, FdCallback cb) noexcept |
| Create a PollerFd and transfer FD ownership to it. | |
| void | swap (PollerFd &fd1, PollerFd &fd2) noexcept |
| using dfx::FdWatch::Callback = std::move_only_function<void ()> |
Generic move-only callback with no arguments.
| using dfx::FdWatch::FdCallback = std::function<void (BorrowedFd, EventTriggers)> |
Invoked when events occur on a watched file descriptor.
The callback receives the triggering file descriptor and the set of delivered EventTriggers.
|
strong |
Event types a watcher can subscribe to for a given file descriptor.
These values are combined into EventInterests to express what the caller wants the poller to monitor.
Notes:
|
strong |
Event types that can be delivered by the poller for a given file descriptor.
These values are combined into EventTriggers and represent what happened since the FD was armed.
Some triggers are conditional on being subscribed:
Others are delivered regardless of subscriptions:
| Enumerator | |
|---|---|
| Readable | FD became readable (only if EventInterest::Read is set). |
| Writable | FD became writable (only if EventInterest::Write is set). |
| PeerClosed | Peer closed its write side / read-side hangup (only if EventInterest::ReadClose is set). |
| Hangup | Hangup detected (always delivered when observed). |
| Error | Error condition detected (always delivered when observed). |
|
noexcept |
Convert a native epoll events bitmask into abstract triggers.
| events | A native uint32_t bitmask as returned by epoll_wait / epoll_pwait. |
|
inlinenodiscardnoexcept |
Create a OwnedFd that will automatically close the given fd on destruction.
|
inlinenodiscardnoexcept |
Create a PollerFd and transfer FD ownership to it.
|
noexcept |
Convert abstract interests into a native epoll events bitmask.
| events | The abstract interests to arm for a file descriptor. |