SubscriptionMsg Class Reference
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. | |
| SubscriptionMsg (const transport::Header &_header, const std::string &_topic) | |
| Constructor. | |
| transport::Header | Header () const |
| Get the message header. | |
| size_t | MsgLength () const |
| Get the total length of the message. | |
| size_t | Pack (char *_buffer) const |
| Serialize the subscription message. | |
| void | SetHeader (const transport::Header &_header) |
| Set the header of the message. | |
| void | SetTopic (const std::string &_topic) |
| Set the topic. | |
| std::string | Topic () const |
| Get the topic. | |
| size_t | Unpack (const char *_buffer) |
| Unserialize a stream of bytes into a Sub. | |
Detailed Description
Subscription packet used in the discovery protocol for requesting information about a given topic.
Constructor & Destructor Documentation
◆ SubscriptionMsg() [1/2]
|
default |
Constructor.
Referenced by operator<<.
◆ SubscriptionMsg() [2/2]
| SubscriptionMsg | ( | const transport::Header & | _header, |
| const std::string & | _topic ) |
Constructor.
- Parameters
-
[in] _header Message header. [in] _topic Topic name.
References ignition::transport::_topic.
Member Function Documentation
◆ Header()
| transport::Header Header | ( | ) | const |
Get the message header.
- Returns
- Reference to the message header.
- See also
- SetHeader.
Referenced by operator<<.
◆ MsgLength()
| size_t MsgLength | ( | ) | const |
Get the total length of the message.
- Returns
- Return the length of the message in bytes.
◆ Pack()
| size_t Pack | ( | char * | _buffer | ) | const |
Serialize the subscription message.
- Parameters
-
[out] _buffer Buffer where the message will be serialized.
- Returns
- The length of the serialized message in bytes.
◆ SetHeader()
| void SetHeader | ( | const transport::Header & | _header | ) |
◆ SetTopic()
| void SetTopic | ( | const std::string & | _topic | ) |
Set the topic.
- Parameters
-
[in] _topic Topic name.
- See also
- Topic.
References ignition::transport::_topic.
◆ Topic()
| std::string Topic | ( | ) | const |
◆ Unpack()
| size_t Unpack | ( | const char * | _buffer | ) |
Unserialize a stream of bytes into a Sub.
- Parameters
-
[out] _buffer Unpack the body from the buffer.
- Returns
- The number of bytes from the body.
The documentation for this class was generated from the following file: