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

#include <msgbus.hpp>

Inheritance diagram for eii::msgbus::BaseMsgbusThread:
eii::msgbus::PublisherThread eii::msgbus::SubscriberThread< T >

Public Member Functions

 BaseMsgbusThread (config_t *msgbus_config, std::condition_variable &err_cv)
 
virtual ~BaseMsgbusThread ()
 
virtual void start ()
 
virtual void join ()
 
virtual void stop ()
 

Protected Member Functions

virtual void run ()=0
 

Protected Attributes

MsgbusContextm_ctx
 
std::atomic< bool > m_stop
 
std::condition_variable & m_err_cv
 

Detailed Description

Base object for running message bus operations in a thread.

Constructor & Destructor Documentation

◆ BaseMsgbusThread()

eii::msgbus::BaseMsgbusThread::BaseMsgbusThread ( config_t *  msgbus_config,
std::condition_variable &  err_cv 
)

Constructor

Exceptions
MsgbusExceptionThrown if an error occurs in the message bus.
Parameters
msgbus_config- Message bus configuration
err_cv- Condition variable to indicate an error in the thread

◆ ~BaseMsgbusThread()

virtual eii::msgbus::BaseMsgbusThread::~BaseMsgbusThread ( )
virtual

Destructor.

Note
Child classes must destroy the msgbus context.

Member Function Documentation

◆ join()

virtual void eii::msgbus::BaseMsgbusThread::join ( )
virtual

Join with the underlying message bus thread.

Note
This will return immediately if the publisher has already stopped or if it has not been started yet.

◆ run()

virtual void eii::msgbus::BaseMsgbusThread::run ( )
protectedpure virtual

Run method to be overriden by subclasses.

Implemented in eii::msgbus::SubscriberThread< T >, and eii::msgbus::PublisherThread.

◆ start()

virtual void eii::msgbus::BaseMsgbusThread::start ( )
virtual

Start the message bus thread.

◆ stop()

virtual void eii::msgbus::BaseMsgbusThread::stop ( )
virtual

Stop the message bus thread.


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