ignition/transport/Publisher.hh
More...
#include <Publisher.hh>
|
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...
|
|
ignition/transport/Publisher.hh
This class stores all the information about a publisher. It stores the topic name that publishes, addresses, UUIDs, scope, etc.
ignition::transport::Publisher::Publisher |
( |
| ) |
|
|
default |
ignition::transport::Publisher::Publisher |
( |
const std::string & |
_topic, |
|
|
const std::string & |
_addr, |
|
|
const std::string & |
_pUuid, |
|
|
const std::string & |
_nUuid, |
|
|
const AdvertiseOptions & |
_opts |
|
) |
| |
Constructor.
- Parameters
-
[in] | _topic | Topic name. |
[in] | _addr | ZeroMQ address. |
[in] | _pUuid | Process UUID. |
[in] | _nUUID | node UUID. |
[in] | _opts | The advertise options. |
ignition::transport::Publisher::Publisher |
( |
const Publisher & |
_other | ) |
|
Copy constructor.
- Parameters
-
virtual ignition::transport::Publisher::~Publisher |
( |
| ) |
|
|
virtualdefault |
std::string ignition::transport::Publisher::Addr |
( |
| ) |
const |
Get the ZeroMQ address of the publisher.
- Returns
- ZeroMQ address.
- See Also
- SetAddr.
virtual size_t ignition::transport::Publisher::MsgLength |
( |
| ) |
const |
|
virtual |
size_t ignition::transport::Publisher::MsgLengthInternal |
( |
| ) |
const |
|
protected |
Get the total length of the message without counting the advertised options.
This is useful when [un]serializing a derived publisher because we want to ignore the advertised options in the base publisher.
- Returns
- Return the length of the message in bytes.
std::string ignition::transport::Publisher::NUuid |
( |
| ) |
const |
Get the node UUID of the publisher.
- Returns
- Node UUID.
- See Also
- SetNUuid.
bool ignition::transport::Publisher::operator!= |
( |
const Publisher & |
_pub | ) |
const |
Inequality operator.
This function checks if the given publisher does not have identical Topic, Addr, PUuid, NUuid, and Scope strings to this object.
- Parameters
-
[in] | _pub | The publisher to compare against. |
- Returns
- True if this object does not match the provided object.
Assignment operator.
- Parameters
-
- Returns
- A reference to this instance.
bool ignition::transport::Publisher::operator== |
( |
const Publisher & |
_pub | ) |
const |
Equality operator.
This function checks if the given publisher has identical Topic, Addr, PUuid, NUuid, and Scope strings to this object.
- Parameters
-
[in] | _pub | The publisher to compare against. |
- Returns
- True if this object matches the provided object.
virtual const AdvertiseOptions& ignition::transport::Publisher::Options |
( |
| ) |
const |
|
virtual |
virtual size_t ignition::transport::Publisher::Pack |
( |
char * |
_buffer | ) |
const |
|
virtual |
size_t ignition::transport::Publisher::PackInternal |
( |
char * |
_buffer | ) |
const |
|
protected |
Serialize all fields except the advertise options.
This is useful when we are serializing a derived class that contains its own advertise options.
std::string ignition::transport::Publisher::PUuid |
( |
| ) |
const |
Get the process UUID of the publisher.
return Process UUID.
- See Also
- SetPUuid.
void ignition::transport::Publisher::SetAddr |
( |
const std::string & |
_addr | ) |
|
Set ZeroMQ address of the publisher.
- Parameters
-
- See Also
- Addr.
void ignition::transport::Publisher::SetNUuid |
( |
const std::string & |
_nUuid | ) |
|
Set the node UUID of the publisher.
- Parameters
-
- See Also
- NUuid.
void ignition::transport::Publisher::SetOptions |
( |
const AdvertiseOptions & |
_opts | ) |
|
Set the advertised options.
- Parameters
-
[in] | _opts | New advertised options. |
- See Also
- Options.
void ignition::transport::Publisher::SetPUuid |
( |
const std::string & |
_pUuid | ) |
|
Set the process UUID of the publisher.
- Parameters
-
[in] | _pUuid | New process UUID. |
- See Also
- PUuid.
void ignition::transport::Publisher::SetTopic |
( |
const std::string & |
_topic | ) |
|
Set the topic name published by this publisher.
- Parameters
-
[in] | _topic | New topic name. |
- See Also
- Topic.
std::string ignition::transport::Publisher::Topic |
( |
| ) |
const |
Get the topic published by this publisher.
- Returns
- Topic name.
- See Also
- SetTopic.
virtual size_t ignition::transport::Publisher::Unpack |
( |
const char * |
_buffer | ) |
|
|
virtual |
size_t ignition::transport::Publisher::UnpackInternal |
( |
const char * |
_buffer | ) |
|
|
protected |
Unserialize all fields except the advertise options.
This is useful when we are unserializing a derived class that contains its own advertise options.
std::ostream& operator<< |
( |
std::ostream & |
_out, |
|
|
const Publisher & |
_msg |
|
) |
| |
|
friend |
Stream insertion operator.
- Parameters
-
[out] | _out | The output stream. |
[in] | _msg | Publisher to write to the stream. |
std::string ignition::transport::Publisher::addr |
|
protected |
ZeroMQ address of the publisher.
std::string ignition::transport::Publisher::nUuid |
|
protected |
Node UUID of the publisher.
std::string ignition::transport::Publisher::pUuid |
|
protected |
Process UUID of the publisher.
std::string ignition::transport::Publisher::topic |
|
protected |
The documentation for this class was generated from the following file: