fusion_provider.h
Go to the documentation of this file.
/*
* Copyright © 2016 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: Scott Sweeny <scott.sweeny@canonical.com
*/
#ifndef LOCATION_SERVICE_COM_LOMIRI_LOCATION_FUSION_PROVIDER_H
#define LOCATION_SERVICE_COM_LOMIRI_LOCATION_FUSION_PROVIDER_H
#include <com/lomiri/location/provider.h>
#include <com/lomiri/location/provider_selection_policy.h>
#include <com/lomiri/location/update_selector.h>
#include <vector>
namespace com
{
namespace lomiri
{
namespace location
{
class FusionProvider : public Provider
{
public:
typedef std::shared_ptr<FusionProvider> Ptr;
FusionProvider(const std::set<Provider::Ptr>& providers, const UpdateSelector::Ptr& update_selector);
bool matches_criteria(const Criteria &criteria) override;
void on_wifi_and_cell_reporting_state_changed(location::WifiAndCellIdReportingState state) override;
void on_reference_location_updated(const Update<Position>& position) override;
void on_reference_velocity_updated(const Update<Velocity>& velocity) override;
void on_reference_heading_updated(const Update<Heading>& heading) override;
void start_position_updates() override;
void stop_position_updates() override;
void start_heading_updates() override;
void stop_heading_updates() override;
void start_velocity_updates() override;
void stop_velocity_updates() override;
private:
Optional<WithSource<Update<Position>>> last_position;
std::set<Provider::Ptr> providers;
std::vector<core::ScopedConnection> connections;
};
}
}
}
#endif // LOCATION_SERVICE_COM_LOMIRI_LOCATION_FUSION_PROVIDER_H
com::lomiri::location::FusionProvider::start_position_updates
void start_position_updates() override
Implementation-specific, empty by default.
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::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::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)
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::Ptr
std::shared_ptr< FusionProvider > Ptr
Definition fusion_provider.h:36
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::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::start_velocity_updates
void start_velocity_updates() override
Implementation-specific, empty by default.
com::lomiri::location::FusionProvider::stop_heading_updates
void stop_heading_updates() override
Implementation-specific, empty by default.
com::lomiri::location::FusionProvider::stop_position_updates
void stop_position_updates() override
Implementation-specific, empty by default.
com::lomiri::location::Provider::Features::position
@ position
The provider features position updates.
Definition provider.h:56
com::lomiri::location::Provider::Features::velocity
@ velocity
The provider features velocity updates.
Definition provider.h:57
com::lomiri::location::Provider::Features::heading
@ heading
The provider features heading updates.
Definition provider.h:58
com::lomiri::location::Provider::Provider
Provider(const Provider &)=delete
com::lomiri::location::UpdateSelector::Ptr
std::shared_ptr< UpdateSelector > Ptr
Definition update_selector.h:37
com::lomiri::location
Definition accuracy.h:28
com::lomiri::location::Optional
boost::optional< T > Optional
Definition optional.h:31
com::lomiri::location::WifiAndCellIdReportingState
WifiAndCellIdReportingState
Definition wifi_and_cell_reporting_state.h:30
com::lomiri
Definition accuracy.h:26
com
Definition accuracy.h:24
provider.h
provider_selection_policy.h
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::Update
Templated class that wraps a value and timestamp.
Definition update.h:37
update_selector.h