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 
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  {
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_
static const Length Meters
Definition: units.h:44
Criteria operator+(const Criteria &lhs, const Criteria &rhs)
operator + merges lhs and rhs such that satisfying the new criteria satisfies lhs and rhs...
Definition: accuracy.h:23
bool heading
The client needs heading measurements.
Definition: criteria.h:48
bool position
The client needs position measurements.
Definition: criteria.h:45
boost::optional< T > Optional
Definition: optional.h:30
Optional< units::Quantity< units::Velocity > > velocity
The client requires measurements of at least this velocity accuracy.
Definition: criteria.h:55
boost::units::quantity< Unit, double > Quantity
Definition: units.h:53
Optional< units::Quantity< units::Length > > vertical
The client requires measurements of at least this vertical accuracy.
Definition: criteria.h:54
bool velocity
The client needs velocity measurments.
Definition: criteria.h:47
bool satisfies(const Criteria &rhs) const
satisfies checks whether this instance also satisfies another criteria instance.
bool altitude
The client needs altitude measurements.
Definition: criteria.h:46
Summarizes criteria of a client session with respect to functionality and accuracy for position...
Definition: criteria.h:34
struct com::ubuntu::location::Criteria::Requires requires
struct com::ubuntu::location::Criteria::Accuracy accuracy
Optional< units::Quantity< units::PlaneAngle > > heading
The client requires measurements of at least this heading accuracy.
Definition: criteria.h:56