zmqpp
4.1.2
C++ bindings for 0mq (libzmq)
|
Go to the documentation of this file.
12 #include <unordered_map>
156 void add(
const zmq_pollitem_t &item,
Callable callable);
159 std::vector<PollItemCallablePair>
items_;
void flush_remove_later()
Flush the fdRemoveLater_ and sockRemoveLater_ vector, effectively removing the item for the reactor a...
Definition: reactor.cpp:150
@ wait_forever
Definition: poller.hpp:40
C++ wrapper around zmq.
Definition: actor.cpp:30
bool dispatching_
Definition: reactor.hpp:170
void check_for(socket_t const &socket, short const event)
Update the monitored event flags for a given socket.
Definition: reactor.cpp:101
std::vector< PollItemCallablePair > items_
Definition: reactor.hpp:159
reactor()
Construct an empty polling model.
Definition: reactor.cpp:24
Reactor object that helps to manage multiple socket by calling a user-defined handler for each socket...
Definition: reactor.hpp:33
The socket class represents the zmq sockets.
Definition: socket.hpp:76
socket socket_t
socket type
Definition: loop.hpp:25
std::vector< const socket_t * > sockRemoveLater_
Definition: reactor.hpp:160
void remove(socket_t const &socket)
Stop monitoring a socket.
Definition: reactor.cpp:63
bool has(socket_t const &socket)
Check if we are monitoring a given socket with this reactor.
Definition: reactor.cpp:53
void add(socket_t &socket, Callable callable, short const event=poller::poll_in)
Add a socket to the reactor, providing a handler that will be called when the monitored events occur.
Definition: reactor.cpp:34
@ poll_error
Definition: poller.hpp:47
bool poll(long timeout=poller::wait_forever)
Poll for monitored events and call associated handler when needed.
Definition: reactor.cpp:111
std::pair< zmq_pollitem_t, Callable > PollItemCallablePair
Definition: reactor.hpp:36
Polling wrapper.
Definition: poller.hpp:37
poller & get_poller()
Get a reference to the underlying poller object used by the reactor.
Definition: reactor.cpp:140
@ poll_in
Definition: poller.hpp:45
poller poller_
Definition: reactor.hpp:169
~reactor()
Cleanup reactor.
Definition: reactor.cpp:30
std::vector< raw_socket_t > fdRemoveLater_
Definition: reactor.hpp:161
short events(socket_t const &socket) const
Get the event flags triggered for a socket.
Definition: reactor.cpp:130
int raw_socket_t
Definition: compatibility.hpp:134
std::function< void(void) > Callable
Definition: reactor.hpp:35