#include "loop.hh"
Static Public Member Functions | |
static PollFDSourceP | create (const BPfdSlot &slot, int fd, const String &mode) |
static PollFDSourceP | create (const VPfdSlot &slot, int fd, const String &mode) |
Protected Member Functions | |
virtual bool | check (const LoopState &state) |
void | construct (const String &mode) |
virtual void | destroy () |
virtual bool | dispatch (const LoopState &state) |
virtual bool | prepare (const LoopState &state, int64 *timeout_usecs_p) |
virtual | ~PollFDSource () |
![]() | |
EventSource () | |
uint | n_pfds () |
uint | source_id () |
virtual | ~EventSource () |
Protected Attributes | ||
uint | never_close_: 1 | |
PollFD | pfd_ | |
![]() | ||
uint | dispatching_: 1 | |
uint | id_ | |
EventLoop * | loop_ | |
uint8 | loop_state_ | |
uint | may_recurse_: 1 | |
struct { | ||
uint idx | ||
PollFD * pfd | ||
} * | pfds_ | |
uint | primary_: 1 | |
int16 | priority_ | |
uint | was_dispatching_: 1 | |
Additional Inherited Members | |
![]() | |
void | add_poll (PollFD *const pfd) |
void | loop_remove () |
MainLoop * | main_loop () const |
bool | may_recurse () const |
void | may_recurse (bool may_recurse) |
bool | primary () const |
void | primary (bool is_primary) |
bool | recursion () const |
void | remove_poll (PollFD *const pfd) |
EventLoop source for IO callbacks.
A PollFDSource can be used to execute a callback function from the main loop, depending on certain file descriptor states. The modes supported for polling the file descriptor are as follows:
"r"
- poll readable (POLLIN) "w"
- poll writable (POLLOUT) "p"
- priority data (POLLPRI) "d"
- priority band writable (POLLWRBAND) "b"
- set fd blocking "B"
- set fd non-blocking "C"
- prevent auto close on destroy
|
protectedvirtual |
|
protected |
Prepare the source for dispatching (true return) or polling (false).
Implements EventSource.
|
protectedvirtual |
Check the source and its PollFD descriptors for dispatching (true return).
Implements EventSource.
|
protectedvirtual |
Dispatch source, returns if it should be kept alive.
Implements EventSource.
|
protectedvirtual |
Reimplemented from EventSource.
|
static |
|
static |
|
protected |
|
protected |
BPfdSlot bool_poll_slot_ |
VPfdSlot void_poll_slot_ |