Alexa Auto SDK  2.3.0
Location.h
1 /*
2  * Copyright 2017-2020 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 
16 #ifndef AACE_LOCATION_LOCATION_H
17 #define AACE_LOCATION_LOCATION_H
18 
19 #include <string>
20 #include <chrono>
21 
24 namespace aace {
25 namespace location {
26 
27 class Location;
28 
32 class Location {
33 public:
34  // used for undefined location values
35  static constexpr double UNDEFINED = std::numeric_limits<double>::min();
36 
41  Location();
42 
52  Location(
53  double latitude,
54  double longitude,
55  double altitude = UNDEFINED,
56  double accuracy = UNDEFINED,
57  std::chrono::system_clock::time_point time = std::chrono::system_clock::now());
58 
64  Location(const Location& location);
65 
71  bool isValid();
72 
78  double getLatitude();
79 
85  double getLongitude();
86 
92  double getAltitude();
93 
99  double getAccuracy();
100 
106  std::chrono::system_clock::time_point getTime();
107 
113  std::string getTimeAsString();
114 
115 private:
116  double m_latitude;
117  double m_longitude;
118  double m_altitude;
119  double m_accuracy;
120  std::chrono::system_clock::time_point m_time;
121 };
122 
123 } // namespace location
124 } // namespace aace
125 
126 #endif // AACE_LOCATION_LOCATION_H
Definition: Location.h:32
std::chrono::system_clock::time_point getTime()
Definition: Location.cpp:72
double getLongitude()
Definition: Location.cpp:60
Definition: AddressBook.h:26
std::string getTimeAsString()
Definition: Location.cpp:76
double getAccuracy()
Definition: Location.cpp:68
double getAltitude()
Definition: Location.cpp:64
Location()
Definition: Location.cpp:23
double getLatitude()
Definition: Location.cpp:56
bool isValid()
Definition: Location.cpp:52

Alexa Auto SDK 2.3.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0