aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Loading...
Searching...
No Matches
MqttClient.h
Go to the documentation of this file.
1#pragma once
6#include <aws/crt/Exports.h>
8#include <aws/crt/Types.h>
13
14#include <aws/mqtt/client.h>
15#include <aws/mqtt/v5/mqtt5_client.h>
16
17#include <atomic>
18#include <functional>
19#include <memory>
20
21namespace Aws
22{
23 namespace Crt
24 {
25 namespace Io
26 {
27 class ClientBootstrap;
28 }
29
30 namespace Http
31 {
32 class HttpRequest;
33 }
34
35 namespace Mqtt5
36 {
37 class Mqtt5ClientCore;
38 }
39
40 namespace Mqtt
41 {
48 {
49 public:
54
61 MqttClient(Allocator *allocator = ApiAllocator()) noexcept;
62
64 MqttClient(const MqttClient &) = delete;
68
72 operator bool() const noexcept;
73
77 int LastError() const noexcept;
78
95 std::shared_ptr<MqttConnection> NewConnection(
96 const char *hostName,
97 uint32_t port,
98 const Io::SocketOptions &socketOptions,
99 const Crt::Io::TlsContext &tlsContext,
100 bool useWebsocket = false,
101 bool enableMetrics = true,
102 const Crt::Optional<Mqtt::AWSIoTMetrics> &sdkMetrics =
103 Crt::Optional<Mqtt::AWSIoTMetrics>()) noexcept;
104
119 std::shared_ptr<MqttConnection> NewConnection(
120 const char *hostName,
121 uint32_t port,
122 const Io::SocketOptions &socketOptions,
123 bool useWebsocket = false,
124 bool enableMetrics = true,
125 const Crt::Optional<Mqtt::AWSIoTMetrics> &sdkMetrics =
126 Crt::Optional<Mqtt::AWSIoTMetrics>()) noexcept;
127
128 private:
129 aws_mqtt_client *m_client;
130 };
131 } // namespace Mqtt
132 } // namespace Crt
133} // namespace Aws
#define AWS_CRT_CPP_API
Definition Exports.h:36
Definition Bootstrap.h:35
Definition IoTSDKMetrics.h:26
Definition MqttClient.h:48
MqttClient(const MqttClient &)=delete
Definition MqttConnection.h:158
Definition Optional.h:19
aws_allocator Allocator
Definition Allocator.h:14
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition Allocator.cpp:24
std::unique_ptr< T, std::function< void(T *)> > ScopedResource
Definition Types.h:168
Definition Allocator.h:11
Definition StringView.h:862