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,132 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/iotevents-data/model/Detector.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace IoTEventsData
{
namespace Model
{
Detector::Detector() :
m_detectorModelNameHasBeenSet(false),
m_keyValueHasBeenSet(false),
m_detectorModelVersionHasBeenSet(false),
m_stateHasBeenSet(false),
m_creationTimeHasBeenSet(false),
m_lastUpdateTimeHasBeenSet(false)
{
}
Detector::Detector(JsonView jsonValue) :
m_detectorModelNameHasBeenSet(false),
m_keyValueHasBeenSet(false),
m_detectorModelVersionHasBeenSet(false),
m_stateHasBeenSet(false),
m_creationTimeHasBeenSet(false),
m_lastUpdateTimeHasBeenSet(false)
{
*this = jsonValue;
}
Detector& Detector::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("detectorModelName"))
{
m_detectorModelName = jsonValue.GetString("detectorModelName");
m_detectorModelNameHasBeenSet = true;
}
if(jsonValue.ValueExists("keyValue"))
{
m_keyValue = jsonValue.GetString("keyValue");
m_keyValueHasBeenSet = true;
}
if(jsonValue.ValueExists("detectorModelVersion"))
{
m_detectorModelVersion = jsonValue.GetString("detectorModelVersion");
m_detectorModelVersionHasBeenSet = true;
}
if(jsonValue.ValueExists("state"))
{
m_state = jsonValue.GetObject("state");
m_stateHasBeenSet = true;
}
if(jsonValue.ValueExists("creationTime"))
{
m_creationTime = jsonValue.GetDouble("creationTime");
m_creationTimeHasBeenSet = true;
}
if(jsonValue.ValueExists("lastUpdateTime"))
{
m_lastUpdateTime = jsonValue.GetDouble("lastUpdateTime");
m_lastUpdateTimeHasBeenSet = true;
}
return *this;
}
JsonValue Detector::Jsonize() const
{
JsonValue payload;
if(m_detectorModelNameHasBeenSet)
{
payload.WithString("detectorModelName", m_detectorModelName);
}
if(m_keyValueHasBeenSet)
{
payload.WithString("keyValue", m_keyValue);
}
if(m_detectorModelVersionHasBeenSet)
{
payload.WithString("detectorModelVersion", m_detectorModelVersion);
}
if(m_stateHasBeenSet)
{
payload.WithObject("state", m_state.Jsonize());
}
if(m_creationTimeHasBeenSet)
{
payload.WithDouble("creationTime", m_creationTime.SecondsWithMSPrecision());
}
if(m_lastUpdateTimeHasBeenSet)
{
payload.WithDouble("lastUpdateTime", m_lastUpdateTime.SecondsWithMSPrecision());
}
return payload;
}
} // namespace Model
} // namespace IoTEventsData
} // namespace Aws