aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Bootstrap.h
Go to the documentation of this file.
1#pragma once
7#include <aws/crt/Exports.h>
8#include <aws/crt/Types.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
35 {
36 public:
42 EventLoopGroup &elGroup,
43 HostResolver &resolver,
44 Allocator *allocator = g_allocator) noexcept;
45
51 ClientBootstrap(Allocator *allocator = g_allocator) noexcept;
52
58
62 operator bool() const noexcept;
63
67 int LastError() const noexcept;
68
75 void SetShutdownCompleteCallback(OnClientBootstrapShutdownComplete callback);
76
89 void EnableBlockingShutdown() noexcept;
90
92 aws_client_bootstrap *GetUnderlyingHandle() const noexcept;
93
94 private:
95 aws_client_bootstrap *m_bootstrap;
96 int m_lastError;
97 std::unique_ptr<class ClientBootstrapCallbackData> m_callbackData;
98 std::future<void> m_shutdownFuture;
99 bool m_enableBlockingShutdown;
100 };
101 } // namespace Io
102 } // namespace Crt
103} // namespace Aws
#define AWS_CRT_CPP_API
Definition: Exports.h:37
Definition: Bootstrap.h:35
ClientBootstrap(ClientBootstrap &&)=delete
ClientBootstrap & operator=(ClientBootstrap &&)=delete
ClientBootstrap(const ClientBootstrap &)=delete
ClientBootstrap & operator=(const ClientBootstrap &)=delete
Definition: EventLoopGroup.h:33
Definition: HostResolver.h:35
std::function< void()> OnClientBootstrapShutdownComplete
Definition: Bootstrap.h:23
aws_allocator Allocator
Definition: StlAllocator.h:17
AWS_CRT_CPP_API Allocator * g_allocator
Definition: Api.cpp:23
AWS_CRT_CPP_API int LastError() noexcept
Definition: Api.cpp:391
Definition: Api.h:14
Definition: StringView.h:851