15#define ZEROMQPOLLER_H 1
24#include <unordered_map>
28 using entry_t = std::tuple<size_t, zmq::event_flags, const zmq::socket_t *>;
31 using sockets_t = std::unordered_map<void *, entry_t>;
34 using fds_t = std::unordered_map<int, fd_entry_t>;
40 std::vector<std::pair<size_t, zmq::event_flags>>
poll(
int timeo = -1);
41 std::vector<std::pair<size_t, zmq::event_flags>>
ppoll(
int timeo,
const sigset_t *sigmask);
Wrapper class for polling ZeroMQ sockets.
std::vector< zmq::pollitem_t > m_items
size_t register_socket(zmq::socket_t &socket, zmq::event_flags type)
Register socket to poll.
std::tuple< size_t, zmq::event_flags > fd_entry_t
std::tuple< size_t, zmq::event_flags, const zmq::socket_t * > entry_t
std::vector< std::pair< size_t, zmq::event_flags > > ppoll(int timeo, const sigset_t *sigmask)
Poll the sockets with ppoll.
std::unordered_map< int, fd_entry_t > fds_t
size_t unregister_socket(zmq::socket_t &socket)
Unregister socket from poller.
std::unordered_map< void *, entry_t > sockets_t
std::vector< std::pair< size_t, zmq::event_flags > > poll(int timeo=-1)
Poll the sockets.