Public Member Functions | List of all members
ignition::transport::Node::PublisherId Class Reference

A class that is used to store information about an advertised publisher. More...

#include <Node.hh>

Public Member Functions

 PublisherId ()
 Default constructor. More...
 
 PublisherId (const std::string &_topic)
 Constructor. More...
 
 operator bool ()
 Allows this class to be evaluated as a boolean. More...
 
std::string Topic () const
 Return the name of the topic. More...
 
bool Valid () const
 Return true if valid information, such as a non-empty topic name, is present. More...
 

Detailed Description

A class that is used to store information about an advertised publisher.

An instance of this class is returned from Node::Advertise, and should be used in subsequent Node::Publish calls.

Pseudo code example

auto pubId = myNode.Advertise<MsgType>("topic_name");

MsgType msg; myNode.Publish(pubId, msg);

Constructor & Destructor Documentation

ignition::transport::Node::PublisherId::PublisherId ( )

Default constructor.

ignition::transport::Node::PublisherId::PublisherId ( const std::string &  _topic)
explicit

Constructor.

Parameters
[in]_topicName of the topic on which messages could be published.

Member Function Documentation

ignition::transport::Node::PublisherId::operator bool ( )

Allows this class to be evaluated as a boolean.

Returns
True if valid
See also
Valid
std::string ignition::transport::Node::PublisherId::Topic ( ) const

Return the name of the topic.

Returns
Name of the topic that message would be published on.
bool ignition::transport::Node::PublisherId::Valid ( ) const

Return true if valid information, such as a non-empty topic name, is present.

Returns
True if this object can be used in Node::Publish calls.

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