9 #ifndef RAD_TOPIC_SUB_HPP
10 #define RAD_TOPIC_SUB_HPP
12 #include <rad/TopicHandler.hpp>
14 #include <azmq/socket.hpp>
15 #include <azmq/message.hpp>
17 #include <boost/asio.hpp>
31 using TopicHandler_t = std::function<void (const std::string&, const void*, size_t)>;
34 TopicSub(boost::asio::io_service& ios, std::unique_ptr<TopicHandler>&& fallback);
37 void Subscribe(
const std::string& topicName);
41 void Connect(
const std::string& endpoint);
54 azmq::sub_socket mSocket;
55 std::unique_ptr<TopicHandler> mFallbackHandler;
void Subscribe(const std::string &topicName)
Definition: TopicSub.cpp:54
TopicSub(boost::asio::io_service &ios, std::unique_ptr< TopicHandler > &&fallback)
Definition: TopicSub.cpp:26
void Flush()
Definition: TopicSub.cpp:129
Definition: TopicSub.hpp:28
std::function< void(const std::string &, const void *, size_t)> TopicHandler_t
Definition: TopicSub.hpp:31
optional string msg
Definition: topics.proto:7
void Connect(const std::string &endpoint)
Definition: TopicSub.cpp:95
std::unordered_map< std::string, TopicHandler_t > TopicHandlerMap_t
Definition: TopicSub.hpp:32
def handler
Definition: test_dispatcher.py:11
optional int32 error_code
Definition: topics.proto:14
TopicSub & operator=(const TopicSub &)=delete
void Unsubscribe(const std::string &topicName)
Definition: TopicSub.cpp:81
~TopicSub()
Definition: TopicSub.cpp:36
void Disconnect(const std::string &endpoint)
Definition: TopicSub.cpp:118