lomiri-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_LOMIRI_LOCATION_CRITERIA_H_
19 #define LOCATION_SERVICE_COM_LOMIRI_LOCATION_CRITERIA_H_
20 
23 
24 namespace com
25 {
26 namespace lomiri
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_LOMIRI_LOCATION_CRITERIA_H_
com::lomiri::location::units::Meters
static const Length Meters
Definition: units.h:51
com::lomiri::location::Criteria::Requires::altitude
bool altitude
The client needs altitude measurements.
Definition: criteria.h:46
optional.h
com::lomiri::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::lomiri::location::Optional
boost::optional< T > Optional
Definition: optional.h:31
com::lomiri::location::Criteria::satisfies
bool satisfies(const Criteria &rhs) const
satisfies checks whether this instance also satisfies another criteria instance.
com::lomiri::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::lomiri::location::Criteria::Accuracy::horizontal
units::Quantity< units::Length > horizontal
The client requires measurements of at least this horizontal accuracy.
Definition: criteria.h:53
com::lomiri::location::Criteria::accuracy
struct com::lomiri::location::Criteria::Accuracy accuracy
com::lomiri::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::lomiri::location::Criteria::Requires::velocity
bool velocity
The client needs velocity measurments.
Definition: criteria.h:47
com::lomiri::location::Criteria::Accuracy
Definition: criteria.h:51
com::lomiri::location::units::Quantity
boost::units::quantity< Unit, double > Quantity
Definition: units.h:60
com::lomiri::location::Criteria::Requires
Definition: criteria.h:43
com::lomiri::location::Criteria::Requires::position
bool position
The client needs position measurements.
Definition: criteria.h:45
units.h
com::lomiri::location::Criteria
Summarizes criteria of a client session with respect to functionality and accuracy for position,...
Definition: criteria.h:34
com
Definition: accuracy.h:23
com::lomiri::location::Criteria::Requires::heading
bool heading
The client needs heading measurements.
Definition: criteria.h:48
com::lomiri::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::lomiri::location::Criteria::requires
struct com::lomiri::location::Criteria::Requires requires