Leosac  0.8.0
Open Source Access Control
Leosac::Module::Mqtt::MqttExternalServer Class Reference

Implementation class, for use by the Mqtt module only. More...

#include <MqttExternalServer.hpp>

+ Collaboration diagram for Leosac::Module::Mqtt::MqttExternalServer:

Public Member Functions

 MqttExternalServer (zmqpp::context &ctx, std::shared_ptr< const MqttServerConfig > config, const std::vector< std::shared_ptr< const MqttExternalMessage >> &topics)
 
void register_sockets (zmqpp::reactor *reactor)
 
void connect ()
 
void disconnect ()
 
void handle_topic_request (const std::string &topic_name)
 Request received on the topic specific socket. More...
 
void handle_mqtt_msg (mqtt::const_message_ptr msg)
 Message received from mqtt. More...
 
void handle_request ()
 Someone sent a request. More...
 
std::shared_ptr< const MqttServerConfigconfig () const
 
const std::vector< std::shared_ptr< const MqttExternalMessage > > & topics () const
 
const std::string & name () const
 

Private Attributes

zmqpp::socket sock_
 REP socket to receive command on. More...
 
zmqpp::socket bus_push_
 Socket to write to the message bus. More...
 
std::map< std::string, zmqpp::socket > topic_socks_
 REP socket to receive command on for topics. More...
 
std::shared_ptr< mqtt::async_client > client_
 The MQTT client. More...
 
std::shared_ptr< const MqttServerConfigconfig_
 
std::vector< std::shared_ptr< const MqttExternalMessage > > topics_
 

Detailed Description

Implementation class, for use by the Mqtt module only.

Definition at line 38 of file MqttExternalServer.hpp.

Constructor & Destructor Documentation

◆ MqttExternalServer()

MqttExternalServer::MqttExternalServer ( zmqpp::context &  ctx,
std::shared_ptr< const MqttServerConfig config,
const std::vector< std::shared_ptr< const MqttExternalMessage >> &  topics 
)
Parameters
ctxZMQ context
configconfiguration of the server.

Definition at line 118 of file MqttExternalServer.cpp.

Member Function Documentation

◆ config()

std::shared_ptr< const MqttServerConfig > MqttExternalServer::config ( ) const

Definition at line 354 of file MqttExternalServer.cpp.

◆ connect()

void MqttExternalServer::connect ( )

Definition at line 158 of file MqttExternalServer.cpp.

◆ disconnect()

void MqttExternalServer::disconnect ( )

Definition at line 187 of file MqttExternalServer.cpp.

◆ handle_mqtt_msg()

void MqttExternalServer::handle_mqtt_msg ( mqtt::const_message_ptr  msg)

Message received from mqtt.

Definition at line 253 of file MqttExternalServer.cpp.

◆ handle_request()

void MqttExternalServer::handle_request ( )

Someone sent a request.

Definition at line 306 of file MqttExternalServer.cpp.

◆ handle_topic_request()

void MqttExternalServer::handle_topic_request ( const std::string &  topic_name)

Request received on the topic specific socket.

Definition at line 192 of file MqttExternalServer.cpp.

◆ name()

const std::string & MqttExternalServer::name ( ) const

Definition at line 344 of file MqttExternalServer.cpp.

◆ register_sockets()

void MqttExternalServer::register_sockets ( zmqpp::reactor *  reactor)

Definition at line 147 of file MqttExternalServer.cpp.

◆ topics()

const std::vector< std::shared_ptr< const MqttExternalMessage > > & MqttExternalServer::topics ( ) const

Definition at line 349 of file MqttExternalServer.cpp.

Member Data Documentation

◆ bus_push_

zmqpp::socket Leosac::Module::Mqtt::MqttExternalServer::bus_push_
private

Socket to write to the message bus.

Definition at line 85 of file MqttExternalServer.hpp.

◆ client_

std::shared_ptr<mqtt::async_client> Leosac::Module::Mqtt::MqttExternalServer::client_
private

The MQTT client.

Definition at line 95 of file MqttExternalServer.hpp.

◆ config_

std::shared_ptr<const MqttServerConfig> Leosac::Module::Mqtt::MqttExternalServer::config_
private

Definition at line 97 of file MqttExternalServer.hpp.

◆ sock_

zmqpp::socket Leosac::Module::Mqtt::MqttExternalServer::sock_
private

REP socket to receive command on.

Definition at line 80 of file MqttExternalServer.hpp.

◆ topic_socks_

std::map<std::string, zmqpp::socket> Leosac::Module::Mqtt::MqttExternalServer::topic_socks_
private

REP socket to receive command on for topics.

Definition at line 90 of file MqttExternalServer.hpp.

◆ topics_

std::vector<std::shared_ptr<const MqttExternalMessage> > Leosac::Module::Mqtt::MqttExternalServer::topics_
private

Definition at line 99 of file MqttExternalServer.hpp.


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