Public Member Functions | Protected Attributes | Friends | List of all members
ignition::transport::MessagePublisher Class Reference

ignition/transport/Publisher.hh More...

#include <Publisher.hh>

Inheritance diagram for ignition::transport::MessagePublisher:
Inheritance graph
[legend]

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 Scope_t &_scope, const std::string &_msgTypeName)
 Constructor. More...
 
virtual ~MessagePublisher ()=default
 Destructor. More...
 
std::string Ctrl () const
 Get the ZeroMQ control address. More...
 
size_t MsgLength () const
 
std::string MsgTypeName () const
 Get the message type advertised by this publisher. More...
 
bool operator!= (const MessagePublisher &_pub) const
 Inequality operator. More...
 
bool operator== (const MessagePublisher &_pub) const
 Equality operator. More...
 
size_t Pack (char *_buffer) const
 
void SetCtrl (const std::string &_ctrl)
 Set the ZeroMQ control address of the publisher. More...
 
void SetMsgTypeName (const std::string &_msgTypeName)
 Set the message type advertised by this publisher. More...
 
size_t Unpack (char *_buffer)
 
- Public Member Functions inherited from ignition::transport::Publisher
 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 ctrl
 ZeroMQ control address of the publisher. More...
 
std::string msgTypeName
 Message type advertised by this publisher. More...
 
- Protected Attributes inherited from ignition::transport::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...
 
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 MessagePublisher &_msg)
 Stream insertion operator. More...
 

Detailed Description

ignition/transport/Publisher.hh

This class stores all the information about a message publisher.

Constructor & Destructor Documentation

◆ MessagePublisher() [1/2]

ignition::transport::MessagePublisher::MessagePublisher ( )
default

Default constructor.

◆ MessagePublisher() [2/2]

ignition::transport::MessagePublisher::MessagePublisher ( const std::string &  _topic,
const std::string &  _addr,
const std::string &  _ctrl,
const std::string &  _pUuid,
const std::string &  _nUuid,
const Scope_t _scope,
const std::string &  _msgTypeName 
)

Constructor.

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

◆ ~MessagePublisher()

virtual ignition::transport::MessagePublisher::~MessagePublisher ( )
virtualdefault

Destructor.

Member Function Documentation

◆ Ctrl()

std::string ignition::transport::MessagePublisher::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.

◆ MsgLength()

size_t ignition::transport::MessagePublisher::MsgLength ( ) const

◆ MsgTypeName()

std::string ignition::transport::MessagePublisher::MsgTypeName ( ) const

Get the message type advertised by this publisher.

Returns
Message type.

◆ operator!=()

bool ignition::transport::MessagePublisher::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==()

bool ignition::transport::MessagePublisher::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.

◆ Pack()

size_t ignition::transport::MessagePublisher::Pack ( char *  _buffer) const

◆ SetCtrl()

void ignition::transport::MessagePublisher::SetCtrl ( const std::string &  _ctrl)

Set the ZeroMQ control address of the publisher.

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

◆ SetMsgTypeName()

void ignition::transport::MessagePublisher::SetMsgTypeName ( const std::string &  _msgTypeName)

Set the message type advertised by this publisher.

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

◆ Unpack()

size_t ignition::transport::MessagePublisher::Unpack ( char *  _buffer)

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.

Member Data Documentation

◆ ctrl

std::string ignition::transport::MessagePublisher::ctrl
protected

ZeroMQ control address of the publisher.

◆ msgTypeName

std::string ignition::transport::MessagePublisher::msgTypeName
protected

Message type advertised by this publisher.


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