Zth (libzth)
|
Abstract base class of a Poller server. More...
#include <poller.h>
Public Types | |
typedef PollerClientBase | Client |
Public Member Functions | |
virtual | ~PollerServerBase () override=default |
virtual int | poll (int timeout_ms) noexcept=0 |
Poll. More... | |
virtual int | migrateTo (PollerServerBase &p) noexcept=0 |
Move all registered Pollables to another server. More... | |
virtual int | add (Pollable &p, Client *client) noexcept=0 |
Add a Pollable, that belongs to a given client. More... | |
virtual int | remove (Pollable &p, Client *client) noexcept=0 |
Remove the given Pollable, belonging to the given client. More... | |
Public Member Functions inherited from zth::PollerInterface | |
virtual | ~PollerInterface ()=default |
Dtor. More... | |
virtual int | add (Pollable &p) noexcept=0 |
Add a pollable object. More... | |
int | add (std::initializer_list< std::reference_wrapper< Pollable >> l) noexcept |
Add pollable objects. More... | |
virtual int | remove (Pollable &p) noexcept=0 |
Remove a pollable object. More... | |
virtual void | reserve (size_t more)=0 |
Reserve memory to add more pollables. More... | |
virtual bool | empty () const noexcept=0 |
Checks if there is any pollable registered. More... | |
Public Member Functions inherited from zth::UniqueID< PollerInterface > | |
UniqueID (UniqueID const &)=delete | |
UniqueID (UniqueID &&u) noexcept | |
UniqueID (string const &name) | |
UniqueID (string &&name) | |
UniqueID (char const *name=nullptr) | |
UniqueID & | operator= (UniqueID const &)=delete |
UniqueID & | operator= (UniqueID &&u) noexcept |
virtual | ~UniqueID ()=default |
void const * | normptr () const noexcept |
uint64_t | id () const noexcept |
string const & | name () const noexcept |
void | setName (string const &name) |
void | setName (char const *name) |
void | setName (string &&name) |
virtual char const * | id_str () const override |
Additional Inherited Members | |
Static Public Member Functions inherited from zth::UniqueID< PollerInterface > | |
static uint64_t | getID () noexcept |
Protected Member Functions inherited from zth::UniqueIDBase | |
virtual | ~UniqueIDBase ()=default |
|
overridevirtualdefault |
Add a Pollable, that belongs to a given client.
client
can be nullptr
.
Implemented in zth::PollerServer< PollItem_ >, and zth::PollerServer< zmq_pollitem_t >.
|
pure virtualnoexcept |
Move all registered Pollables to another server.
Implemented in zth::PollerServer< PollItem_ >, and zth::PollerServer< zmq_pollitem_t >.
|
pure virtualnoexcept |
Poll.
The Pollables with events are not saved in the server, but these are forwarded to the registered Client.
Implemented in zth::PollerServer< PollItem_ >, and zth::PollerServer< zmq_pollitem_t >.
Remove the given Pollable, belonging to the given client.
client
must match the one that was specified during add().
Implemented in zth::PollerServer< PollItem_ >, and zth::PollerServer< zmq_pollitem_t >.