Skip to content

Commit 0f9de6f

Browse files
committed
CBOR perf tests for cloud desktop
1 parent c313572 commit 0f9de6f

File tree

57 files changed

+7471
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+7471
-20
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
add_project(aws-cpp-sdk-echo "C++ SDK for the AWS echo service" aws-cpp-sdk-core)
2+
3+
file(GLOB AWS_ECHO_HEADERS
4+
"include/aws/echo/*.h"
5+
)
6+
7+
file(GLOB AWS_ECHO_MODEL_HEADERS
8+
"include/aws/echo/model/*.h"
9+
)
10+
11+
file(GLOB AWS_ECHO_SOURCE
12+
"source/*.cpp"
13+
)
14+
15+
file(GLOB AWS_ECHO_MODEL_SOURCE
16+
"source/model/*.cpp"
17+
)
18+
19+
file(GLOB ECHO_UNIFIED_HEADERS
20+
${AWS_ECHO_HEADERS}
21+
${AWS_ECHO_MODEL_HEADERS}
22+
)
23+
24+
file(GLOB ECHO_UNITY_SRC
25+
${AWS_ECHO_SOURCE}
26+
${AWS_ECHO_MODEL_SOURCE}
27+
)
28+
29+
if(ENABLE_UNITY_BUILD)
30+
enable_unity_build("ECHO" ECHO_UNITY_SRC)
31+
endif()
32+
33+
file(GLOB ECHO_SRC
34+
${ECHO_UNIFIED_HEADERS}
35+
${ECHO_UNITY_SRC}
36+
)
37+
38+
if(WIN32)
39+
#if we are compiling for visual studio, create a sane directory tree.
40+
if(MSVC)
41+
source_group("Header Files\\aws\\echo" FILES ${AWS_ECHO_HEADERS})
42+
source_group("Header Files\\aws\\echo\\model" FILES ${AWS_ECHO_MODEL_HEADERS})
43+
source_group("Source Files" FILES ${AWS_ECHO_SOURCE})
44+
source_group("Source Files\\model" FILES ${AWS_ECHO_MODEL_SOURCE})
45+
endif(MSVC)
46+
endif()
47+
48+
set(ECHO_INCLUDES
49+
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
50+
)
51+
52+
add_library(${PROJECT_NAME} ${ECHO_SRC})
53+
add_library(AWS::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
54+
55+
set_compiler_flags(${PROJECT_NAME})
56+
set_compiler_warnings(${PROJECT_NAME})
57+
58+
if(USE_WINDOWS_DLL_SEMANTICS AND BUILD_SHARED_LIBS)
59+
target_compile_definitions(${PROJECT_NAME} PRIVATE "AWS_ECHO_EXPORTS")
60+
endif()
61+
62+
target_include_directories(${PROJECT_NAME} PUBLIC
63+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
64+
$<INSTALL_INTERFACE:include>)
65+
66+
target_link_libraries(${PROJECT_NAME} PRIVATE ${PLATFORM_DEP_LIBS} ${PROJECT_LIBS})
67+
68+
69+
setup_install()
70+
71+
install (FILES ${AWS_ECHO_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/echo)
72+
install (FILES ${AWS_ECHO_MODEL_HEADERS} DESTINATION ${INCLUDE_DIRECTORY}/aws/echo/model)
73+
74+
do_packaging()
75+
76+
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
#include <aws/echo/Echo_EXPORTS.h>
8+
#include <aws/core/client/ClientConfiguration.h>
9+
#include <aws/core/client/AWSClient.h>
10+
#include <aws/core/client/AWSClientAsyncCRTP.h>
11+
#include <aws/crt/cbor/Cbor.h>
12+
#include <aws/echo/EchoServiceClientModel.h>
13+
14+
namespace Aws
15+
{
16+
namespace Echo
17+
{
18+
class AWS_ECHO_API EchoClient : public Aws::Client::AWSRpcV2CborClient, public Aws::Client::ClientWithAsyncTemplateMethods<EchoClient>
19+
{
20+
public:
21+
typedef Aws::Client::AWSRpcV2CborClient BASECLASS;
22+
static const char* GetServiceName();
23+
static const char* GetAllocationTag();
24+
25+
typedef EchoClientConfiguration ClientConfigurationType;
26+
typedef EchoEndpointProvider EndpointProviderType;
27+
28+
/**
29+
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
30+
* is not specified, it will be initialized to default values.
31+
*/
32+
EchoClient(const Aws::Echo::EchoClientConfiguration& clientConfiguration = Aws::Echo::EchoClientConfiguration(),
33+
std::shared_ptr<EchoEndpointProviderBase> endpointProvider = nullptr);
34+
35+
/**
36+
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
37+
* is not specified, it will be initialized to default values.
38+
*/
39+
EchoClient(const Aws::Auth::AWSCredentials& credentials,
40+
std::shared_ptr<EchoEndpointProviderBase> endpointProvider = nullptr,
41+
const Aws::Echo::EchoClientConfiguration& clientConfiguration = Aws::Echo::EchoClientConfiguration());
42+
43+
/**
44+
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
45+
* the default http client factory will be used
46+
*/
47+
EchoClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
48+
std::shared_ptr<EchoEndpointProviderBase> endpointProvider = nullptr,
49+
const Aws::Echo::EchoClientConfiguration& clientConfiguration = Aws::Echo::EchoClientConfiguration());
50+
51+
52+
/* Legacy constructors due deprecation */
53+
/**
54+
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
55+
* is not specified, it will be initialized to default values.
56+
*/
57+
EchoClient(const Aws::Client::ClientConfiguration& clientConfiguration);
58+
59+
/**
60+
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
61+
* is not specified, it will be initialized to default values.
62+
*/
63+
EchoClient(const Aws::Auth::AWSCredentials& credentials,
64+
const Aws::Client::ClientConfiguration& clientConfiguration);
65+
66+
/**
67+
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
68+
* the default http client factory will be used
69+
*/
70+
EchoClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider,
71+
const Aws::Client::ClientConfiguration& clientConfiguration);
72+
73+
/* End of legacy constructors due deprecation */
74+
virtual ~EchoClient();
75+
76+
/**
77+
*
78+
*/
79+
virtual Model::EchoOperationOutcome EchoOperation(const Model::EchoOperationRequest& request = {}) const;
80+
81+
/**
82+
* A Callable wrapper for EchoOperation that returns a future to the operation so that it can be executed in parallel to other requests.
83+
*/
84+
template<typename EchoOperationRequestT = Model::EchoOperationRequest>
85+
Model::EchoOperationOutcomeCallable EchoOperationCallable(const EchoOperationRequestT& request = {}) const
86+
{
87+
return SubmitCallable(&EchoClient::EchoOperation, request);
88+
}
89+
90+
/**
91+
* An Async wrapper for EchoOperation that queues the request into a thread executor and triggers associated callback when operation has finished.
92+
*/
93+
template<typename EchoOperationRequestT = Model::EchoOperationRequest>
94+
void EchoOperationAsync(const EchoOperationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr, const EchoOperationRequestT& request = {}) const
95+
{
96+
return SubmitAsync(&EchoClient::EchoOperation, request, handler, context);
97+
}
98+
99+
100+
void OverrideEndpoint(const Aws::String& endpoint);
101+
std::shared_ptr<EchoEndpointProviderBase>& accessEndpointProvider();
102+
private:
103+
friend class Aws::Client::ClientWithAsyncTemplateMethods<EchoClient>;
104+
void init(const EchoClientConfiguration& clientConfiguration);
105+
106+
EchoClientConfiguration m_clientConfiguration;
107+
std::shared_ptr<EchoEndpointProviderBase> m_endpointProvider;
108+
};
109+
110+
} // namespace Echo
111+
} // namespace Aws
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
#include <aws/echo/Echo_EXPORTS.h>
8+
#include <aws/core/client/GenericClientConfiguration.h>
9+
#include <aws/core/endpoint/DefaultEndpointProvider.h>
10+
#include <aws/core/endpoint/EndpointParameter.h>
11+
#include <aws/core/utils/memory/stl/AWSString.h>
12+
#include <aws/core/utils/memory/stl/AWSVector.h>
13+
14+
#include <aws/echo/EchoEndpointRules.h>
15+
16+
17+
namespace Aws
18+
{
19+
namespace Echo
20+
{
21+
namespace Endpoint
22+
{
23+
using EndpointParameters = Aws::Endpoint::EndpointParameters;
24+
using Aws::Endpoint::EndpointProviderBase;
25+
using Aws::Endpoint::DefaultEndpointProvider;
26+
27+
using EchoClientContextParameters = Aws::Endpoint::ClientContextParameters;
28+
29+
using EchoClientConfiguration = Aws::Client::GenericClientConfiguration;
30+
using EchoBuiltInParameters = Aws::Endpoint::BuiltInParameters;
31+
32+
/**
33+
* The type for the Echo Client Endpoint Provider.
34+
* Inherit from this Base class / "Interface" should you want to provide a custom endpoint provider.
35+
* The SDK must use service-specific type for each service per specification.
36+
*/
37+
using EchoEndpointProviderBase =
38+
EndpointProviderBase<EchoClientConfiguration, EchoBuiltInParameters, EchoClientContextParameters>;
39+
40+
using EchoDefaultEpProviderBase =
41+
DefaultEndpointProvider<EchoClientConfiguration, EchoBuiltInParameters, EchoClientContextParameters>;
42+
43+
/**
44+
* Default endpoint provider used for this service
45+
*/
46+
class AWS_ECHO_API EchoEndpointProvider : public EchoDefaultEpProviderBase
47+
{
48+
public:
49+
using EchoResolveEndpointOutcome = Aws::Endpoint::ResolveEndpointOutcome;
50+
51+
EchoEndpointProvider()
52+
: EchoDefaultEpProviderBase(Aws::Echo::EchoEndpointRules::GetRulesBlob(), Aws::Echo::EchoEndpointRules::RulesBlobSize)
53+
{}
54+
55+
~EchoEndpointProvider()
56+
{
57+
}
58+
};
59+
} // namespace Endpoint
60+
} // namespace Echo
61+
} // namespace Aws
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
#include <cstddef>
8+
#include <aws/echo/Echo_EXPORTS.h>
9+
10+
namespace Aws
11+
{
12+
namespace Echo
13+
{
14+
class EchoEndpointRules
15+
{
16+
public:
17+
static const size_t RulesBlobStrLen;
18+
static const size_t RulesBlobSize;
19+
20+
static const char* GetRulesBlob();
21+
};
22+
} // namespace Echo
23+
} // namespace Aws
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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/echo/Echo_EXPORTS.h>
9+
#include <aws/core/client/AWSErrorMarshaller.h>
10+
11+
namespace Aws
12+
{
13+
namespace Client
14+
{
15+
16+
class AWS_ECHO_API EchoErrorMarshaller : public Aws::Client::RpcV2ErrorMarshaller
17+
{
18+
public:
19+
Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override;
20+
};
21+
22+
} // namespace Client
23+
} // namespace Aws
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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/client/AWSError.h>
9+
#include <aws/core/client/CoreErrors.h>
10+
#include <aws/echo/Echo_EXPORTS.h>
11+
12+
namespace Aws
13+
{
14+
namespace Echo
15+
{
16+
enum class EchoErrors
17+
{
18+
//From Core//
19+
//////////////////////////////////////////////////////////////////////////////////////////
20+
INCOMPLETE_SIGNATURE = 0,
21+
INTERNAL_FAILURE = 1,
22+
INVALID_ACTION = 2,
23+
INVALID_CLIENT_TOKEN_ID = 3,
24+
INVALID_PARAMETER_COMBINATION = 4,
25+
INVALID_QUERY_PARAMETER = 5,
26+
INVALID_PARAMETER_VALUE = 6,
27+
MISSING_ACTION = 7, // SDK should never allow
28+
MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
29+
MISSING_PARAMETER = 9, // SDK should never allow
30+
OPT_IN_REQUIRED = 10,
31+
REQUEST_EXPIRED = 11,
32+
SERVICE_UNAVAILABLE = 12,
33+
THROTTLING = 13,
34+
VALIDATION = 14,
35+
ACCESS_DENIED = 15,
36+
RESOURCE_NOT_FOUND = 16,
37+
UNRECOGNIZED_CLIENT = 17,
38+
MALFORMED_QUERY_STRING = 18,
39+
SLOW_DOWN = 19,
40+
REQUEST_TIME_TOO_SKEWED = 20,
41+
INVALID_SIGNATURE = 21,
42+
SIGNATURE_DOES_NOT_MATCH = 22,
43+
INVALID_ACCESS_KEY_ID = 23,
44+
REQUEST_TIMEOUT = 24,
45+
NETWORK_CONNECTION = 99,
46+
47+
UNKNOWN = 100,
48+
///////////////////////////////////////////////////////////////////////////////////////////
49+
50+
51+
};
52+
53+
class AWS_ECHO_API EchoError : public Aws::Client::AWSError<EchoErrors>
54+
{
55+
public:
56+
EchoError() {}
57+
EchoError(const Aws::Client::AWSError<Aws::Client::CoreErrors>& rhs) : Aws::Client::AWSError<EchoErrors>(rhs) {}
58+
EchoError(Aws::Client::AWSError<Aws::Client::CoreErrors>&& rhs) : Aws::Client::AWSError<EchoErrors>(rhs) {}
59+
EchoError(const Aws::Client::AWSError<EchoErrors>& rhs) : Aws::Client::AWSError<EchoErrors>(rhs) {}
60+
EchoError(Aws::Client::AWSError<EchoErrors>&& rhs) : Aws::Client::AWSError<EchoErrors>(rhs) {}
61+
62+
template <typename T>
63+
T GetModeledError();
64+
};
65+
66+
namespace EchoErrorMapper
67+
{
68+
AWS_ECHO_API Aws::Client::AWSError<Aws::Client::CoreErrors> GetErrorForName(const char* errorName);
69+
}
70+
71+
} // namespace Echo
72+
} // namespace Aws

0 commit comments

Comments
 (0)