AWS IoT Device SDK C++ v2: crt/aws-crt-cpp/include/aws/crt/io/Bootstrap.h Source File

AWS IoT Device SDK C++ v2 1.14.0 AWS IoT Device SDK C++ v2

Bootstrap.h
Go to the documentation of this file.
1#pragma once
7#include <aws/crt/Exports.h>
8#include <aws/crt/Types.h>
9#include <aws/crt/io/EventLoopGroup.h>
10#include <aws/crt/io/HostResolver.h>
11
12#include <aws/io/channel_bootstrap.h>
13#include <aws/io/host_resolver.h>
14
15#include <future>
16
17namespace Aws
18{
19 namespace Crt
20 {
21 namespace Io
22 {
23 using OnClientBootstrapShutdownComplete = std::function<void()>;
24
34 class AWS_CRT_CPP_API ClientBootstrap final
35 {
36 public:
41 ClientBootstrap(
42 EventLoopGroup &elGroup,
43 HostResolver &resolver,
44 Allocator *allocator = g_allocator) noexcept;
45 ~ClientBootstrap();
46 ClientBootstrap(const ClientBootstrap &) = delete;
47 ClientBootstrap &operator=(const ClientBootstrap &) = delete;
48 ClientBootstrap(ClientBootstrap &&) = delete;
49 ClientBootstrap &operator=(ClientBootstrap &&) = delete;
50
54 operator bool() const noexcept;
55
59 int LastError() const noexcept;
60
67 void SetShutdownCompleteCallback(OnClientBootstrapShutdownComplete callback);
68
81 void EnableBlockingShutdown() noexcept;
82
84 aws_client_bootstrap *GetUnderlyingHandle() const noexcept;
85
86 private:
87 aws_client_bootstrap *m_bootstrap;
88 int m_lastError;
89 std::unique_ptr<class ClientBootstrapCallbackData> m_callbackData;
90 std::future<void> m_shutdownFuture;
91 bool m_enableBlockingShutdown;
92 };
93 } // namespace Io
94 } // namespace Crt
95} // namespace Aws
EventLoopGroup.h
HostResolver.h
Types.h
Aws::Crt::Io::ClientBootstrap
Definition: Bootstrap.h:35
Aws::Crt::Io::ClientBootstrap::ClientBootstrap
ClientBootstrap(ClientBootstrap &&)=delete
Aws::Crt::Io::ClientBootstrap::operator=
ClientBootstrap & operator=(ClientBootstrap &&)=delete
Aws::Crt::Io::ClientBootstrap::ClientBootstrap
ClientBootstrap(const ClientBootstrap &)=delete
Aws::Crt::Io::ClientBootstrap::operator=
ClientBootstrap & operator=(const ClientBootstrap &)=delete
Aws::Crt::Io::EventLoopGroup
Definition: EventLoopGroup.h:33
Aws::Crt::Io::HostResolver
Definition: HostResolver.h:35
Exports.h
AWS_CRT_CPP_API
#define AWS_CRT_CPP_API
Definition: Exports.h:37
Aws::Crt::Io::OnClientBootstrapShutdownComplete
std::function< void()> OnClientBootstrapShutdownComplete
Definition: Bootstrap.h:23
Aws::Crt::Allocator
aws_allocator Allocator
Definition: StlAllocator.h:17
Aws::Crt::g_allocator
AWS_CRT_CPP_API Allocator * g_allocator
Definition: Api.cpp:21
Aws::Crt::LastError
AWS_CRT_CPP_API int LastError() noexcept
Definition: Api.cpp:315
Aws
Definition: Api.h:17
std
Definition: StringView.h:851