MQTTSuite
Loading...
Searching...
No Matches
mqtt::bridge::SocketContextFactory Class Reference

#include <SocketContextFactory.h>

Inheritance diagram for mqtt::bridge::SocketContextFactory:
Collaboration diagram for mqtt::bridge::SocketContextFactory:

Public Member Functions

 SocketContextFactory (const mqtt::bridge::lib::Broker &broker)
core::socket::stream::SocketContext * create (core::socket::stream::SocketConnection *socketConnection) final

Private Attributes

const mqtt::bridge::lib::Brokerbroker

Detailed Description

Definition at line 57 of file SocketContextFactory.h.

Constructor & Destructor Documentation

◆ SocketContextFactory()

mqtt::bridge::SocketContextFactory::SocketContextFactory ( const mqtt::bridge::lib::Broker & broker)
explicit

Definition at line 61 of file SocketContextFactory.cpp.

62 : broker(broker) {
63 }
const mqtt::bridge::lib::Broker & broker

References broker.

Member Function Documentation

◆ create()

core::socket::stream::SocketContext * mqtt::bridge::SocketContextFactory::create ( core::socket::stream::SocketConnection * socketConnection)
final

Definition at line 65 of file SocketContextFactory.cpp.

65 {
66 VLOG(1) << " Creating Broker instance '" << broker.getName() << "' of Bridge '" << broker.getBridge().getName() << "'";
67 VLOG(1) << " Bridge client id : " << broker.getClientId();
68 VLOG(1) << " Transport: " << broker.getTransport();
69 VLOG(1) << " Protocol: " << broker.getProtocol();
70 VLOG(1) << " Encryption: " << broker.getEncryption();
71
72 VLOG(1) << " Topics:";
73 const std::list<iot::mqtt::Topic>& topics = broker.getTopics();
74 for (const iot::mqtt::Topic& topic : topics) {
75 VLOG(1) << " " << static_cast<uint16_t>(topic.getQoS()) << ":" << topic.getName();
76 }
77
78 return new iot::mqtt::SocketContext(socketConnection, new mqtt::bridge::lib::Mqtt(socketConnection->getConnectionName(), broker));
79 }

References broker, mqtt::bridge::lib::Broker::getBridge(), mqtt::bridge::lib::Broker::getClientId(), mqtt::bridge::lib::Broker::getEncryption(), mqtt::bridge::lib::Bridge::getName(), mqtt::bridge::lib::Broker::getName(), mqtt::bridge::lib::Broker::getProtocol(), mqtt::bridge::lib::Broker::getTopics(), mqtt::bridge::lib::Broker::getTransport(), and mqtt::bridge::lib::Mqtt::Mqtt().

Here is the call graph for this function:

Member Data Documentation

◆ broker

const mqtt::bridge::lib::Broker& mqtt::bridge::SocketContextFactory::broker
private

Definition at line 64 of file SocketContextFactory.h.

Referenced by create(), and SocketContextFactory().


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