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/utils/memory/stl/AWSString.h>
9 
10 namespace Aws
11 {
12     namespace Client
13     {
14         /**
15         * Call-back context for all async client methods. This allows you to pass a context to your callbacks so that you can identify your requests.
16         * It is entirely intended that you override this class in-lieu of using a void* for the user context. The base class just gives you the ability to
17         * pass a uuid for your context.
18         */
19         class AWS_CORE_API AsyncCallerContext
20         {
21         public:
22             /**
23              * Initializes object with generated UUID
24              */
25             AsyncCallerContext();
26 
27             /**
28              * Initializes object with UUID
29              */
AsyncCallerContext(const Aws::String & uuid)30             AsyncCallerContext(const Aws::String& uuid) : m_uuid(uuid) {}
31 
32             /**
33             * Initializes object with UUID
34             */
AsyncCallerContext(const char * uuid)35             AsyncCallerContext(const char* uuid) : m_uuid(uuid) {}
36 
~AsyncCallerContext()37             virtual ~AsyncCallerContext() {}
38 
39             /**
40              * Gets underlying UUID
41              */
GetUUID()42             inline const Aws::String& GetUUID() const { return m_uuid; }
43 
44             /**
45              * Sets underlying UUID
46              */
SetUUID(const Aws::String & value)47             inline void SetUUID(const Aws::String& value) { m_uuid = value; }
48 
49             /**
50              * Sets underlying UUID
51              */
SetUUID(const char * value)52             inline void SetUUID(const char* value) { m_uuid.assign(value); }
53 
54         private:
55             Aws::String m_uuid;
56         };
57     }
58 }
59