From edbebb5f477f14dfc86535800201c50ca7781400 Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Fri, 21 Jan 2022 09:19:54 -0800 Subject: [PATCH] Minor class definition updates for AWSGem (#7056) * Move the queued-events constructors for AWSApiClientJob and ServiceRequestJob from public to protected, and add short description for them Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- .../Code/Include/Framework/AWSApiRequestJob.h | 37 ++++++++---------- .../Include/Framework/ServiceRequestJob.h | 38 ++++++++----------- 2 files changed, 30 insertions(+), 45 deletions(-) diff --git a/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h b/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h index 33c7e1ad29..816e9bc4b4 100644 --- a/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h +++ b/Gems/AWSCore/Code/Include/Framework/AWSApiRequestJob.h @@ -188,28 +188,6 @@ namespace AWSCore { } - AwsApiRequestJob(bool queueOnSuccess, - OnSuccessFunction onSuccess, - bool queueOnFailure, - OnFailureFunction onFailure, - bool queueDelete, - IConfig* config = GetDefaultConfig() - ) : AwsApiClientJobType(false, config) - , m_queueOnSuccess{ queueOnSuccess } - , m_onSuccess{ onSuccess } - , m_queueOnFailure{ queueOnFailure } - , m_onFailure{ onFailure } - , m_queueDelete{ queueDelete } - { - } - - AwsApiRequestJob(OnSuccessFunction onSuccess, - OnFailureFunction onFailure, - IConfig* config = GetDefaultConfig() - ) : AwsApiRequestJob(true, onSuccess, true, onFailure, true, config) - { - } - RequestType request; ResultType result; ErrorType error; @@ -232,6 +210,21 @@ namespace AWSCore } protected: + + /// Constructor for creating AwsApiRequestJob Jobs that can handle queued responses + /// for OnSuccess, OnFailure, and DoCleanup + AwsApiRequestJob(OnSuccessFunction onSuccess, + OnFailureFunction onFailure, + IConfig* config = GetDefaultConfig() + ) : AwsApiClientJobType(false, config) + , m_queueOnSuccess{ true } + , m_onSuccess{ onSuccess } + , m_queueOnFailure{ true } + , m_onFailure{ onFailure } + , m_queueDelete{ true } + { + } + bool m_wasSuccess{ false }; // Flag and optional function call to queue for onSuccess events diff --git a/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h b/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h index 6d00122d99..d3eac4983a 100644 --- a/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h +++ b/Gems/AWSCore/Code/Include/Framework/ServiceRequestJob.h @@ -178,29 +178,6 @@ namespace AWSCore } } - ServiceRequestJob(bool queueOnSuccess, - OnSuccessFunction onSuccess, - bool queueOnFailure, - OnFailureFunction onFailure, - bool queueDelete, - IConfig* config = GetDefaultConfig() - ) : ServiceClientJobType{ false, config } - , m_requestUrl{ config->GetRequestUrl() } - , m_queueOnSuccess{ queueOnSuccess } - , m_onSuccess{ onSuccess } - , m_queueOnFailure{ queueOnFailure } - , m_onFailure{ onFailure } - , m_queueDelete{ queueDelete } - { - } - - ServiceRequestJob(OnSuccessFunction onSuccess, - OnFailureFunction onFailure, - IConfig* config = GetDefaultConfig() - ) : ServiceRequestJob(true, onSuccess, true, onFailure, true, config) - { - } - bool HasCredentials(IConfig* config) { if (config == nullptr) @@ -241,6 +218,21 @@ namespace AWSCore /// for replacing these parts of the url. const Aws::String& m_requestUrl; + /// Constructor for creating ServiceRequestJob Jobs that can handle queued responses + /// for OnSuccess, OnFailure, and DoCleanup + ServiceRequestJob(OnSuccessFunction onSuccess, + OnFailureFunction onFailure, + IConfig* config = GetDefaultConfig() + ) : ServiceClientJobType{ false, config } + , m_requestUrl{ config->GetRequestUrl() } + , m_queueOnSuccess{ true } + , m_onSuccess{ onSuccess } + , m_queueOnFailure{ true } + , m_onFailure{ onFailure } + , m_queueDelete{ true } + { + } + // Flag and optional function call to queue for onSuccess events bool m_queueOnSuccess{ false }; OnSuccessFunction m_onSuccess{};