Go to the documentation of this file.
9 #ifndef RAD_TOPIC_SUB_HPP
10 #define RAD_TOPIC_SUB_HPP
12 #include <rad/topicHandler.hpp>
14 #include <azmq/message.hpp>
15 #include <azmq/socket.hpp>
17 #include <boost/asio.hpp>
30 using TopicHandler_t = std::function<void(
const std::string&,
const void*,
size_t)>;
33 TopicSub(boost::asio::io_service& ios, std::unique_ptr<TopicHandler>&& fallback);
36 void Subscribe(
const std::string& topic_name);
40 void Connect(
const std::string& endpoint);
51 void Callback(boost::system::error_code
const& error_code, azmq::message& msg,
size_t nbytes);
53 azmq::sub_socket m_socket;
54 std::unique_ptr<TopicHandler> m_fallback_handler;
60 #endif // RAD_TOPIC_SUB_HPP
Definition: topicSub.hpp:28
TopicSub(boost::asio::io_service &ios, std::unique_ptr< TopicHandler > &&fallback)
Definition: topicSub.cpp:27
def handler(event)
Definition: test_dispatcher.py:11
void Flush()
Definition: topicSub.cpp:119
~TopicSub()
Definition: topicSub.cpp:35
TopicSub(TopicSub &&rhs)=default
void Connect(const std::string &endpoint)
Definition: topicSub.cpp:85
Definition: actionCallback.hpp:21
void Disconnect(const std::string &endpoint)
Definition: topicSub.cpp:109
void Unsubscribe(const std::string &topic_name)
Definition: topicSub.cpp:74
std::unordered_map< std::string, TopicHandler_t > TopicHandlerMap_t
Definition: topicSub.hpp:31
TopicSub & operator=(const TopicSub &)=delete
TopicSub(const TopicSub &)=delete
void Subscribe(const std::string &topic_name)
Definition: topicSub.cpp:52
std::function< void(const std::string &, const void *, size_t)> TopicHandler_t
Definition: topicSub.hpp:30