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

#include <msgbus.hpp>

Public Member Functions

 MsgbusContext (config_t *config)
 
 ~MsgbusContext ()
 
Publishernew_publisher (const std::string topic)
 
Subscribernew_subscriber (const std::string topic, user_data_t *user_data=NULL)
 
Servicenew_service (std::string service_name, void *user_data=NULL)
 
ServiceRequesterget_service (std::string service_name, void *user_data=NULL)
 

Detailed Description

EII Message Bus context object.

Constructor & Destructor Documentation

◆ MsgbusContext()

eii::msgbus::MsgbusContext::MsgbusContext ( config_t *  config)

Constructor.

Exceptions
MsgbusExceptionThrown if an error occurs in the message bus.
Parameters
config- Messae bus configuration object

◆ ~MsgbusContext()

eii::msgbus::MsgbusContext::~MsgbusContext ( )

Destructor.

Member Function Documentation

◆ get_service()

ServiceRequester* eii::msgbus::MsgbusContext::get_service ( std::string  service_name,
void *  user_data = NULL 
)

Create a new service context for receiving requests.

Note
This method will expect to find the configuration attributes needed to communicate with the specified service in the configuration given to the constructor.
Exceptions
MsgbusExceptionThrown if an error occurs in the message bus.
Parameters
service_name- Name of the service
user_data- Optional user data to attach to the service.
Returns
Service*

◆ new_publisher()

Publisher* eii::msgbus::MsgbusContext::new_publisher ( const std::string  topic)

Create a new publisher with the specified topic.

Note
The topic string provided to this message must have a corresponding configuration in the config_t given to the MsgbusContext's constructor.
Exceptions
MsgbusExceptionThrown if an error occurs in the message bus.
Parameters
topic- Topic string for the publisher
Returns
Publisher*

◆ new_service()

Service* eii::msgbus::MsgbusContext::new_service ( std::string  service_name,
void *  user_data = NULL 
)

Create a new service context for issuing requests to a service.

Note
This method will expect to find the configuration attributes needed to communicate with the specified service in the configuration given to the constructor.
Exceptions
MsgbusExceptionThrown if an error occurs in the message bus.
Parameters
service_name- Name of the service
user_data- Optional user data to attach to the service.
Returns
Service*

◆ new_subscriber()

Subscriber* eii::msgbus::MsgbusContext::new_subscriber ( const std::string  topic,
user_data_t user_data = NULL 
)

Create a new subscriber on the specified topic.

Note
The topic string provided to this message must have a corresponding configuration in the config_t given to the MsgbusContext's constructor.
Exceptions
MsgbusExceptionThrown if an error occurs in the message bus.
Parameters
topic- Topic string for the subscriber
user_data- Optional user data to attach to the subscriber.
Returns
Subscriber*

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