18 #ifndef LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_H_
19 #define LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_H_
29 #include <core/property.h>
30 #include <core/signal.h>
48 typedef std::shared_ptr<Provider>
Ptr;
83 typedef std::shared_ptr<Controller>
Ptr;
155 std::atomic<int> position_updates_counter;
156 std::atomic<int> heading_updates_counter;
157 std::atomic<int> velocity_updates_counter;
172 core::Signal<Update<std::set<SpaceVehicle>>>
svs;
Facade for controlling the state of position/heading/velocity updates.
Controller(Provider &instance)
bool are_position_updates_running() const
Checks if position updates are currently running.
void enable()
enable switches the provider to an enabled state, such that subsequent calls to start* methods succee...
virtual void start_heading_updates()
Request to start heading updates if not already running.
bool are_velocity_updates_running() const
Checks if velocity updates are currently running.
virtual void stop_position_updates()
Request to stop position updates. Only stops the provider when the last observer calls this function.
Controller & operator=(const Controller &)=delete
virtual ~Controller()=default
virtual void stop_velocity_updates()
Request to stop velocity updates. Only stops the provider when the last observer calls this function.
bool are_heading_updates_running() const
Checks if position updates are currently running.
virtual void stop_heading_updates()
Request to stop heading updates. Only stops the provider when the last observer calls this function.
virtual void start_position_updates()
Request to start position updates if not already running.
void disable()
disable switches the provider to a disabled state, such that subsequent calls to start* methods fail.
virtual void start_velocity_updates()
Request to start velocity updates if not already running.
std::shared_ptr< Controller > Ptr
Controller(const Controller &)=delete
The Provider class is the abstract base of all positioning providers.
virtual const Updates & updates() const
Provides non-mutable access to this provider's updates.
virtual bool supports(const Features &f) const
Checks if the provider supports a specific feature.
Features
Enumerates the known features that can be supported by providers.
@ none
The provider does not support any feature.
@ position
The provider features position updates.
@ velocity
The provider features velocity updates.
@ heading
The provider features heading updates.
virtual void stop_heading_updates()
Implementation-specific, empty by default.
Provider(const Provider &)=delete
Provider & operator=(const Provider &)=delete
virtual bool requires(const Requirements &r) const
Checks if the provider has got a specific requirement.
virtual void stop_velocity_updates()
Implementation-specific, empty by default.
std::shared_ptr< Provider > Ptr
virtual bool matches_criteria(const Criteria &criteria)
Checks if a provider satisfies a set of accuracy criteria.
virtual void start_position_updates()
Implementation-specific, empty by default.
virtual void start_heading_updates()
Implementation-specific, empty by default.
virtual Updates & mutable_updates()
virtual void on_reference_velocity_updated(const Update< Velocity > &velocity)
Called by the engine whenever the reference velocity changed.
Controller::Ptr controller
Requirements requirements
virtual ~Provider()=default
virtual void on_reference_location_updated(const Update< Position > &position)
Called by the engine whenever the reference location changed.
virtual void on_reference_heading_updated(const Update< Heading > &heading)
Called by the engine whenever the reference heading changed.
Provider(const Features &features=Features::none, const Requirements &requirements=Requirements::none)
virtual void start_velocity_updates()
Implementation-specific, empty by default.
virtual void stop_position_updates()
Implementation-specific, empty by default.
virtual void on_wifi_and_cell_reporting_state_changed(WifiAndCellIdReportingState state)
Called by the engine whenever the wifi and cell ID reporting state changes.
virtual const Controller::Ptr & state_controller() const
Access to the controller facade of this provider instance.
Requirements
Enumerates the requirements of a provider implementation.
@ monetary_spending
Using the provider results in monetary cost.
@ satellites
The provider requires satellites to be visible.
@ none
The provider does not require anything.
@ cell_network
The provider requires a cell-network to work correctly.
@ data_network
The provider requires a data-network to work correctly.
Provider::Features operator|(Provider::Features lhs, Provider::Features rhs)
WifiAndCellIdReportingState
Provider::Features operator&(Provider::Features lhs, Provider::Features rhs)
Summarizes criteria of a client session with respect to functionality and accuracy for position,...
Wraps all updates that can be delivered by a provider.
core::Signal< Update< std::set< SpaceVehicle > > > svs
core::Signal< Update< Position > > position
core::Signal< Update< Velocity > > velocity
core::Signal< Update< Heading > > heading
Templated class that wraps a value and timestamp.