ignition/transport/Publisher.hh More...
#include <Publisher.hh>
Public Member Functions | |
ServicePublisher ()=default | |
Default constructor. More... | |
ServicePublisher (const std::string &_topic, const std::string &_addr, const std::string &_id, const std::string &_pUuid, const std::string &_nUuid, const std::string &_reqType, const std::string &_repType, const AdvertiseServiceOptions &_opts) | |
Constructor. More... | |
ServicePublisher (const ServicePublisher &_other) | |
Copy constructor. More... | |
virtual | ~ServicePublisher ()=default |
Destructor. More... | |
size_t | MsgLength () const |
Get the total length of the message. More... | |
bool | operator!= (const ServicePublisher &_srv) const |
Inequality operator. More... | |
bool | operator== (const ServicePublisher &_srv) const |
Equality operator. More... | |
virtual const AdvertiseServiceOptions & | Options () const |
Get the advertised options. More... | |
size_t | Pack (char *_buffer) const |
Serialize the publisher. More... | |
std::string | RepTypeName () const |
Get the name of the response's protobuf message advertised. More... | |
std::string | ReqTypeName () const |
Get the name of the request's protobuf message advertised. More... | |
void | SetOptions (const AdvertiseServiceOptions &_opts) |
Set the advertised options. More... | |
void | SetRepTypeName (const std::string &_repTypeName) |
Set the name of the response's protobuf message advertised. More... | |
void | SetReqTypeName (const std::string &_reqTypeName) |
Set the name of the request's protobuf message advertised. More... | |
void | SetSocketId (const std::string &_socketId) |
Set the ZeroMQ socket ID for this publisher. More... | |
std::string | SocketId () const |
Get the ZeroMQ socket ID used by this publisher. More... | |
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 ServicePublisher &_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 service publisher.
|
default |
Default constructor.
ignition::transport::ServicePublisher::ServicePublisher | ( | const std::string & | _topic, |
const std::string & | _addr, | ||
const std::string & | _id, | ||
const std::string & | _pUuid, | ||
const std::string & | _nUuid, | ||
const std::string & | _reqType, | ||
const std::string & | _repType, | ||
const AdvertiseServiceOptions & | _opts | ||
) |
Constructor.
[in] | _topic | Topic name. |
[in] | _addr | ZeroMQ address. |
[in] | _id | ZeroMQ socket ID. |
[in] | _pUuid | Process UUID. |
[in] | _nUUID | node UUID. |
[in] | _reqType | Message type used in the service request. |
[in] | _repType | Message type used in the service response. |
[in] | _opts | Advertise options. |
ignition::transport::ServicePublisher::ServicePublisher | ( | const ServicePublisher & | _other | ) |
Copy constructor.
[in] | _other | Other ServicePublisher object. |
|
virtualdefault |
Destructor.
|
virtual |
Get the total length of the message.
Reimplemented from ignition::transport::Publisher.
bool ignition::transport::ServicePublisher::operator!= | ( | const ServicePublisher & | _srv | ) | const |
Inequality operator.
This function checks if the given service does not have identical Topic, Addr, PUuid, NUuid, Scope, SocketId, ReqTypeName, RepTypeName strings to this object.
[in] | _srv | The service publisher to compare against. |
bool ignition::transport::ServicePublisher::operator== | ( | const ServicePublisher & | _srv | ) | const |
Equality operator.
This function checks if the given service has identical Topic, Addr, PUuid, NUuid, Scope, SocketId, ReqTypeName, RepTypeName strings to this object.
[in] | _srv | The service 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.
std::string ignition::transport::ServicePublisher::RepTypeName | ( | ) | const |
Get the name of the response's protobuf message advertised.
std::string ignition::transport::ServicePublisher::ReqTypeName | ( | ) | const |
Get the name of the request's protobuf message advertised.
void ignition::transport::ServicePublisher::SetOptions | ( | const AdvertiseServiceOptions & | _opts | ) |
void ignition::transport::ServicePublisher::SetRepTypeName | ( | const std::string & | _repTypeName | ) |
Set the name of the response's protobuf message advertised.
[in] | _repTypeName | The protobuf message type. |
void ignition::transport::ServicePublisher::SetReqTypeName | ( | const std::string & | _reqTypeName | ) |
Set the name of the request's protobuf message advertised.
[in] | _reqTypeName | The protobuf message type. |
void ignition::transport::ServicePublisher::SetSocketId | ( | const std::string & | _socketId | ) |
Set the ZeroMQ socket ID for this publisher.
[in] | _socketId | New socket ID. |
std::string ignition::transport::ServicePublisher::SocketId | ( | ) | const |
|
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 | ServicePublisher to write to the stream. |