Flyby SDK v1.0.2
Loading...
Searching...
No Matches
flyby::Publisher Class Referenceabstract

The class used for publishing to the message bus. More...

#include <publisher.h>

Inheritance diagram for flyby::Publisher:

Public Member Functions

virtual bool is_connected ()=0
 Check if the publisher is connected.
virtual void publish (const std::string &topic, const std::string &message, const std::string &source=std::string())=0
 Publish a message to the message bus.
virtual void publish (const std::string &topic, Message &message)=0
 Publish a message to the message bus.
virtual std::shared_ptr< PublishObservablepublish_observe (const std::string &topic, const std::string &message)=0
 Publish a message to the message bus.

Static Public Member Functions

static std::shared_ptr< Publishercreate (const std::string &client_id)
 Creates a publisher handler.

Detailed Description

The class used for publishing to the message bus.

This class is used only for publishing messages.

Member Function Documentation

◆ create()

std::shared_ptr< Publisher > flyby::Publisher::create ( const std::string & client_id)
static

Creates a publisher handler.

Parameters
client_id- The ID of the user that is publishing.
Returns
Publisher handler.

◆ is_connected()

virtual bool flyby::Publisher::is_connected ( )
pure virtual

Check if the publisher is connected.

Returns
True if the publisher is connected to the message bus.

Implemented in flyby::Client.

◆ publish() [1/2]

virtual void flyby::Publisher::publish ( const std::string & topic,
const std::string & message,
const std::string & source = std::string() )
pure virtual

Publish a message to the message bus.

Parameters
topic- The topic to publish to.
message- The string representation of the message.
source- Optional. The source system of the message.

◆ publish() [2/2]

virtual void flyby::Publisher::publish ( const std::string & topic,
Message & message )
pure virtual

Publish a message to the message bus.

Parameters
topic- The topic to publish to.
message- The object representation of the message.

◆ publish_observe()

virtual std::shared_ptr< PublishObservable > flyby::Publisher::publish_observe ( const std::string & topic,
const std::string & message )
nodiscardpure virtual

Publish a message to the message bus.

Parameters
topic- The topic to publish to.
message- The string representation of the message.
Returns
The publish observable.

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