ubuntu-location-service: /build/location-service-git/src/location-service/include/location_service/com/ubuntu/location/criteria.h Source File

ubuntu-location-service .. An aggregating location service providing positioning and geocoding capabilities to applications.

criteria.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_UBUNTU_LOCATION_CRITERIA_H_
19 #define LOCATION_SERVICE_COM_UBUNTU_LOCATION_CRITERIA_H_
20
21 #include <com/ubuntu/location/optional.h>
22 #include <com/ubuntu/location/units/units.h>
23
24 namespace com
25 {
26 namespace ubuntu
27 {
28 namespace location
29 {
34 struct Criteria
35 {
41 bool satisfies(const Criteria& rhs) const;
42
43 struct Requires
44 {
45 bool position = true;
46 bool altitude = false;
47 bool velocity = false;
48 bool heading = false;
49 } requires = Requires{};
50
51 struct Accuracy
52 {
53 units::Quantity<units::Length> horizontal = 3000 * units::Meters;
54 Optional<units::Quantity<units::Length>> vertical;
55 Optional<units::Quantity<units::Velocity>> velocity;
56 Optional<units::Quantity<units::PlaneAngle>> heading;
57 } accuracy = Accuracy{};
58 };
59
63 Criteria operator+(const Criteria& lhs, const Criteria& rhs);
64 }
65 }
66 }
67
68 #endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_CRITERIA_H_
com::ubuntu::location::units::Quantity
boost::units::quantity< Unit, double > Quantity
Definition: units.h:53
com::ubuntu::location::units::Meters
static const Length Meters
Definition: units.h:44
com::ubuntu::location::operator+
Criteria operator+(const Criteria &lhs, const Criteria &rhs)
operator + merges lhs and rhs such that satisfying the new criteria satisfies lhs and rhs.
com::ubuntu::location::Optional
boost::optional< T > Optional
Definition: optional.h:30
com
Definition: accuracy.h:24
optional.h
com::ubuntu::location::Accuracy
Definition: accuracy.h:52
com::ubuntu::location::Criteria::Accuracy
Definition: criteria.h:52
com::ubuntu::location::Criteria::Accuracy::horizontal
units::Quantity< units::Length > horizontal
The client requires measurements of at least this horizontal accuracy.
Definition: criteria.h:53
com::ubuntu::location::Criteria::Accuracy::heading
Optional< units::Quantity< units::PlaneAngle > > heading
The client requires measurements of at least this heading accuracy.
Definition: criteria.h:56
com::ubuntu::location::Criteria::Accuracy::velocity
Optional< units::Quantity< units::Velocity > > velocity
The client requires measurements of at least this velocity accuracy.
Definition: criteria.h:55
com::ubuntu::location::Criteria::Accuracy::vertical
Optional< units::Quantity< units::Length > > vertical
The client requires measurements of at least this vertical accuracy.
Definition: criteria.h:54
com::ubuntu::location::Criteria::Requires
Definition: criteria.h:44
com::ubuntu::location::Criteria::Requires::position
bool position
The client needs position measurements.
Definition: criteria.h:45
com::ubuntu::location::Criteria::Requires::heading
bool heading
The client needs heading measurements.
Definition: criteria.h:48
com::ubuntu::location::Criteria::Requires::velocity
bool velocity
The client needs velocity measurments.
Definition: criteria.h:47
com::ubuntu::location::Criteria::Requires::altitude
bool altitude
The client needs altitude measurements.
Definition: criteria.h:46
com::ubuntu::location::Criteria
Summarizes criteria of a client session with respect to functionality and accuracy for position,...
Definition: criteria.h:35
com::ubuntu::location::Criteria::accuracy
struct com::ubuntu::location::Criteria::Accuracy accuracy
com::ubuntu::location::Criteria::satisfies
bool satisfies(const Criteria &rhs) const
satisfies checks whether this instance also satisfies another criteria instance.
com::ubuntu::location::Criteria::requires
struct com::ubuntu::location::Criteria::Requires requires
units.h