lomiri-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_LOMIRI_LOCATION_FUSION_PROVIDER_H
19 #define LOCATION_SERVICE_COM_LOMIRI_LOCATION_FUSION_PROVIDER_H
20 
24 
25 #include <vector>
26 
27 namespace com
28 {
29 namespace lomiri
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;
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:
54  std::set<Provider::Ptr> providers;
55  std::vector<core::ScopedConnection> connections;
56 };
57 }
58 }
59 }
60 
61 #endif // LOCATION_SERVICE_COM_LOMIRI_LOCATION_FUSION_PROVIDER_H
provider_selection_policy.h
com::lomiri::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::lomiri::location::WifiAndCellIdReportingState
WifiAndCellIdReportingState
Definition: wifi_and_cell_reporting_state.h:29
com::lomiri::location::UpdateSelector::Ptr
std::shared_ptr< UpdateSelector > Ptr
Definition: update_selector.h:37
com::lomiri::location::Optional
boost::optional< T > Optional
Definition: optional.h:31
com::lomiri::location::FusionProvider::matches_criteria
bool matches_criteria(const Criteria &criteria) override
Checks if a provider satisfies a set of accuracy criteria.
com::lomiri::location::FusionProvider::FusionProvider
FusionProvider(const std::set< Provider::Ptr > &providers, const UpdateSelector::Ptr &update_selector)
update_selector.h
com::lomiri::location::FusionProvider
Definition: fusion_provider.h:33
com::lomiri::location::FusionProvider::start_velocity_updates
void start_velocity_updates() override
Implementation-specific, empty by default.
com::lomiri::location::FusionProvider::start_heading_updates
void start_heading_updates() override
Implementation-specific, empty by default.
com::lomiri::location::FusionProvider::stop_velocity_updates
void stop_velocity_updates() override
Implementation-specific, empty by default.
com::lomiri::location::FusionProvider::start_position_updates
void start_position_updates() override
Implementation-specific, empty by default.
com::lomiri::location::FusionProvider::stop_position_updates
void stop_position_updates() override
Implementation-specific, empty by default.
provider.h
com::lomiri::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::lomiri::location::FusionProvider::Ptr
std::shared_ptr< FusionProvider > Ptr
Definition: fusion_provider.h:36
com::lomiri::location::FusionProvider::stop_heading_updates
void stop_heading_updates() override
Implementation-specific, empty by default.
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::Provider
The Provider class is the abstract base of all positioning providers.
Definition: provider.h:45
com::lomiri::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::lomiri::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::lomiri::location::Update
Templated class that wraps a value and timestamp.
Definition: update.h:36