18 #ifndef IGN_TRANSPORT_PUBLISHER_HH_
19 #define IGN_TRANSPORT_PUBLISHER_HH_
31 class MessagePublisherPrivate;
48 public:
Publisher(
const std::string &_topic,
49 const std::string &_addr,
50 const std::string &_pUuid,
51 const std::string &_nUuid,
64 public: std::string Topic()
const;
69 public: std::string Addr()
const;
74 public: std::string PUuid()
const;
79 public: std::string NUuid()
const;
89 public:
void SetTopic(
const std::string &_topic);
94 public:
void SetAddr(
const std::string &_addr);
99 public:
void SetPUuid(
const std::string &_pUuid);
104 public:
void SetNUuid(
const std::string &_nUuid);
116 public:
virtual size_t Pack(
char *_buffer)
const;
120 public:
virtual size_t Unpack(
const char *_buffer);
124 public:
virtual size_t MsgLength()
const;
131 public:
bool operator==(
const Publisher &_pub)
const;
138 public:
bool operator!=(
const Publisher &_pub)
const;
151 _out <<
"Publisher:" << std::endl
152 <<
"\tTopic: [" << _msg.
Topic() <<
"]" << std::endl
153 <<
"\tAddress: " << _msg.
Addr() << std::endl
154 <<
"\tProcess UUID: " << _msg.
PUuid() << std::endl
155 <<
"\tNode UUID: " << _msg.
NUuid() << std::endl
164 protected:
size_t PackInternal(
char *_buffer)
const;
169 protected:
size_t UnpackInternal(
const char *_buffer);
176 protected:
size_t MsgLengthInternal()
const;
212 const std::string &_addr,
213 const std::string &_ctrl,
214 const std::string &_pUuid,
215 const std::string &_nUuid,
216 const std::string &_msgTypeName,
227 public:
virtual size_t Pack(
char *_buffer)
const;
230 public:
virtual size_t Unpack(
const char *_buffer);
233 public:
virtual size_t MsgLength()
const;
239 public: std::string Ctrl()
const;
244 public:
void SetCtrl(
const std::string &_ctrl);
248 public: std::string MsgTypeName()
const;
253 public:
void SetMsgTypeName(
const std::string &_msgTypeName);
271 _out <<
"Publisher:" << std::endl
272 <<
"\tTopic: [" << _msg.
Topic() <<
"]" << std::endl
273 <<
"\tAddress: " << _msg.
Addr() << std::endl
274 <<
"\tProcess UUID: " << _msg.
PUuid() << std::endl
275 <<
"\tNode UUID: " << _msg.
NUuid() << std::endl
276 <<
"\tControl address: " << _msg.
Ctrl() << std::endl
277 <<
"\tMessage type: " << _msg.
MsgTypeName() << std::endl
302 private: std::string ctrl;
305 private: std::string msgTypeName;
329 const std::string &_addr,
330 const std::string &_id,
331 const std::string &_pUuid,
332 const std::string &_nUuid,
333 const std::string &_reqType,
334 const std::string &_repType,
345 public:
size_t Pack(
char *_buffer)
const;
348 public:
size_t Unpack(
const char *_buffer);
351 public:
size_t MsgLength()
const;
356 public: std::string SocketId()
const;
361 public:
void SetSocketId(
const std::string &_socketId);
366 public: std::string ReqTypeName()
const;
371 public: std::string RepTypeName()
const;
376 public:
void SetReqTypeName(
const std::string &_reqTypeName);
381 public:
void SetRepTypeName(
const std::string &_repTypeName);
399 _out <<
"Publisher:" << std::endl
400 <<
"\tTopic: [" << _msg.
Topic() <<
"]" << std::endl
401 <<
"\tAddress: " << _msg.
Addr() << std::endl
402 <<
"\tProcess UUID: " << _msg.
PUuid() << std::endl
403 <<
"\tNode UUID: " << _msg.
NUuid() << std::endl
404 <<
"\tSocket ID: " << _msg.
SocketId() << std::endl
405 <<
"\tRequest type: " << _msg.
ReqTypeName() << std::endl
406 <<
"\tResponse type: " << _msg.
RepTypeName() << std::endl
427 private: std::string socketId;
430 private: std::string reqTypeName;
433 private: std::string repTypeName;
friend std::ostream & operator<<(std::ostream &_out, const Publisher &_msg)
Stream insertion operator.
Definition: Publisher.hh:148
std::string topic
Topic name.
Definition: Publisher.hh:179
A class for customizing the publication options for a topic advertised.
Definition: AdvertiseOptions.hh:136
ignition/transport/Publisher.hh
Definition: Publisher.hh:37
std::string addr
ZeroMQ address of the publisher.
Definition: Publisher.hh:182
std::string nUuid
Node UUID of the publisher.
Definition: Publisher.hh:188
virtual const AdvertiseOptions & Options() const
Get the advertised options.
std::string Topic() const
Get the topic published by this publisher.
std::string SocketId() const
Get the ZeroMQ socket ID used by this publisher.
ignition/transport/AdvertiseOptions.hh
Definition: AdvertiseOptions.hh:54
std::string PUuid() const
Get the process UUID of the publisher.
A class for customizing the publication options for a service advertised.
Definition: AdvertiseOptions.hh:224
std::string NUuid() const
Get the node UUID of the publisher.
#define IGNITION_TRANSPORT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: Helpers.hh:57
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:198
ignition/transport/Publisher.hh
Definition: Publisher.hh:314
virtual const AdvertiseServiceOptions & Options() const
Get the advertised options.
friend std::ostream & operator<<(std::ostream &_out, const ServicePublisher &_msg)
Stream insertion operator.
Definition: Publisher.hh:396
virtual const AdvertiseMessageOptions & Options() const
Get the advertised options.
std::string RepTypeName() const
Get the name of the response's protobuf message advertised.
std::string Ctrl() const
Get the ZeroMQ control address.
std::string pUuid
Process UUID of the publisher.
Definition: Publisher.hh:185
std::string ReqTypeName() const
Get the name of the request's protobuf message advertised.
friend std::ostream & operator<<(std::ostream &_out, const MessagePublisher &_msg)
Stream insertion operator.
Definition: Publisher.hh:268