A class for customizing the publication options for a topic advertised. More...
#include <AdvertiseOptions.hh>
Public Member Functions | |
AdvertiseMessageOptions () | |
Constructor. More... | |
AdvertiseMessageOptions (const AdvertiseMessageOptions &_other) | |
Copy constructor. More... | |
virtual | ~AdvertiseMessageOptions () |
Destructor. More... | |
size_t | MsgLength () const |
Get the total length of the message. More... | |
uint64_t | MsgsPerSec () const |
Get the maximum number of messages per second to be published. More... | |
bool | operator!= (const AdvertiseMessageOptions &_other) const |
Inequality operator. More... | |
AdvertiseMessageOptions & | operator= (const AdvertiseMessageOptions &_other) |
Assignment operator. More... | |
bool | operator== (const AdvertiseMessageOptions &_other) const |
Equality operator. More... | |
size_t | Pack (char *_buffer) const |
Serialize the options. More... | |
void | SetMsgsPerSec (const uint64_t _newMsgsPerSec) |
Set the maximum number of messages per second to be published. More... | |
bool | Throttled () const |
Whether the publication has been throttled. More... | |
size_t | Unpack (const char *_buffer) |
Unserialize the options. More... | |
![]() | |
AdvertiseOptions () | |
Constructor. More... | |
AdvertiseOptions (const AdvertiseOptions &_other) | |
Copy constructor. More... | |
virtual | ~AdvertiseOptions () |
Destructor. More... | |
size_t | MsgLength () const |
Get the total length of the message. More... | |
bool | operator!= (const AdvertiseOptions &_other) const |
Inequality operator. More... | |
AdvertiseOptions & | operator= (const AdvertiseOptions &_other) |
Assignment operator. More... | |
bool | operator== (const AdvertiseOptions &_other) const |
Equality operator. More... | |
size_t | Pack (char *_buffer) const |
Serialize the options. More... | |
const Scope_t & | Scope () const |
Get the scope used in this topic/service. More... | |
void | SetScope (const Scope_t &_scope) |
Set the scope of the topic or service. More... | |
size_t | Unpack (const char *_buffer) |
Deserialize and set the options. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const AdvertiseMessageOptions &_other) |
Stream insertion operator. More... | |
A class for customizing the publication options for a topic advertised.
E.g.: Set the rate of messages per second published.
ignition::transport::AdvertiseMessageOptions::AdvertiseMessageOptions | ( | ) |
Constructor.
ignition::transport::AdvertiseMessageOptions::AdvertiseMessageOptions | ( | const AdvertiseMessageOptions & | _other | ) |
Copy constructor.
[in] | _other | AdvertiseMessageOptions to copy. |
|
virtual |
Destructor.
size_t ignition::transport::AdvertiseMessageOptions::MsgLength | ( | ) | const |
Get the total length of the message.
uint64_t ignition::transport::AdvertiseMessageOptions::MsgsPerSec | ( | ) | const |
Get the maximum number of messages per second to be published.
bool ignition::transport::AdvertiseMessageOptions::operator!= | ( | const AdvertiseMessageOptions & | _other | ) | const |
Inequality operator.
This function checks if the given options do not have identical values to this object.
[in] | _other | The options to compare against. |
AdvertiseMessageOptions& ignition::transport::AdvertiseMessageOptions::operator= | ( | const AdvertiseMessageOptions & | _other | ) |
Assignment operator.
[in] | _other | The other AdvertiseMessageOptions. |
bool ignition::transport::AdvertiseMessageOptions::operator== | ( | const AdvertiseMessageOptions & | _other | ) | const |
Equality operator.
This function checks if the given AdvertiseMessageOptions has identical content to this object.
[in] | _other | The options to compare against. |
size_t ignition::transport::AdvertiseMessageOptions::Pack | ( | char * | _buffer | ) | const |
Serialize the options.
The caller has ownership of the buffer and is responsible for its [de]allocation.
[out] | _buffer | Destination buffer in which the options will be serialized. |
void ignition::transport::AdvertiseMessageOptions::SetMsgsPerSec | ( | const uint64_t | _newMsgsPerSec | ) |
Set the maximum number of messages per second to be published.
Note that we calculate the minimum period of a message based on the msgs/sec rate. Any message sent since the last Publish() and the duration of the period will be discarded.
[in] | _newMsgsPerSec | Maximum number of messages per second. |
bool ignition::transport::AdvertiseMessageOptions::Throttled | ( | ) | const |
Whether the publication has been throttled.
size_t ignition::transport::AdvertiseMessageOptions::Unpack | ( | const char * | _buffer | ) |
Unserialize the options.
[in] | _buffer | Input buffer with the data to be unserialized. |
|
friend |
Stream insertion operator.
[out] | _out | The output stream. |
[in] | _other | AdvertiseMessageOptions to write to the stream. |