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;
143 std::atomic<int> position_updates_counter;
144 std::atomic<int> heading_updates_counter;
145 std::atomic<int> velocity_updates_counter;
160 core::Signal<Update<std::set<SpaceVehicle>>>
svs;
280 #endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_H_
The provider does not support any feature.
virtual void start_heading_updates()
Implementation-specific, empty by default.
std::shared_ptr< Controller > Ptr
virtual void start_velocity_updates()
Request to start velocity updates if not already running.
Requirements
Enumerates the requirements of a provider implementation.
The provider requires satellites to be visible.
Provider(const Provider &)=delete
Controller & operator=(const Controller &)=delete
virtual Updates & mutable_updates()
Templated class that wraps a value and timestamp.
virtual ~Controller()=default
Wraps all updates that can be delivered by a provider.
virtual void stop_velocity_updates()
Request to stop velocity updates. Only stops the provider when the last observer calls this function...
bool are_position_updates_running() const
Checks if position updates are currently running.
virtual ~Provider()=default
core::Signal< Update< Velocity > > velocity
bool are_heading_updates_running() const
Checks if position updates are currently running.
Features
Enumerates the known features that can be supported by providers.
Provider::Features operator|(Provider::Features lhs, Provider::Features rhs)
virtual void on_reference_heading_updated(const Update< Heading > &heading)
Called by the engine whenever the reference heading changed.
virtual void on_reference_location_updated(const Update< Position > &position)
Called by the engine whenever the reference location changed.
WifiAndCellIdReportingState
virtual void start_velocity_updates()
Implementation-specific, empty by default.
The Provider class is the abstract base of all positioning providers.
Requirements requirements
The provider features heading updates.
virtual bool matches_criteria(const Criteria &criteria)
Checks if a provider satisfies a set of accuracy criteria.
std::shared_ptr< Provider > Ptr
virtual void stop_position_updates()
Implementation-specific, empty by default.
The provider features velocity updates.
virtual bool requires(const Requirements &r) const
Checks if the provider has got a specific requirement.
The provider does not require anything.
core::Signal< Update< Heading > > heading
virtual void start_position_updates()
Implementation-specific, empty by default.
bool are_velocity_updates_running() const
Checks if velocity updates are currently running.
Using the provider results in monetary cost.
core::Signal< Update< Position > > position
Controller(const Controller &)=delete
virtual void stop_position_updates()
Request to stop position updates. Only stops the provider when the last observer calls this function...
virtual void stop_heading_updates()
Request to stop heading updates. Only stops the provider when the last observer calls this function...
Provider::Features operator&(Provider::Features lhs, Provider::Features rhs)
Provider & operator=(const Provider &)=delete
virtual void start_position_updates()
Request to start position updates if not already running.
virtual void stop_heading_updates()
Implementation-specific, empty by default.
The provider requires a cell-network to work correctly.
Facade for controlling the state of position/heading/velocity updates.
Summarizes criteria of a client session with respect to functionality and accuracy for position...
The provider requires a data-network to work correctly.
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 void stop_velocity_updates()
Implementation-specific, empty by default.
Controller::Ptr controller
virtual bool supports(const Features &f) const
Checks if the provider supports a specific feature.
virtual const Controller::Ptr & state_controller() const
Access to the controller facade of this provider instance.
virtual void start_heading_updates()
Request to start heading updates if not already running.
virtual const Updates & updates() const
Provides non-mutable access to this provider's updates.
virtual void on_reference_velocity_updated(const Update< Velocity > &velocity)
Called by the engine whenever the reference velocity changed.
core::Signal< Update< std::set< SpaceVehicle > > > svs
The provider features position updates.