20 #include "cppzmq/zmq_addon.hpp"
29 enum class socket_ops {
38 using socketOperation =
39 std::pair<socket_ops, std::string>;
45 zmq::socket_type
type = zmq::socket_type::sub;
46 std::vector<socketOperation>
ops;
47 std::function<void(
const zmq::multipart_t& res)>
callback;
49 name(std::move(socketName)) {}
51 name(std::move(socketName)),
type(stype)
54 inline void addOperation(socket_ops op,
const std::string& desc) {
ops.emplace_back(op, desc); }
55 zmq::socket_t makeSocket(zmq::context_t& ctx)
const;
56 std::unique_ptr<zmq::socket_t> makeSocketPtr(zmq::context_t& ctx)
const;
57 void modifySocket(zmq::socket_t& sock)
const;
Definition: zmqSocketDescriptor.h:42
std::function< void(const zmq::multipart_t &res)> callback
the message handler
Definition: zmqSocketDescriptor.h:47
zmq::socket_type type
the socket type
Definition: zmqSocketDescriptor.h:45
std::string name
name of the socket for later reference
Definition: zmqSocketDescriptor.h:44
std::vector< socketOperation > ops
a list of connections of make through bind
Definition: zmqSocketDescriptor.h:46