18 #ifndef __IGN_TRANSPORT_MESSAGEPUBLISHER_HH_INCLUDED__ 19 #define __IGN_TRANSPORT_MESSAGEPUBLISHER_HH_INCLUDED__ 46 public:
Publisher(
const std::string &_topic,
47 const std::string &_addr,
48 const std::string &_pUuid,
49 const std::string &_nUuid,
58 public: std::string Topic()
const;
63 public: std::string Addr()
const;
68 public: std::string PUuid()
const;
73 public: std::string NUuid()
const;
83 public:
void SetTopic(
const std::string &_topic);
88 public:
void SetAddr(
const std::string &_addr);
93 public:
void SetPUuid(
const std::string &_pUuid);
98 public:
void SetNUuid(
const std::string &_nUuid);
103 public:
void SetScope(
const Scope_t &_scope);
110 public:
size_t Pack(
char *_buffer)
const;
114 public:
size_t Unpack(
char *_buffer);
118 public:
size_t MsgLength()
const;
125 public:
bool operator==(
const Publisher &_pub)
const;
132 public:
bool operator!=(
const Publisher &_srv)
const;
140 _out <<
"Publisher:" << std::endl
141 <<
"\tTopic: [" << _msg.
Topic() <<
"]" << std::endl
142 <<
"\tAddress: " << _msg.
Addr() << std::endl
143 <<
"\tProcess UUID: " << _msg.
PUuid() << std::endl
144 <<
"\tNode UUID: " << _msg.
NUuid() << std::endl
145 <<
"\tTopic Scope: ";
147 _out <<
"Process" << std::endl;
149 _out <<
"Host" << std::endl;
151 _out <<
"All" << std::endl;
189 const std::string &_addr,
190 const std::string &_ctrl,
191 const std::string &_pUuid,
192 const std::string &_nUuid,
194 const std::string &_msgTypeName);
200 public:
size_t Pack(
char *_buffer)
const;
203 public:
size_t Unpack(
char *_buffer);
206 public:
size_t MsgLength()
const;
212 public: std::string Ctrl()
const;
217 public:
void SetCtrl(
const std::string &_ctrl);
221 public: std::string MsgTypeName()
const;
226 public:
void SetMsgTypeName(
const std::string &_msgTypeName);
234 _out << static_cast<Publisher>(_msg)
235 <<
"\tControl address: " << _msg.
Ctrl() << std::endl
236 <<
"\tMessage type: " << _msg.
MsgTypeName() << std::endl;
279 const std::string &_addr,
280 const std::string &_id,
281 const std::string &_pUuid,
282 const std::string &_nUuid,
284 const std::string &_reqType,
285 const std::string &_repType);
291 public:
size_t Pack(
char *_buffer)
const;
294 public:
size_t Unpack(
char *_buffer);
297 public:
size_t MsgLength()
const;
302 public: std::string SocketId()
const;
307 public:
void SetSocketId(
const std::string &_socketId);
312 public: std::string ReqTypeName()
const;
317 public: std::string RepTypeName()
const;
322 public:
void SetReqTypeName(
const std::string &_reqTypeName);
327 public:
void SetRepTypeName(
const std::string &_repTypeName);
335 _out << static_cast<Publisher>(_msg)
336 <<
"\tSocket ID: " << _msg.
SocketId() << std::endl
337 <<
"\tRequest type: " << _msg.
ReqTypeName() << std::endl
338 <<
"\tResponse type: " << _msg.
RepTypeName() << std::endl;
361 private: std::string reqTypeName;
364 private: std::string repTypeName;
friend std::ostream & operator<<(std::ostream &_out, const Publisher &_msg)
Stream insertion operator.
Definition: Publisher.hh:137
std::string ctrl
ZeroMQ control address of the publisher.
Definition: Publisher.hh:255
Topic/service available to any subscriber (default scope).
std::string topic
Topic name.
Definition: Publisher.hh:157
#define IGNITION_VISIBLE
Use to represent "symbol visible" if supported.
Definition: Helpers.hh:56
ignition/transport/Publisher.hh
Definition: Publisher.hh:35
std::string addr
ZeroMQ address of the publisher.
Definition: Publisher.hh:160
std::string nUuid
Node UUID of the publisher.
Definition: Publisher.hh:166
Topic/service only available to subscribers in the same process as the publisher. ...
std::string Topic() const
Get the topic published by this publisher.
std::string SocketId() const
Get the ZeroMQ socket ID used by this publisher.
std::string msgTypeName
Message type advertised by this publisher.
Definition: Publisher.hh:258
std::string PUuid() const
Get the process UUID of the publisher.
std::string NUuid() const
Get the node UUID of the publisher.
std::string MsgTypeName() const
Get the message type advertised by this publisher.
std::string Addr() const
Get the ZeroMQ address of the publisher.
ignition/transport/Publisher.hh
Definition: Publisher.hh:175
ignition/transport/Publisher.hh
Definition: Publisher.hh:264
friend std::ostream & operator<<(std::ostream &_out, const ServicePublisher &_msg)
Stream insertion operator.
Definition: Publisher.hh:332
std::string RepTypeName() const
Get the name of the response's protobuf message advertised.
Scope_t
Definition: AdvertiseOptions.hh:33
std::string Ctrl() const
Get the ZeroMQ control address.
Definition: AdvertiseOptions.hh:25
std::string pUuid
Process UUID of the publisher.
Definition: Publisher.hh:163
std::string ReqTypeName() const
Get the name of the request's protobuf message advertised.
Topic/service only available to subscribers in the same machine as the publisher. ...
std::string socketId
ZeroMQ socket ID used by this publisher.
Definition: Publisher.hh:358
friend std::ostream & operator<<(std::ostream &_out, const MessagePublisher &_msg)
Stream insertion operator.
Definition: Publisher.hh:231
Scope_t Scope() const
Get the scope of the publisher's topic.