feat(hos_client_create, hos_client_destory): 多次调用destory不会导致重复释放

This commit is contained in:
彭宣正
2020-12-14 17:24:58 +08:00
parent 505d529c32
commit 10b370e486
55976 changed files with 8544395 additions and 2 deletions

View File

@@ -0,0 +1,119 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/appmesh/model/HttpMethod.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>
using namespace Aws::Utils;
namespace Aws
{
namespace AppMesh
{
namespace Model
{
namespace HttpMethodMapper
{
static const int CONNECT_HASH = HashingUtils::HashString("CONNECT");
static const int DELETE__HASH = HashingUtils::HashString("DELETE");
static const int GET__HASH = HashingUtils::HashString("GET");
static const int HEAD_HASH = HashingUtils::HashString("HEAD");
static const int OPTIONS_HASH = HashingUtils::HashString("OPTIONS");
static const int PATCH_HASH = HashingUtils::HashString("PATCH");
static const int POST_HASH = HashingUtils::HashString("POST");
static const int PUT_HASH = HashingUtils::HashString("PUT");
static const int TRACE_HASH = HashingUtils::HashString("TRACE");
HttpMethod GetHttpMethodForName(const Aws::String& name)
{
int hashCode = HashingUtils::HashString(name.c_str());
if (hashCode == CONNECT_HASH)
{
return HttpMethod::CONNECT;
}
else if (hashCode == DELETE__HASH)
{
return HttpMethod::DELETE_;
}
else if (hashCode == GET__HASH)
{
return HttpMethod::GET_;
}
else if (hashCode == HEAD_HASH)
{
return HttpMethod::HEAD;
}
else if (hashCode == OPTIONS_HASH)
{
return HttpMethod::OPTIONS;
}
else if (hashCode == PATCH_HASH)
{
return HttpMethod::PATCH;
}
else if (hashCode == POST_HASH)
{
return HttpMethod::POST;
}
else if (hashCode == PUT_HASH)
{
return HttpMethod::PUT;
}
else if (hashCode == TRACE_HASH)
{
return HttpMethod::TRACE;
}
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
overflowContainer->StoreOverflow(hashCode, name);
return static_cast<HttpMethod>(hashCode);
}
return HttpMethod::NOT_SET;
}
Aws::String GetNameForHttpMethod(HttpMethod enumValue)
{
switch(enumValue)
{
case HttpMethod::CONNECT:
return "CONNECT";
case HttpMethod::DELETE_:
return "DELETE";
case HttpMethod::GET_:
return "GET";
case HttpMethod::HEAD:
return "HEAD";
case HttpMethod::OPTIONS:
return "OPTIONS";
case HttpMethod::PATCH:
return "PATCH";
case HttpMethod::POST:
return "POST";
case HttpMethod::PUT:
return "PUT";
case HttpMethod::TRACE:
return "TRACE";
default:
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
if(overflowContainer)
{
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
}
return {};
}
}
} // namespace HttpMethodMapper
} // namespace Model
} // namespace AppMesh
} // namespace Aws