All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | 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 std::string &_reqType, const std::string &_repType, const AdvertiseServiceOptions &_opts)
 Constructor. More...
 
 ServicePublisher (const ServicePublisher &_other)
 Copy constructor. More...
 
virtual ~ServicePublisher ()=default
 Destructor. More...
 
size_t MsgLength () const
 Get the total length of the message. More...
 
bool operator!= (const ServicePublisher &_srv) const
 Inequality operator. More...
 
bool operator== (const ServicePublisher &_srv) const
 Equality operator. More...
 
virtual const
AdvertiseServiceOptions
Options () const
 Get the advertised options. More...
 
size_t Pack (char *_buffer) const
 Serialize the publisher. More...
 
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 SetOptions (const AdvertiseServiceOptions &_opts)
 Set the advertised options. 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 (const char *_buffer)
 Unserialize the publisher. More...
 
- 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 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. More...
 
Publisheroperator= (const Publisher &_other)
 Assignment operator. More...
 
bool operator== (const Publisher &_pub) const
 Equality operator. More...
 
std::string PUuid () const
 Get the process UUID of the publisher. 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::ostream & operator<< (std::ostream &_out, const ServicePublisher &_msg)
 Stream insertion operator. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ignition::transport::Publisher
size_t MsgLengthInternal () const
 Get the total length of the message without counting the advertised options. More...
 
size_t PackInternal (char *_buffer) const
 Serialize all fields except the advertise options. More...
 
size_t UnpackInternal (const char *_buffer)
 Unserialize all fields except the advertise options. 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...
 
std::string topic
 Topic name. More...
 

Detailed Description

ignition/transport/Publisher.hh

This class stores all the information about a service publisher.

Constructor & Destructor Documentation

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

Default constructor.

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 std::string &  _reqType,
const std::string &  _repType,
const AdvertiseServiceOptions _opts 
)

Constructor.

Parameters
[in]_topicTopic name.
[in]_addrZeroMQ address.
[in]_idZeroMQ socket ID.
[in]_pUuidProcess UUID.
[in]_nUUIDnode UUID.
[in]_reqTypeMessage type used in the service request.
[in]_repTypeMessage type used in the service response.
[in]_optsAdvertise options.
ignition::transport::ServicePublisher::ServicePublisher ( const ServicePublisher _other)

Copy constructor.

Parameters
[in]_otherOther ServicePublisher object.
virtual ignition::transport::ServicePublisher::~ServicePublisher ( )
virtualdefault

Destructor.

Member Function Documentation

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

Get the total length of the message.

Returns
Return the length of the message in bytes.

Reimplemented from ignition::transport::Publisher.

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.
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.
virtual const AdvertiseServiceOptions& ignition::transport::ServicePublisher::Options ( ) const
virtual

Get the advertised options.

Returns
The advertised options.
See Also
SetOptions.

Reimplemented from ignition::transport::Publisher.

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

Serialize the publisher.

The caller has ownership of the buffer and is responsible for its [de]allocation.

Parameters
[out]_bufferDestination buffer in which the publisher will be serialized.
Returns
Number of bytes serialized.

Reimplemented from ignition::transport::Publisher.

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.
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.
void ignition::transport::ServicePublisher::SetOptions ( const AdvertiseServiceOptions _opts)

Set the advertised options.

Parameters
[in]_optsNew advertised options.
See Also
Options.
void ignition::transport::ServicePublisher::SetRepTypeName ( const std::string &  _repTypeName)

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

Parameters
[in]_repTypeNameThe protobuf message type.
See Also
RepTypeName.
void ignition::transport::ServicePublisher::SetReqTypeName ( const std::string &  _reqTypeName)

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

Parameters
[in]_reqTypeNameThe protobuf message type.
See Also
ReqTypeName.
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.
std::string ignition::transport::ServicePublisher::SocketId ( ) const

Get the ZeroMQ socket ID used by this publisher.

Returns
The socket ID.
See Also
SetSocketId.
size_t ignition::transport::ServicePublisher::Unpack ( const char *  _buffer)
virtual

Unserialize the publisher.

Parameters
[in]_bufferInput buffer with the data to be unserialized.

Reimplemented from ignition::transport::Publisher.

Friends And Related Function Documentation

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.

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