AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
CapabilityState.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYSTATE_H_
16 #define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYSTATE_H_
17 
18 #include <cstdint>
19 #include <string>
20 
22 
23 namespace alexaClientSDK {
24 namespace avsCommon {
25 namespace avs {
26 
41  const std::string& valuePayload,
43  const uint32_t uncertaintyInMilliseconds = 0);
44 
50  CapabilityState(const CapabilityState& other) = default;
51 
57  CapabilityState() = default;
58 
64  CapabilityState& operator=(const CapabilityState& other) = default;
65 
71  inline bool operator==(const CapabilityState& rhs) const;
73  inline bool operator!=(const CapabilityState& rhs) const;
75 
77  std::string valuePayload;
78 
81 
84 };
85 
87  auto thisTime = timeOfSample.getTime_Unix();
88  auto rhsTime = rhs.timeOfSample.getTime_Unix();
89  return std::tie(valuePayload, thisTime, uncertaintyInMilliseconds) ==
90  std::tie(rhs.valuePayload, rhsTime, rhs.uncertaintyInMilliseconds);
91 }
93  return !(rhs == *this);
94 }
95 
97  const std::string& valuePayload,
99  const uint32_t uncertaintyInMilliseconds) :
100  valuePayload(valuePayload),
101  timeOfSample(timeOfSample),
102  uncertaintyInMilliseconds(uncertaintyInMilliseconds) {
103 }
104 
105 } // namespace avs
106 } // namespace avsCommon
107 } // namespace alexaClientSDK
108 
109 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_CAPABILITYSTATE_H_
utils::timing::TimePoint timeOfSample
The time at which the property value was recorded.
Definition: CapabilityState.h:80
std::string valuePayload
A string representation of the value payload.
Definition: CapabilityState.h:77
int64_t getTime_Unix() const
Definition: TimePoint.cpp:67
uint32_t uncertaintyInMilliseconds
The number of milliseconds that have elapsed since the property value was last confirmed.
Definition: CapabilityState.h:83
CapabilityState & operator=(const CapabilityState &other)=default
Definition: CapabilityState.h:31
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
bool operator==(const CapabilityState &rhs) const
Definition: CapabilityState.h:86
static TimePoint now()
Definition: TimePoint.cpp:41
bool operator!=(const CapabilityState &rhs) const
Definition: CapabilityState.h:92

AlexaClientSDK 1.25.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0