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

ignition/transport/Publisher.hh More...

#include <Publisher.hh>

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

Public Member Functions

 ServicePublisher ()=default
 Default constructor. More...
 
 ServicePublisher (const std::string &_topic, const std::string &_addr, const std::string &_id, const std::string &_pUuid, const std::string &_nUuid, const Scope_t &_scope, const std::string &_reqType, const std::string &_repType)
 Constructor. More...
 
virtual ~ServicePublisher ()=default
 Destructor. More...
 
size_t MsgLength () const
 
bool operator!= (const ServicePublisher &_srv) const
 Inequality operator. More...
 
bool operator== (const ServicePublisher &_srv) const
 Equality operator. More...
 
size_t Pack (char *_buffer) const
 
std::string RepTypeName () const
 Get the name of the response's protobuf message advertised. More...
 
std::string ReqTypeName () const
 Get the name of the request's protobuf message advertised. More...
 
void SetRepTypeName (const std::string &_repTypeName)
 Set the name of the response's protobuf message advertised. More...
 
void SetReqTypeName (const std::string &_reqTypeName)
 Set the name of the request's protobuf message advertised. More...
 
void SetSocketId (const std::string &_socketId)
 Set the ZeroMQ socket ID for this publisher. More...
 
std::string SocketId () const
 Get the ZeroMQ socket ID used 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 socketId
 ZeroMQ socket ID used 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 ServicePublisher &_msg)
 Stream insertion operator. More...
 

Detailed Description

ignition/transport/Publisher.hh

This class stores all the information about a service publisher.

Constructor & Destructor Documentation

◆ ServicePublisher() [1/2]

ignition::transport::ServicePublisher::ServicePublisher ( )
default

Default constructor.

◆ ServicePublisher() [2/2]

ignition::transport::ServicePublisher::ServicePublisher ( const std::string &  _topic,
const std::string &  _addr,
const std::string &  _id,
const std::string &  _pUuid,
const std::string &  _nUuid,
const Scope_t _scope,
const std::string &  _reqType,
const std::string &  _repType 
)

Constructor.

Parameters
[in]_topicTopic name.
[in]_addrZeroMQ address.
[in]_idZeroMQ socket ID.
[in]_pUuidProcess UUID.
[in]_nUUIDnode UUID.
[in]_scopeScope.
[in]_reqTypeMessage type used in the service request.
[in]_repTypeMessage type used in the service response.

◆ ~ServicePublisher()

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

Destructor.

Member Function Documentation

◆ MsgLength()

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

◆ operator!=()

bool ignition::transport::ServicePublisher::operator!= ( const ServicePublisher _srv) const

Inequality operator.

This function checks if the given service does not have identical Topic, Addr, PUuid, NUuid, Scope, SocketId, ReqTypeName, RepTypeName strings to this object.

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

◆ operator==()

bool ignition::transport::ServicePublisher::operator== ( const ServicePublisher _srv) const

Equality operator.

This function checks if the given service has identical Topic, Addr, PUuid, NUuid, Scope, SocketId, ReqTypeName, RepTypeName strings to this object.

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

◆ Pack()

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

◆ RepTypeName()

std::string ignition::transport::ServicePublisher::RepTypeName ( ) const

Get the name of the response's protobuf message advertised.

Returns
The protobuf message type.
See also
SetRepTypeName.

◆ ReqTypeName()

std::string ignition::transport::ServicePublisher::ReqTypeName ( ) const

Get the name of the request's protobuf message advertised.

Returns
The protobuf message type.
See also
SetReqTypeName.

◆ SetRepTypeName()

void ignition::transport::ServicePublisher::SetRepTypeName ( const std::string &  _repTypeName)

Set the name of the response's protobuf message advertised.

Parameters
[in]Theprotobuf message type.
See also
RepTypeName.

◆ SetReqTypeName()

void ignition::transport::ServicePublisher::SetReqTypeName ( const std::string &  _reqTypeName)

Set the name of the request's protobuf message advertised.

Parameters
[in]Theprotobuf message type.
See also
ReqTypeName.

◆ SetSocketId()

void ignition::transport::ServicePublisher::SetSocketId ( const std::string &  _socketId)

Set the ZeroMQ socket ID for this publisher.

Parameters
[in]_socketIdNew socket ID.
See also
SocketId.

◆ SocketId()

std::string ignition::transport::ServicePublisher::SocketId ( ) const

Get the ZeroMQ socket ID used by this publisher.

Returns
The socket ID.
See also
SetSocketId.

◆ Unpack()

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

Friends And Related Function Documentation

◆ operator<<

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

Stream insertion operator.

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

Member Data Documentation

◆ socketId

std::string ignition::transport::ServicePublisher::socketId
protected

ZeroMQ socket ID used by this publisher.


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