AWS SDK for C++

AWS SDK for C++ Version 1.11.911

Loading...
Searching...
No Matches
DataPoint.h
1
6#pragma once
7#include <aws/core/utils/DateTime.h>
8#include <aws/crt/cbor/Cbor.h>
9#include <aws/pi/PI_EXPORTS.h>
10
11#include <utility>
12
13namespace Aws {
14namespace Utils {
15namespace Cbor {
16class CborValue;
17} // namespace Cbor
18} // namespace Utils
19namespace PI {
20namespace Model {
21
28class DataPoint {
29 public:
30 AWS_PI_API DataPoint() = default;
31 AWS_PI_API DataPoint(const std::shared_ptr<Aws::Crt::Cbor::CborDecoder>& decoder);
32 AWS_PI_API DataPoint& operator=(const std::shared_ptr<Aws::Crt::Cbor::CborDecoder>& decoder);
33 AWS_PI_API void CborEncode(Aws::Crt::Cbor::CborEncoder& encoder) const;
34
36
40 inline const Aws::Utils::DateTime& GetTimestamp() const { return m_timestamp; }
41 inline bool TimestampHasBeenSet() const { return m_timestampHasBeenSet; }
42 template <typename TimestampT = Aws::Utils::DateTime>
43 void SetTimestamp(TimestampT&& value) {
44 m_timestampHasBeenSet = true;
45 m_timestamp = std::forward<TimestampT>(value);
46 }
47 template <typename TimestampT = Aws::Utils::DateTime>
48 DataPoint& WithTimestamp(TimestampT&& value) {
49 SetTimestamp(std::forward<TimestampT>(value));
50 return *this;
51 }
53
55
58 inline double GetValue() const { return m_value; }
59 inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; }
60 inline void SetValue(double value) {
61 m_valueHasBeenSet = true;
62 m_value = value;
63 }
64 inline DataPoint& WithValue(double value) {
65 SetValue(value);
66 return *this;
67 }
69 private:
70 Aws::Utils::DateTime m_timestamp{};
71
72 double m_value{0.0};
73 bool m_timestampHasBeenSet = false;
74 bool m_valueHasBeenSet = false;
75};
76
77} // namespace Model
78} // namespace PI
79} // namespace Aws
AWS_PI_API DataPoint()=default
AWS_PI_API DataPoint(const std::shared_ptr< Aws::Crt::Cbor::CborDecoder > &decoder)
void SetTimestamp(TimestampT &&value)
Definition DataPoint.h:43
void SetValue(double value)
Definition DataPoint.h:60
bool ValueHasBeenSet() const
Definition DataPoint.h:59
AWS_PI_API void CborEncode(Aws::Crt::Cbor::CborEncoder &encoder) const
const Aws::Utils::DateTime & GetTimestamp() const
Definition DataPoint.h:40
bool TimestampHasBeenSet() const
Definition DataPoint.h:41
DataPoint & WithValue(double value)
Definition DataPoint.h:64
double GetValue() const
Definition DataPoint.h:58
AWS_PI_API DataPoint & operator=(const std::shared_ptr< Aws::Crt::Cbor::CborDecoder > &decoder)
DataPoint & WithTimestamp(TimestampT &&value)
Definition DataPoint.h:48