18
18
#ifndef LOCATION_SERVICE_COM_UBUNTU_LOCATION_CRITERIA_H_
19
19
#define LOCATION_SERVICE_COM_UBUNTU_LOCATION_CRITERIA_H_
21
#include "com/ubuntu/location/accuracy.h"
22
#include "com/ubuntu/location/heading.h"
23
#include "com/ubuntu/location/velocity.h"
24
#include "com/ubuntu/location/wgs84/altitude.h"
25
#include "com/ubuntu/location/wgs84/latitude.h"
26
#include "com/ubuntu/location/wgs84/longitude.h"
21
#include <com/ubuntu/location/optional.h>
22
#include <com/ubuntu/location/units/units.h>
31
* @brief Summarizes criteria of a client session with respect to functionality
32
* and accuracy for position, velocity and heading measurements.
40
Criteria() : latitude_accuracy(),
48
Accuracy<wgs84::Latitude> latitude_accuracy;
49
Accuracy<wgs84::Longitude> longitude_accuracy;
50
Accuracy<wgs84::Altitude> altitude_accuracy;
51
Accuracy<Velocity> velocity_accuracy;
52
Accuracy<Heading> heading_accuracy;
37
* @brief satisfies checks whether this instance also satisfies another criteria instance.
38
* @param rhs The other criteria instance
39
* @return true iff this instance also satisfies the other instance, else false.
41
bool satisfies(const Criteria& rhs) const;
45
bool position = true; ///< The client needs position measurements.
46
bool altitude = false; ///< The client needs altitude measurements.
47
bool velocity = false; ///< The client needs velocity measurments.
48
bool heading = false; ///< The client needs heading measurements.
49
} requires = Requires{};
53
units::Quantity<units::Length> horizontal = 3000 * units::Meters; ///< The client requires measurements of at least this horizontal accuracy.
54
Optional<units::Quantity<units::Length>> vertical; ///< The client requires measurements of at least this vertical accuracy.
55
Optional<units::Quantity<units::Velocity>> velocity; ///< The client requires measurements of at least this velocity accuracy.
56
Optional<units::Quantity<units::PlaneAngle>> heading; ///< The client requires measurements of at least this heading accuracy.
57
} accuracy = Accuracy{};
61
* @brief operator + merges lhs and rhs such that satisfying the new criteria satisfies lhs and rhs.
63
Criteria operator+(const Criteria& lhs, const Criteria& rhs);