Ignition Transport

API Reference

10.0.0
MessagePublisher Class Reference

This class stores all the information about a message publisher. More...

#include <Publisher.hh>

Public Member Functions

 MessagePublisher ()=default
 Default constructor. More...
 
 MessagePublisher (const std::string &_topic, const std::string &_addr, const std::string &_ctrl, const std::string &_pUuid, const std::string &_nUuid, const std::string &_msgTypeName, const AdvertiseMessageOptions &_opts)
 Constructor. More...
 
 MessagePublisher (const MessagePublisher &_other)
 Copy constructor. More...
 
virtual ~MessagePublisher ()=default
 Destructor. More...
 
std::string Ctrl () const
 Get the ZeroMQ control address. This address is used by the subscribers to notify the publisher about the new subscription. More...
 
virtual void FillDiscovery (msgs::Discovery &_msg) const final
 Populate a discovery message. More...
 
std::string MsgTypeName () const
 Get the message type advertised by this publisher. More...
 
bool operator!= (const MessagePublisher &_pub) const
 Inequality operator. This function checks if the given message publisher does not have identical Topic, Addr, PUuid, NUuid, Scope, Ctrl, and MsgTypeName strings to this object. More...
 
MessagePublisheroperator= (const MessagePublisher &_other)
 Assignment operator. More...
 
bool operator== (const MessagePublisher &_pub) const
 Equality operator. This function checks if the given message publisher has identical Topic, Addr, PUuid, NUuid, Scope, Ctrl, and MsgTypeName strings to this object. More...
 
virtual const AdvertiseMessageOptionsOptions () const
 Get the advertised options. More...
 
void SetCtrl (const std::string &_ctrl)
 Set the ZeroMQ control address of the publisher. More...
 
virtual void SetFromDiscovery (const msgs::Discovery &_msg)
 Set data from a discovery message. More...
 
void SetMsgTypeName (const std::string &_msgTypeName)
 Set the message type advertised by this publisher. More...
 
void SetOptions (const AdvertiseMessageOptions &_opts)
 Set the advertised options. More...
 
- Public Member Functions inherited from Publisher
 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. This function checks if the given publisher does not have identical Topic, Addr, PUuid, NUuid, and Scope strings to this object. More...
 
Publisheroperator= (const Publisher &_other)
 Assignment operator. More...
 
bool operator== (const Publisher &_pub) const
 Equality operator. This function checks if the given publisher has identical Topic, Addr, PUuid, NUuid, and Scope strings to this object. More...
 
std::string PUuid () const
 Get the process UUID of the publisher. return Process UUID. 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::ostreamoperator<< (std::ostream &_out, const MessagePublisher &_msg)
 Stream insertion operator. More...
 

Additional Inherited Members

- Protected Attributes inherited from Publisher
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...
 

Detailed Description

This class stores all the information about a message publisher.

ignition/transport/Publisher.hh

Constructor & Destructor Documentation

◆ MessagePublisher() [1/3]

MessagePublisher ( )
default

Default constructor.

◆ MessagePublisher() [2/3]

MessagePublisher ( const std::string _topic,
const std::string _addr,
const std::string _ctrl,
const std::string _pUuid,
const std::string _nUuid,
const std::string _msgTypeName,
const AdvertiseMessageOptions _opts 
)
explicit

Constructor.

Parameters
[in]_topicTopic name.
[in]_addrZeroMQ address.
[in]_ctrlZeroMQ control address.
[in]_pUuidProcess UUID.
[in]_nUUIDnode UUID.
[in]_msgTypeNameMessage type advertised by this publisher.
[in]_optsAdvertise options.

◆ MessagePublisher() [3/3]

MessagePublisher ( const MessagePublisher _other)

Copy constructor.

Parameters
[in]_otherOther MessagePublisher object.

◆ ~MessagePublisher()

virtual ~MessagePublisher ( )
virtualdefault

Destructor.

Member Function Documentation

◆ Ctrl()

std::string Ctrl ( ) const

Get the ZeroMQ control address. This address is used by the subscribers to notify the publisher about the new subscription.

Returns
ZeroMQ control address of the publisher.
See also
SetCtrl.

◆ FillDiscovery()

virtual void FillDiscovery ( msgs::Discovery &  _msg) const
finalvirtual

Populate a discovery message.

Parameters
[in]_msgMessage to fill.

Reimplemented from Publisher.

◆ MsgTypeName()

std::string MsgTypeName ( ) const

Get the message type advertised by this publisher.

Returns
Message type.

◆ operator!=()

bool operator!= ( const MessagePublisher _pub) const

Inequality operator. This function checks if the given message publisher does not have identical Topic, Addr, PUuid, NUuid, Scope, Ctrl, and MsgTypeName strings to this object.

Parameters
[in]_pubThe message publisher to compare against.
Returns
True if this object does not match the provided object.

◆ operator=()

MessagePublisher& operator= ( const MessagePublisher _other)

Assignment operator.

Parameters
[in]_otherThe other MessagePublisher.
Returns
A reference to this instance.

◆ operator==()

bool operator== ( const MessagePublisher _pub) const

Equality operator. This function checks if the given message publisher has identical Topic, Addr, PUuid, NUuid, Scope, Ctrl, and MsgTypeName strings to this object.

Parameters
[in]_pubThe message publisher to compare against.
Returns
True if this object matches the provided object.

◆ Options()

virtual const AdvertiseMessageOptions& Options ( ) const
virtual

Get the advertised options.

Returns
The advertised options.
See also
SetOptions.

Reimplemented from Publisher.

◆ SetCtrl()

void SetCtrl ( const std::string _ctrl)

Set the ZeroMQ control address of the publisher.

Parameters
[in]_ctrlNew control address.
See also
Ctrl.

◆ SetFromDiscovery()

virtual void SetFromDiscovery ( const msgs::Discovery &  _msg)
virtual

Set data from a discovery message.

Parameters
[in]_msgDiscovery message.

Reimplemented from Publisher.

◆ SetMsgTypeName()

void SetMsgTypeName ( const std::string _msgTypeName)

Set the message type advertised by this publisher.

Parameters
[in]_msgTypeNameNew message type.
See also
MsgTypeName.

◆ SetOptions()

void SetOptions ( const AdvertiseMessageOptions _opts)

Set the advertised options.

Parameters
[in]_optsNew advertised options.
See also
Options.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream _out,
const MessagePublisher _msg 
)
friend

Stream insertion operator.

Parameters
[out]_outThe output stream.
[in]_msgMessagePublisher to write to the stream.

The documentation for this class was generated from the following file: