1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 
8 #include <aws/core/Core_EXPORTS.h>
9 
10 namespace Aws
11 {
12     namespace Crt
13     {
14         class ApiHandle;
15 
16         namespace Io
17         {
18             class ClientBootstrap;
19             class TlsConnectionOptions;
20 
21         }
22     }
23 
24     /**
25      * Like we need to call InitAPI() to initialize aws-sdk-cpp, we need ApiHandle to initialize aws-crt-cpp, which is a wrapper of a collection of common runtime libraries.
26      * We will wrap the memory management system and pass it to common runtime libraries via ApiHandle.
27      */
28     AWS_CORE_API Aws::Crt::ApiHandle* GetApiHandle();
29 
30     /**
31      * Set the default ClientBootStrap for AWS common runtime libraries in the global scope.
32      */
33     AWS_CORE_API void SetDefaultClientBootstrap(const std::shared_ptr<Aws::Crt::Io::ClientBootstrap>& clientBootstrap);
34 
35     /**
36      * Get the default ClientBootStrap for AWS common runtime libraries in the global scope.
37      */
38     AWS_CORE_API Aws::Crt::Io::ClientBootstrap* GetDefaultClientBootstrap();
39 
40     /**
41      * Set the default TlsConnectionOptions for AWS common runtime libraries in the global scope.
42      */
43     AWS_CORE_API void SetDefaultTlsConnectionOptions(const std::shared_ptr<Aws::Crt::Io::TlsConnectionOptions>& tlsConnectionOptions);
44 
45     /**
46      * Get the default TlsConnectionOptions for AWS common runtime libraries in the global scope.
47      */
48     AWS_CORE_API Aws::Crt::Io::TlsConnectionOptions* GetDefaultTlsConnectionOptions();
49 
50     /**
51      * Initialize ApiHandle in aws-crt-cpp.
52      */
53     void InitializeCrt();
54 
55     /**
56      * Clean up ApiHandle in aws-crt-cpp.
57      */
58     void CleanupCrt();
59 
60     namespace Utils
61     {
62         class EnumParseOverflowContainer;
63     }
64     /**
65      * This is used to handle the Enum round tripping problem
66      * for when a service updates their enumerations, but the user does not
67      * have an up to date client. This container will be initialized during Aws::InitAPI
68      * and will be cleaned on Aws::ShutdownAPI.
69      */
70     AWS_CORE_API Utils::EnumParseOverflowContainer* GetEnumOverflowContainer();
71 
72     /**
73      * Initializes a global overflow container to a new instance.
74      * This should only be called once from within Aws::InitAPI
75      */
76     void InitializeEnumOverflowContainer();
77 
78     /**
79      * Destroys the global overflow container instance.
80      * This should only be called once from within Aws::ShutdownAPI
81      */
82     void CleanupEnumOverflowContainer();
83 }
84