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

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

fusion_provider.h
Go to the documentation of this file.
1 /*
2 * Copyright © 2016 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: Scott Sweeny <scott.sweeny@canonical.com
17 */
18 #ifndef LOCATION_SERVICE_COM_UBUNTU_LOCATION_FUSION_PROVIDER_H
19 #define LOCATION_SERVICE_COM_UBUNTU_LOCATION_FUSION_PROVIDER_H
20
21 #include <com/ubuntu/location/provider.h>
22 #include <com/ubuntu/location/provider_selection_policy.h>
23 #include <com/ubuntu/location/update_selector.h>
24
25 #include <vector>
26
27 namespace com
28 {
29 namespace ubuntu
30 {
31 namespace location
32 {
33 class FusionProvider : public Provider
34 {
35 public:
36 typedef std::shared_ptr<FusionProvider> Ptr;
37
38 FusionProvider(const std::set<Provider::Ptr>& providers, const UpdateSelector::Ptr& update_selector);
39
40 bool matches_criteria(const Criteria &criteria) override;
41 void on_wifi_and_cell_reporting_state_changed(location::WifiAndCellIdReportingState state) override;
42 void on_reference_location_updated(const Update<Position>& position) override;
43 void on_reference_velocity_updated(const Update<Velocity>& velocity) override;
44 void on_reference_heading_updated(const Update<Heading>& heading) override;
45 void start_position_updates() override;
46 void stop_position_updates() override;
47 void start_heading_updates() override;
48 void stop_heading_updates() override;
49 void start_velocity_updates() override;
50 void stop_velocity_updates() override;
51
52 private:
53 Optional<WithSource<Update<Position>>> last_position;
54 std::set<Provider::Ptr> providers;
55 std::vector<core::ScopedConnection> connections;
56 };
57 }
58 }
59 }
60
61 #endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_FUSION_PROVIDER_H
com::ubuntu::location::FusionProvider
Definition: fusion_provider.h:34
com::ubuntu::location::FusionProvider::start_position_updates
void start_position_updates() override
Implementation-specific, empty by default.
com::ubuntu::location::FusionProvider::start_heading_updates
void start_heading_updates() override
Implementation-specific, empty by default.
com::ubuntu::location::FusionProvider::FusionProvider
FusionProvider(const std::set< Provider::Ptr > &providers, const UpdateSelector::Ptr &update_selector)
com::ubuntu::location::FusionProvider::on_reference_location_updated
void on_reference_location_updated(const Update< Position > &position) override
Called by the engine whenever the reference location changed.
com::ubuntu::location::FusionProvider::stop_velocity_updates
void stop_velocity_updates() override
Implementation-specific, empty by default.
com::ubuntu::location::FusionProvider::matches_criteria
bool matches_criteria(const Criteria &criteria) override
Checks if a provider satisfies a set of accuracy criteria.
com::ubuntu::location::FusionProvider::Ptr
std::shared_ptr< FusionProvider > Ptr
Definition: fusion_provider.h:36
com::ubuntu::location::FusionProvider::on_reference_heading_updated
void on_reference_heading_updated(const Update< Heading > &heading) override
Called by the engine whenever the reference heading changed.
com::ubuntu::location::FusionProvider::on_wifi_and_cell_reporting_state_changed
void on_wifi_and_cell_reporting_state_changed(location::WifiAndCellIdReportingState state) override
Called by the engine whenever the wifi and cell ID reporting state changes.
com::ubuntu::location::FusionProvider::on_reference_velocity_updated
void on_reference_velocity_updated(const Update< Velocity > &velocity) override
Called by the engine whenever the reference velocity changed.
com::ubuntu::location::FusionProvider::start_velocity_updates
void start_velocity_updates() override
Implementation-specific, empty by default.
com::ubuntu::location::FusionProvider::stop_position_updates
void stop_position_updates() override
Implementation-specific, empty by default.
com::ubuntu::location::FusionProvider::stop_heading_updates
void stop_heading_updates() override
Implementation-specific, empty by default.
com::ubuntu::location::Provider
The Provider class is the abstract base of all positioning providers.
Definition: provider.h:46
com::ubuntu::location::UpdateSelector::Ptr
std::shared_ptr< UpdateSelector > Ptr
Definition: update_selector.h:37
com::ubuntu::location::Optional
boost::optional< T > Optional
Definition: optional.h:30
com::ubuntu::location::WifiAndCellIdReportingState
WifiAndCellIdReportingState
Definition: wifi_and_cell_reporting_state.h:30
com
Definition: accuracy.h:24
provider.h
provider_selection_policy.h
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::Update
Templated class that wraps a value and timestamp.
Definition: update.h:37
update_selector.h