Go to the documentation of this file.
18 #ifndef _PUBLICATIONTRANSPORT_HH_
19 #define _PUBLICATIONTRANSPORT_HH_
21 #include <boost/function.hpp>
22 #include <boost/shared_ptr.hpp>
46 const std::string &_msgType);
62 public:
void AddCallback(
63 const boost::function<
void(
const std::string &)> &_cb);
71 public: std::string GetTopic()
const;
75 public: std::string GetMsgType()
const;
79 private:
void OnPublish(
const std::string &_data);
82 private: std::string topic;
85 private: std::string msgType;
91 private: boost::function<void (
const std::string &)> callback;
94 private:
static int counter;
virtual ~PublicationTransport()
Destructor.
const ConnectionPtr GetConnection() const
Get the underlying connection.
Forward declarations for the common classes.
Definition: Animation.hh:26
void AddCallback(const boost::function< void(const std::string &)> &_cb)
Add a callback to the transport.
void Init(const ConnectionPtr &_conn, bool _latched)
Initialize the transport.
std::string GetMsgType() const
Get the topic type.
std::string GetTopic() const
Get the topic name.
Reads data from a remote advertiser, and passes the data along to local subscribers.
Definition: PublicationTransport.hh:40
PublicationTransport(const std::string &_topic, const std::string &_msgType)
Constructor.
boost::shared_ptr< Connection > ConnectionPtr
Definition: Connection.hh:50
void Fini()
Finalize the transport.
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
transport
Definition: ConnectionManager.hh:35