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,101 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/batch/model/ArrayPropertiesDetail.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace Batch
{
namespace Model
{
ArrayPropertiesDetail::ArrayPropertiesDetail() :
m_statusSummaryHasBeenSet(false),
m_size(0),
m_sizeHasBeenSet(false),
m_index(0),
m_indexHasBeenSet(false)
{
}
ArrayPropertiesDetail::ArrayPropertiesDetail(JsonView jsonValue) :
m_statusSummaryHasBeenSet(false),
m_size(0),
m_sizeHasBeenSet(false),
m_index(0),
m_indexHasBeenSet(false)
{
*this = jsonValue;
}
ArrayPropertiesDetail& ArrayPropertiesDetail::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("statusSummary"))
{
Aws::Map<Aws::String, JsonView> statusSummaryJsonMap = jsonValue.GetObject("statusSummary").GetAllObjects();
for(auto& statusSummaryItem : statusSummaryJsonMap)
{
m_statusSummary[statusSummaryItem.first] = statusSummaryItem.second.AsInteger();
}
m_statusSummaryHasBeenSet = true;
}
if(jsonValue.ValueExists("size"))
{
m_size = jsonValue.GetInteger("size");
m_sizeHasBeenSet = true;
}
if(jsonValue.ValueExists("index"))
{
m_index = jsonValue.GetInteger("index");
m_indexHasBeenSet = true;
}
return *this;
}
JsonValue ArrayPropertiesDetail::Jsonize() const
{
JsonValue payload;
if(m_statusSummaryHasBeenSet)
{
JsonValue statusSummaryJsonMap;
for(auto& statusSummaryItem : m_statusSummary)
{
statusSummaryJsonMap.WithInteger(statusSummaryItem.first, statusSummaryItem.second);
}
payload.WithObject("statusSummary", std::move(statusSummaryJsonMap));
}
if(m_sizeHasBeenSet)
{
payload.WithInteger("size", m_size);
}
if(m_indexHasBeenSet)
{
payload.WithInteger("index", m_index);
}
return payload;
}
} // namespace Model
} // namespace Batch
} // namespace Aws