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 Scope_t &_scope, const std::string &_msgTypeName) | |
Constructor. More... | |
virtual | ~MessagePublisher ()=default |
Destructor. More... | |
std::string | Ctrl () const |
Get the ZeroMQ control address. More... | |
size_t | MsgLength () const |
std::string | MsgTypeName () const |
Get the message type advertised by this publisher. More... | |
bool | operator!= (const MessagePublisher &_pub) const |
Inequality operator. More... | |
bool | operator== (const MessagePublisher &_pub) const |
Equality operator. More... | |
size_t | Pack (char *_buffer) const |
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... | |
size_t | Unpack (char *_buffer) |
![]() | |
Publisher ()=default | |
Default constructor. More... | |
Publisher (const std::string &_topic, const std::string &_addr, const std::string &_pUuid, const std::string &_nUuid, const Scope_t &_scope) | |
Constructor. More... | |
virtual | ~Publisher ()=default |
Destructor. More... | |
std::string | Addr () const |
Get the ZeroMQ address of the publisher. More... | |
size_t | MsgLength () const |
Get the total length of the message. More... | |
std::string | NUuid () const |
Get the node UUID of the publisher. More... | |
bool | operator!= (const Publisher &_srv) const |
Inequality operator. More... | |
bool | operator== (const Publisher &_pub) const |
Equality operator. More... | |
size_t | Pack (char *_buffer) const |
Serialize the publisher. More... | |
std::string | PUuid () const |
Get the process UUID of the publisher. More... | |
Scope_t | Scope () const |
Get the scope of the publisher's topic. 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 | SetPUuid (const std::string &_pUuid) |
Set the process UUID of the publisher. More... | |
void | SetScope (const Scope_t &_scope) |
Set the scope of the topic advertised by this 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... | |
size_t | Unpack (char *_buffer) |
Unserialize the publisher. More... | |
Protected Attributes | |
std::string | ctrl |
ZeroMQ control address of the publisher. More... | |
std::string | msgTypeName |
Message type advertised by this publisher. 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... | |
Scope_t | scope = Scope_t::ALL |
Scope of the topic advertised by this publisher. More... | |
std::string | topic |
Topic name. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const MessagePublisher &_msg) |
Stream insertion operator. More... | |
ignition/transport/Publisher.hh
This class stores all the information about a message publisher.
|
default |
Default constructor.
ignition::transport::MessagePublisher::MessagePublisher | ( | const std::string & | _topic, |
const std::string & | _addr, | ||
const std::string & | _ctrl, | ||
const std::string & | _pUuid, | ||
const std::string & | _nUuid, | ||
const Scope_t & | _scope, | ||
const std::string & | _msgTypeName | ||
) |
Constructor.
[in] | _topic | Topic name. |
[in] | _addr | ZeroMQ address. |
[in] | _ctrl | ZeroMQ control address. |
[in] | _pUuid | Process UUID. |
[in] | _nUUID | node UUID. |
[in] | _scope | Scope. |
[in] | _msgTypeName | Message type advertised by this publisher. |
|
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.
size_t ignition::transport::MessagePublisher::MsgLength | ( | ) | const |
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. |
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. |
size_t ignition::transport::MessagePublisher::Pack | ( | char * | _buffer | ) | const |
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. |
size_t ignition::transport::MessagePublisher::Unpack | ( | char * | _buffer | ) |
|
friend |
Stream insertion operator.
[out] | _out | The output stream. |
[in] | _msg | MessagePublisher to write to the stream. |
|
protected |
ZeroMQ control address of the publisher.
|
protected |
Message type advertised by this publisher.