EII Message Bus C Reference
Public Member Functions | Protected Member Functions | List of all members
eii::msgbus::PublisherThread Class Reference

#include <msgbus.hpp>

Inheritance diagram for eii::msgbus::PublisherThread:
eii::msgbus::BaseMsgbusThread

Public Member Functions

 PublisherThread (config_t *msgbus_config, std::condition_variable &err_cv, std::string topic, MessageQueue *input_queue, std::string service_name)
 
 ~PublisherThread ()
 
- Public Member Functions inherited from eii::msgbus::BaseMsgbusThread
 BaseMsgbusThread (config_t *msgbus_config, std::condition_variable &err_cv)
 
virtual ~BaseMsgbusThread ()
 
virtual void start ()
 
virtual void join ()
 
virtual void stop ()
 

Protected Member Functions

void run () override
 

Additional Inherited Members

- Protected Attributes inherited from eii::msgbus::BaseMsgbusThread
MsgbusContextm_ctx
 
std::atomic< bool > m_stop
 
std::condition_variable & m_err_cv
 

Detailed Description

Helper object for publishing messages in a thread given over an input queue.

Constructor & Destructor Documentation

◆ PublisherThread()

eii::msgbus::PublisherThread::PublisherThread ( config_t *  msgbus_config,
std::condition_variable &  err_cv,
std::string  topic,
MessageQueue input_queue,
std::string  service_name 
)

Constructor.

Note
This object is not responsible for freeing the MessageQueue, it will free the message bus configuration if no exception is thrown.
Exceptions
MsgbusExceptionThrown if an error occurs in the message bus.
Parameters
msgbus_config- Message bus context configuration
err_cv- Condition variable to indicate an error in the thread
topic- Topic to publish on
input_queue- Input queue of messages to publish
service_name- Name of the service running the publisher thread

◆ ~PublisherThread()

eii::msgbus::PublisherThread::~PublisherThread ( )

Destructor

Member Function Documentation

◆ run()

void eii::msgbus::PublisherThread::run ( )
overrideprotectedvirtual

Publisher thread run method.

Implements eii::msgbus::BaseMsgbusThread.


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