rad
2.0.0
|
#include <topicSub.hpp>
Public Types | |
using | TopicHandler_t = std::function< void(const std::string &, const void *, size_t)> |
using | TopicHandlerMap_t = std::unordered_map< std::string, TopicHandler_t > |
using | TopicHandler_t = std::function< void(const std::string &, const void *, size_t)> |
using | TopicHandlerMap_t = std::unordered_map< std::string, TopicHandler_t > |
Public Member Functions | |
TopicSub (boost::asio::io_service &ios, std::unique_ptr< TopicHandler > &&fallback) | |
~TopicSub () | |
void | Subscribe (const std::string &topic_name) |
void | Subscribe (const std::string &topic_name, TopicHandler_t handler) |
void | Unsubscribe (const std::string &topic_name) |
void | Connect (const std::string &endpoint) |
void | Disconnect (const std::string &endpoint) |
void | Flush () |
TopicSub (const TopicSub &)=delete | |
TopicSub & | operator= (const TopicSub &)=delete |
TopicSub (TopicSub &&rhs)=default | |
TopicSub (boost::asio::io_service &ios, std::unique_ptr< TopicHandler > &&fallback) | |
~TopicSub () | |
void | Subscribe (const std::string &topic_name) |
void | Subscribe (const std::string &topic_name, TopicHandler_t handler) |
void | Unsubscribe (const std::string &topic_name) |
void | Connect (const std::string &endpoint) |
void | Disconnect (const std::string &endpoint) |
void | Flush () |
TopicSub (const TopicSub &)=delete | |
TopicSub & | operator= (const TopicSub &)=delete |
TopicSub (TopicSub &&rhs)=default | |
Class to subscribe and receive topics.
Class to subscribe and receive topics.
using rad::TopicSub::TopicHandler_t = std::function<void(const std::string&, const void*, size_t)> |
using rad::TopicSub::TopicHandler_t = std::function<void(const std::string&, const void*, size_t)> |
using rad::TopicSub::TopicHandlerMap_t = std::unordered_map<std::string, TopicHandler_t> |
using rad::TopicSub::TopicHandlerMap_t = std::unordered_map<std::string, TopicHandler_t> |
rad::TopicSub::TopicSub | ( | boost::asio::io_service & | ios, |
std::unique_ptr< TopicHandler > && | fallback | ||
) |
[in] | ios | Reference to the event loop. |
[in] | fallback | Map of handlers for given topics. |
rad::TopicSub::~TopicSub | ( | ) |
|
delete |
|
default |
rad::TopicSub::TopicSub | ( | boost::asio::io_service & | ios, |
std::unique_ptr< TopicHandler > && | fallback | ||
) |
rad::TopicSub::~TopicSub | ( | ) |
|
delete |
|
default |
void rad::TopicSub::Connect | ( | const std::string & | endpoint | ) |
Connect the socket to an endpoint to receive topics.
[in] | endpoint | Where to get the topics from. |
void rad::TopicSub::Connect | ( | const std::string & | endpoint | ) |
void rad::TopicSub::Disconnect | ( | const std::string & | endpoint | ) |
Disconnect the socket from an endpoint.
[in] | endpoint | Where to get the topics from. |
void rad::TopicSub::Disconnect | ( | const std::string & | endpoint | ) |
void rad::TopicSub::Flush | ( | ) |
void rad::TopicSub::Flush | ( | ) |
Flush the socket buffers from topics.
void rad::TopicSub::Subscribe | ( | const std::string & | topic_name | ) |
void rad::TopicSub::Subscribe | ( | const std::string & | topic_name | ) |
Subscribe to a topic.
[in] | topic_name | Topic to subscribe. |
void rad::TopicSub::Subscribe | ( | const std::string & | topic_name, |
TopicHandler_t | handler | ||
) |
void rad::TopicSub::Subscribe | ( | const std::string & | topic_name, |
TopicHandler_t | handler | ||
) |
Subscribe to a topic.
[in] | topic_name | Topic to subscribe. |
[in] | handler | Handler for the subscribed topic_name. |
void rad::TopicSub::Unsubscribe | ( | const std::string & | topic_name | ) |
Unsubscribe a topic.
[in] | topic_name | Topic to unsubscribe. |
void rad::TopicSub::Unsubscribe | ( | const std::string & | topic_name | ) |