AWS SDK for C++  1.8.23
AWS SDK for C++
Aws.h
Go to the documentation of this file.
1 
5 #pragma once
6 
13 #include <aws/core/Core_EXPORTS.h>
14 
15 namespace Aws
16 {
17  static const char* DEFAULT_LOG_PREFIX = "aws_sdk_";
18 
23  {
24  LoggingOptions() : logLevel(Aws::Utils::Logging::LogLevel::Off), defaultLogPrefix(DEFAULT_LOG_PREFIX)
25  { }
26 
31 
35  const char* defaultLogPrefix;
36 
41  std::function<std::shared_ptr<Aws::Utils::Logging::LogSystemInterface>()> logger_create_fn;
42  };
43 
48  {
49  MemoryManagementOptions() : memoryManager(nullptr)
50  { }
51 
58  };
59 
63  struct HttpOptions
64  {
65  HttpOptions() : initAndCleanupCurl(true), installSigPipeHandler(false)
66  { }
67 
71  std::function<std::shared_ptr<Aws::Http::HttpClientFactory>()> httpClientFactory_create_fn;
85  };
86 
91  {
92  CryptoOptions() : initAndCleanupOpenSSL(true)
93  { }
94 
98  std::function<std::shared_ptr<Aws::Utils::Crypto::HashFactory>()> md5Factory_create_fn;
102  std::function<std::shared_ptr<Aws::Utils::Crypto::HashFactory>()> sha256Factory_create_fn;
106  std::function<std::shared_ptr<Aws::Utils::Crypto::HMACFactory>()> sha256HMACFactory_create_fn;
110  std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_CBCFactory_create_fn;
114  std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_CTRFactory_create_fn;
118  std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_GCMFactory_create_fn;
122  std::function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory>()> aes_KeyWrapFactory_create_fn;
126  std::function<std::shared_ptr<Aws::Utils::Crypto::SecureRandomFactory>()> secureRandomFactory_create_fn;
133  };
134 
139  {
146  std::vector<Aws::Monitoring::MonitoringFactoryCreateFunction> customizedMonitoringFactory_create_fn;
147  };
148 
149 
190  struct SDKOptions
191  {
208 
215  };
216 
217  /*
218  * Initialize SDK wide state for the SDK. This method must be called before doing anything else with this library.
219  *
220  * Common Recipes:
221  *
222  * Just use defaults:
223  *
224  * SDKOptions options;
225  * Aws::InitAPI(options);
226  * .....
227  * Aws::ShutdownAPI(options);
228  *
229  * Turn logging on using the default logger:
230  *
231  * SDKOptions options;
232  * options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Info;
233  * Aws::InitAPI(options);
234  * .....
235  * Aws::ShutdownAPI(options);
236  *
237  * Install custom memory manager:
238  *
239  * MyMemoryManager memoryManager;
240  *
241  * SDKOptions options;
242  * options.memoryManagementOptions.memoryManager = &memoryManager;
243  * Aws::InitAPI(options);
244  * .....
245  * Aws::ShutdownAPI(options);
246  *
247  * Override default http client factory
248  *
249  * SDKOptions options;
250  * options.httpOptions.httpClientFactory_create_fn = [](){ return Aws::MakeShared<MyCustomHttpClientFactory>("ALLOC_TAG", arg1); };
251  * Aws::InitAPI(options);
252  * .....
253  * Aws::ShutdownAPI(options);
254  */
255  AWS_CORE_API void InitAPI(const SDKOptions& options);
256 
261  AWS_CORE_API void ShutdownAPI(const SDKOptions& options);
262 }
const char * defaultLogPrefix
Definition: Aws.h:35
bool initAndCleanupCurl
Definition: Aws.h:76
std::function< std::shared_ptr< Aws::Utils::Logging::LogSystemInterface >)> logger_create_fn
Definition: Aws.h:41
MemoryManagementOptions memoryManagementOptions
Definition: Aws.h:199
std::vector< Aws::Monitoring::MonitoringFactoryCreateFunction > customizedMonitoringFactory_create_fn
Definition: Aws.h:146
bool initAndCleanupOpenSSL
Definition: Aws.h:132
static const char * DEFAULT_LOG_PREFIX
Definition: Aws.h:17
MonitoringOptions monitoringOptions
Definition: Aws.h:214
LoggingOptions loggingOptions
Definition: Aws.h:195
bool installSigPipeHandler
Definition: Aws.h:84
AWS_CORE_API void ShutdownAPI(const SDKOptions &options)
CryptoOptions cryptoOptions
Definition: Aws.h:207
Aws::Utils::Memory::MemorySystemInterface * memoryManager
Definition: Aws.h:57
Aws::Utils::Logging::LogLevel logLevel
Definition: Aws.h:30
HttpOptions httpOptions
Definition: Aws.h:203
AWS_CORE_API void InitAPI(const SDKOptions &options)
#define AWS_CORE_API
Definition: Core_EXPORTS.h:25
HttpOptions()
Definition: Aws.h:65