Zth (libzth)
|
A pollable thing. More...
#include <poller.h>
Public Types | |
enum | EventsFlags { PollInIndex , PollOutIndex , PollErrIndex , PollPriIndex , PollHupIndex , FlagCount } |
Flags to be used with events and revents. More... | |
typedef std::bitset< FlagCount > | Events |
Type of events and revents. More... | |
Public Member Functions | |
constexpr | Pollable (Events const &e, void *user=nullptr) noexcept |
Ctor. More... | |
Public Attributes | |
void * | user_data |
User data. More... | |
Events | events |
Events to poll. More... | |
Events | revents |
Returned events by a poll. More... | |
Static Public Attributes | |
static const unsigned long | PollIn = 1UL << PollInIndex |
static const unsigned long | PollOut = 1UL << PollOutIndex |
static const unsigned long | PollErr = 1UL << PollErrIndex |
static const unsigned long | PollPri = 1UL << PollPriIndex |
static const unsigned long | PollHup = 1UL << PollHupIndex |
A pollable thing.
Only file descriptors (or even only sockets in Windows) are supported by Zth. Use zth::PollableFd instead. The generic Pollable class exists for extending by your application.
If you implement more Pollables, you must provide and register your own PollerServer.
typedef std::bitset<FlagCount> zth::Pollable::Events |
|
inlineexplicitconstexprnoexcept |
Events zth::Pollable::events |
Events to poll.
Do not change these events after adding the Pollable to a Poller.
Not every PollerServer may support all flags.
|
static |
|
static |
|
static |
|
static |
|
static |
Events zth::Pollable::revents |
void* zth::Pollable::user_data |