6 #ifndef FAULT_SOCKETS_SUBSCRIBE_SOCKET_HPP 7 #define FAULT_SOCKETS_SUBSCRIBE_SOCKET_HPP 11 #include <boost/function.hpp> 12 #include <core/parallel/pthread_tools.hpp> 13 #include <core/system/nanosockets/zmq_msg_vector.hpp> 14 #include <core/export.hpp> 40 typedef boost::function<void(const std::string& message)> callback_type;
59 void connect(std::string endpoint);
64 void disconnect(std::string endpoint);
70 void subscribe(std::string topic);
75 void unsubscribe(std::string topic);
77 bool unsubscribe_all();
83 volatile bool shutting_down =
false;
85 std::map<std::string, size_t> publishers;
87 callback_type callback;
88 std::set<std::string> topics;
93 void thread_function();