criteria.h
Go to the documentation of this file.
/*
* Copyright © 2012-2013 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Thomas Voß <thomas.voss@canonical.com>
*/
#ifndef LOCATION_SERVICE_COM_LOMIRI_LOCATION_CRITERIA_H_
#define LOCATION_SERVICE_COM_LOMIRI_LOCATION_CRITERIA_H_
#include <com/lomiri/location/optional.h>
#include <com/lomiri/location/units/units.h>
namespace com
{
namespace lomiri
{
namespace location
{
struct Criteria
{
bool satisfies(const Criteria& rhs) const;
struct Requires
{
bool position = true;
bool altitude = false;
bool velocity = false;
bool heading = false;
} requires = Requires{};
struct Accuracy
{
units::Quantity<units::Length> horizontal = 3000 * units::Meters;
Optional<units::Quantity<units::Length>> vertical;
Optional<units::Quantity<units::Velocity>> velocity;
Optional<units::Quantity<units::PlaneAngle>> heading;
} accuracy = Accuracy{};
};
Criteria operator+(const Criteria& lhs, const Criteria& rhs);
}
}
}
#endif // LOCATION_SERVICE_COM_LOMIRI_LOCATION_CRITERIA_H_
com::lomiri::location::units::Quantity
boost::units::quantity< Unit, double > Quantity
Definition units.h:60
com::lomiri::location::units::Meters
static const Length Meters
Definition units.h:51
com::lomiri::location
Definition accuracy.h:28
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::Optional
boost::optional< T > Optional
Definition optional.h:31
com::lomiri
Definition accuracy.h:26
com
Definition accuracy.h:24
optional.h
com::lomiri::location::Accuracy
Definition accuracy.h:52
com::lomiri::location::Criteria::Accuracy
Definition criteria.h:52
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::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::vertical
Optional< units::Quantity< units::Length > > vertical
The client requires measurements of at least this vertical accuracy.
Definition criteria.h:54
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
Definition criteria.h:44
com::lomiri::location::Criteria::Requires::heading
bool heading
The client needs heading measurements.
Definition criteria.h:48
com::lomiri::location::Criteria::Requires::altitude
bool altitude
The client needs altitude measurements.
Definition criteria.h:46
com::lomiri::location::Criteria::Requires::velocity
bool velocity
The client needs velocity measurments.
Definition criteria.h:47
com::lomiri::location::Criteria::Requires::position
bool position
The client needs position measurements.
Definition criteria.h:45
com::lomiri::location::Criteria
Summarizes criteria of a client session with respect to functionality and accuracy for position,...
Definition criteria.h:35
com::lomiri::location::Criteria::accuracy
struct com::lomiri::location::Criteria::Accuracy accuracy
com::lomiri::location::Criteria::satisfies
bool satisfies(const Criteria &rhs) const
satisfies checks whether this instance also satisfies another criteria instance.
units.h