Ignition Transport

API Reference

10.0.0

This class stores all the information about a publisher. It stores the topic name that publishes, addresses, UUIDs, scope, etc. More...

#include <Publisher.hh>

Public Member Functions

 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...
 
virtual void FillDiscovery (msgs::Discovery &_msg) const
 Populate a discovery message. 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...
 
virtual const AdvertiseOptionsOptions () const
 Get the advertised options. 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...
 
virtual void SetFromDiscovery (const msgs::Discovery &_msg)
 Set data from a discovery message. 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...
 

Protected Attributes

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...
 

Friends

std::ostreamoperator<< (std::ostream &_out, const Publisher &_msg)
 Stream insertion operator. More...
 

Detailed Description

This class stores all the information about a publisher. It stores the topic name that publishes, addresses, UUIDs, scope, etc.

ignition/transport/Publisher.hh

Constructor & Destructor Documentation

◆ Publisher() [1/3]

Publisher ( )
default

Default constructor.

◆ Publisher() [2/3]

Publisher ( const std::string _topic,
const std::string _addr,
const std::string _pUuid,
const std::string _nUuid,
const AdvertiseOptions _opts 
)

Constructor.

Parameters
[in]_topicTopic name.
[in]_addrZeroMQ address.
[in]_pUuidProcess UUID.
[in]_nUUIDnode UUID.
[in]_optsThe advertise options.

◆ Publisher() [3/3]

Publisher ( const Publisher _other)

Copy constructor.

Parameters
[in]_otherOther Publisher object.

◆ ~Publisher()

virtual ~Publisher ( )
virtualdefault

Destructor.

Member Function Documentation

◆ Addr()

std::string Addr ( ) const

Get the ZeroMQ address of the publisher.

Returns
ZeroMQ address.
See also
SetAddr.

◆ FillDiscovery()

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

Populate a discovery message.

Parameters
[in]_msgMessage to fill.

Reimplemented in ServicePublisher, and MessagePublisher.

◆ NUuid()

std::string NUuid ( ) const

Get the node UUID of the publisher.

Returns
Node UUID.
See also
SetNUuid.

◆ operator!=()

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.

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

◆ operator=()

Publisher& operator= ( const Publisher _other)

Assignment operator.

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

◆ operator==()

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.

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

◆ Options()

virtual const AdvertiseOptions& Options ( ) const
virtual

Get the advertised options.

Returns
The advertised options.
See also
SetOptions.

Reimplemented in ServicePublisher, and MessagePublisher.

◆ PUuid()

std::string PUuid ( ) const

Get the process UUID of the publisher. return Process UUID.

See also
SetPUuid.

◆ SetAddr()

void SetAddr ( const std::string _addr)

Set ZeroMQ address of the publisher.

Parameters
[in]_addrNew address.
See also
Addr.

◆ SetFromDiscovery()

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

Set data from a discovery message.

Parameters
[in]_msgDiscovery message.

Reimplemented in ServicePublisher, and MessagePublisher.

◆ SetNUuid()

void SetNUuid ( const std::string _nUuid)

Set the node UUID of the publisher.

Parameters
[in]_nUuidNew node UUID.
See also
NUuid.

◆ SetOptions()

void SetOptions ( const AdvertiseOptions _opts)

Set the advertised options.

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

◆ SetPUuid()

void SetPUuid ( const std::string _pUuid)

Set the process UUID of the publisher.

Parameters
[in]_pUuidNew process UUID.
See also
PUuid.

◆ SetTopic()

void SetTopic ( const std::string _topic)

Set the topic name published by this publisher.

Parameters
[in]_topicNew topic name.
See also
Topic.

◆ Topic()

std::string Topic ( ) const

Get the topic published by this publisher.

Returns
Topic name.
See also
SetTopic.

Friends And Related Function Documentation

◆ operator<<

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

Stream insertion operator.

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

Member Data Documentation

◆ addr

std::string addr
protected

ZeroMQ address of the publisher.

◆ nUuid

std::string nUuid
protected

Node UUID of the publisher.

◆ pUuid

std::string pUuid
protected

Process UUID of the publisher.

◆ topic

std::string topic
protected

Topic name.


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