lomiri-location-service ..
An aggregating location service providing positioning and geocoding capabilities to applications.
accuracy.h
Go to the documentation of this file.
1/*
2 * Copyright © 2012-2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Thomas Voß <thomas.voss@canonical.com>
17 */
18#ifndef LOCATION_SERVICE_COM_LOMIRI_LOCATION_ACCURACY_H_
19#define LOCATION_SERVICE_COM_LOMIRI_LOCATION_ACCURACY_H_
20
21#include <ostream>
22
23namespace com
24{
25namespace lomiri
26{
27namespace location
28{
29enum class AccuracyLevel
30{
31 country,
32 region,
35 street,
37
38 best = detailed,
40};
41
42template<typename T>
44{
45 static AccuracyLevel classify(const T& instance);
46 static T best();
47 static T worst();
48};
49
50template<typename T>
52{
53 typedef typename T::Unit Unit;
54 typedef typename T::Quantity Quantity;
55
58
63
65};
66
67template<typename T>
68inline std::ostream& operator<<(std::ostream& out, const Accuracy<T>& update)
69{
70 out << "Accuracy(" << update.value << ")";
71 return out;
72}
73
74}
75}
76}
77
78#endif // LOCATION_SERVICE_COM_LOMIRI_LOCATION_ACCURACY_H_
std::ostream & operator<<(std::ostream &out, const Accuracy< T > &update)
Definition accuracy.h:68
Definition accuracy.h:24
static AccuracyLevel classify(const T &instance)
static Accuracy< T > best()
Definition accuracy.h:56
AccuracyLevel classify() const
Definition accuracy.h:59
static Accuracy< T > worst()
Definition accuracy.h:57