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 Scope_t &_scope, const std::string &_reqType, const std::string &_repType) | |
Constructor. More... | |
virtual | ~ServicePublisher ()=default |
Destructor. More... | |
size_t | MsgLength () const |
bool | operator!= (const ServicePublisher &_srv) const |
Inequality operator. More... | |
bool | operator== (const ServicePublisher &_srv) const |
Equality operator. More... | |
size_t | Pack (char *_buffer) const |
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 | 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 (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 | socketId |
ZeroMQ socket ID used 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 ServicePublisher &_msg) |
Stream insertion operator. 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 Scope_t & | _scope, | ||
const std::string & | _reqType, | ||
const std::string & | _repType | ||
) |
Constructor.
[in] | _topic | Topic name. |
[in] | _addr | ZeroMQ address. |
[in] | _id | ZeroMQ socket ID. |
[in] | _pUuid | Process UUID. |
[in] | _nUUID | node UUID. |
[in] | _scope | Scope. |
[in] | _reqType | Message type used in the service request. |
[in] | _repType | Message type used in the service response. |
|
virtualdefault |
Destructor.
size_t ignition::transport::ServicePublisher::MsgLength | ( | ) | const |
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. |
size_t ignition::transport::ServicePublisher::Pack | ( | char * | _buffer | ) | const |
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::SetRepTypeName | ( | const std::string & | _repTypeName | ) |
Set the name of the response's protobuf message advertised.
[in] | The | protobuf message type. |
void ignition::transport::ServicePublisher::SetReqTypeName | ( | const std::string & | _reqTypeName | ) |
Set the name of the request's protobuf message advertised.
[in] | 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 |
size_t ignition::transport::ServicePublisher::Unpack | ( | char * | _buffer | ) |
|
friend |
Stream insertion operator.
[out] | _out | The output stream. |
[in] | _msg | ServicePublisher to write to the stream. |
|
protected |
ZeroMQ socket ID used by this publisher.