ignition/transport/Publisher.hh More...
#include <Publisher.hh>
Public Member Functions | |
MessagePublisher ()=default | |
Default constructor. More... | |
MessagePublisher (const std::string &_topic, const std::string &_addr, const std::string &_ctrl, const std::string &_pUuid, const std::string &_nUuid, const std::string &_msgTypeName, const AdvertiseMessageOptions &_opts) | |
Constructor. More... | |
MessagePublisher (const MessagePublisher &_other) | |
Copy constructor. More... | |
virtual | ~MessagePublisher ()=default |
Destructor. More... | |
std::string | Ctrl () const |
Get the ZeroMQ control address. More... | |
virtual size_t | MsgLength () const |
Get the total length of the message. More... | |
std::string | MsgTypeName () const |
Get the message type advertised by this publisher. More... | |
bool | operator!= (const MessagePublisher &_pub) const |
Inequality operator. More... | |
MessagePublisher & | operator= (const MessagePublisher &_other) |
Assignment operator. More... | |
bool | operator== (const MessagePublisher &_pub) const |
Equality operator. More... | |
virtual const AdvertiseMessageOptions & | Options () const |
Get the advertised options. More... | |
virtual size_t | Pack (char *_buffer) const |
Serialize the publisher. More... | |
void | SetCtrl (const std::string &_ctrl) |
Set the ZeroMQ control address of the publisher. More... | |
void | SetMsgTypeName (const std::string &_msgTypeName) |
Set the message type advertised by this publisher. More... | |
void | SetOptions (const AdvertiseMessageOptions &_opts) |
Set the advertised options. More... | |
virtual size_t | Unpack (const char *_buffer) |
Unserialize the publisher. More... | |
![]() | |
Publisher ()=default | |
Default constructor. More... | |
Publisher (const std::string &_topic, const std::string &_addr, const std::string &_pUuid, const std::string &_nUuid, const AdvertiseOptions &_opts) | |
Constructor. More... | |
Publisher (const Publisher &_other) | |
Copy constructor. More... | |
virtual | ~Publisher ()=default |
Destructor. More... | |
std::string | Addr () const |
Get the ZeroMQ address of the publisher. More... | |
std::string | NUuid () const |
Get the node UUID of the publisher. More... | |
bool | operator!= (const Publisher &_pub) const |
Inequality operator. More... | |
Publisher & | operator= (const Publisher &_other) |
Assignment operator. More... | |
bool | operator== (const Publisher &_pub) const |
Equality operator. More... | |
std::string | PUuid () const |
Get the process UUID of the publisher. More... | |
void | SetAddr (const std::string &_addr) |
Set ZeroMQ address of the publisher. More... | |
void | SetNUuid (const std::string &_nUuid) |
Set the node UUID of the publisher. More... | |
void | SetOptions (const AdvertiseOptions &_opts) |
Set the advertised options. More... | |
void | SetPUuid (const std::string &_pUuid) |
Set the process UUID of the publisher. More... | |
void | SetTopic (const std::string &_topic) |
Set the topic name published by this publisher. More... | |
std::string | Topic () const |
Get the topic published by this publisher. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const MessagePublisher &_msg) |
Stream insertion operator. More... | |
Additional Inherited Members | |
![]() | |
size_t | MsgLengthInternal () const |
Get the total length of the message without counting the advertised options. More... | |
size_t | PackInternal (char *_buffer) const |
Serialize all fields except the advertise options. More... | |
size_t | UnpackInternal (const char *_buffer) |
Unserialize all fields except the advertise options. More... | |
![]() | |
std::string | addr |
ZeroMQ address of the publisher. More... | |
std::string | nUuid |
Node UUID of the publisher. More... | |
std::string | pUuid |
Process UUID of the publisher. More... | |
std::string | topic |
Topic name. More... | |
ignition/transport/Publisher.hh
This class stores all the information about a message publisher.
|
default |
Default constructor.
|
explicit |
Constructor.
[in] | _topic | Topic name. |
[in] | _addr | ZeroMQ address. |
[in] | _ctrl | ZeroMQ control address. |
[in] | _pUuid | Process UUID. |
[in] | _nUUID | node UUID. |
[in] | _msgTypeName | Message type advertised by this publisher. |
[in] | _opts | Advertise options. |
ignition::transport::MessagePublisher::MessagePublisher | ( | const MessagePublisher & | _other | ) |
Copy constructor.
[in] | _other | Other MessagePublisher object. |
|
virtualdefault |
Destructor.
std::string ignition::transport::MessagePublisher::Ctrl | ( | ) | const |
Get the ZeroMQ control address.
This address is used by the subscribers to notify the publisher about the new subscription.
|
virtual |
Get the total length of the message.
Reimplemented from ignition::transport::Publisher.
std::string ignition::transport::MessagePublisher::MsgTypeName | ( | ) | const |
Get the message type advertised by this publisher.
bool ignition::transport::MessagePublisher::operator!= | ( | const MessagePublisher & | _pub | ) | const |
Inequality operator.
This function checks if the given message publisher does not have identical Topic, Addr, PUuid, NUuid, Scope, Ctrl, and MsgTypeName strings to this object.
[in] | _pub | The message publisher to compare against. |
MessagePublisher& ignition::transport::MessagePublisher::operator= | ( | const MessagePublisher & | _other | ) |
Assignment operator.
[in] | _other | The other MessagePublisher. |
bool ignition::transport::MessagePublisher::operator== | ( | const MessagePublisher & | _pub | ) | const |
Equality operator.
This function checks if the given message publisher has identical Topic, Addr, PUuid, NUuid, Scope, Ctrl, and MsgTypeName strings to this object.
[in] | _pub | The message publisher to compare against. |
|
virtual |
Get the advertised options.
Reimplemented from ignition::transport::Publisher.
|
virtual |
Serialize the publisher.
The caller has ownership of the buffer and is responsible for its [de]allocation.
[out] | _buffer | Destination buffer in which the publisher will be serialized. |
Reimplemented from ignition::transport::Publisher.
void ignition::transport::MessagePublisher::SetCtrl | ( | const std::string & | _ctrl | ) |
Set the ZeroMQ control address of the publisher.
[in] | _ctrl | New control address. |
void ignition::transport::MessagePublisher::SetMsgTypeName | ( | const std::string & | _msgTypeName | ) |
Set the message type advertised by this publisher.
[in] | _msgTypeName | New message type. |
void ignition::transport::MessagePublisher::SetOptions | ( | const AdvertiseMessageOptions & | _opts | ) |
|
virtual |
Unserialize the publisher.
[in] | _buffer | Input buffer with the data to be unserialized. |
Reimplemented from ignition::transport::Publisher.
|
friend |
Stream insertion operator.
[out] | _out | The output stream. |
[in] | _msg | MessagePublisher to write to the stream. |