Subscription packet used in the discovery protocol for requesting information about a given topic. More...
#include <ignition/transport/Packet.hh>
Public Member Functions | |
SubscriptionMsg ()=default | |
Constructor. More... | |
SubscriptionMsg (const transport::Header &_header, const std::string &_topic) | |
Constructor. More... | |
transport::Header | Header () const |
Get the message header. More... | |
size_t | MsgLength () const |
Get the total length of the message. More... | |
size_t | Pack (char *_buffer) const |
Serialize the subscription message. More... | |
void | SetHeader (const transport::Header &_header) |
Set the header of the message. More... | |
void | SetTopic (const std::string &_topic) |
Set the topic. More... | |
std::string | Topic () const |
Get the topic. More... | |
size_t | Unpack (const char *_buffer) |
Unserialize a stream of bytes into a Sub. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const SubscriptionMsg &_msg) |
Stream insertion operator. More... | |
Subscription packet used in the discovery protocol for requesting information about a given topic.
|
default |
Constructor.
ignition::transport::SubscriptionMsg::SubscriptionMsg | ( | const transport::Header & | _header, |
const std::string & | _topic | ||
) |
Constructor.
[in] | _header | Message header. |
[in] | _topic | Topic name. |
transport::Header ignition::transport::SubscriptionMsg::Header | ( | ) | const |
size_t ignition::transport::SubscriptionMsg::MsgLength | ( | ) | const |
Get the total length of the message.
Referenced by ignition::transport::Discovery< Pub >::WaitForInit().
size_t ignition::transport::SubscriptionMsg::Pack | ( | char * | _buffer | ) | const |
Serialize the subscription message.
[out] | _buffer | Buffer where the message will be serialized. |
Referenced by ignition::transport::Discovery< Pub >::WaitForInit().
void ignition::transport::SubscriptionMsg::SetHeader | ( | const transport::Header & | _header | ) |
void ignition::transport::SubscriptionMsg::SetTopic | ( | const std::string & | _topic | ) |
std::string ignition::transport::SubscriptionMsg::Topic | ( | ) | const |
Get the topic.
Referenced by ignition::transport::Discovery< Pub >::WaitForInit().
size_t ignition::transport::SubscriptionMsg::Unpack | ( | const char * | _buffer | ) |
Unserialize a stream of bytes into a Sub.
[out] | _buffer | Unpack the body from the buffer. |
Referenced by ignition::transport::Discovery< Pub >::WaitForInit().
|
friend |
Stream insertion operator.
[out] | _out | The output stream. |
[in] | _msg | SubscriptionMsg message to write to the stream. |