ubuntu-location-service: com::ubuntu::location::Provider Class Reference

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

Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
com::ubuntu::location::Provider Class Reference

The Provider class is the abstract base of all positioning providers. More...

`#include <provider.h>`

Inheritance diagram for com::ubuntu::location::Provider:
Collaboration diagram for com::ubuntu::location::Provider:

## Classes
class | Controller
| Facade for controlling the state of position/heading/velocity updates. More...
struct | Updates
| Wraps all updates that can be delivered by a provider. More...

## Public Types
enum class | Features : std::size_t { none = 0 , position = 1 << 0 , velocity = 1 << 1 , heading = 1 << 2 }
| Enumerates the known features that can be supported by providers. More...
enum class | Requirements : std::size_t { none = 0 , satellites = 1 << 0 , cell_network = 1 << 1 , data_network = 1 << 2 , monetary_spending = 1 << 3 }
| Enumerates the requirements of a provider implementation. More...
typedef std::shared_ptr< Provider > | Ptr

## Public Member Functions
virtual | ~Provider ()=default
| Provider (const Provider &)=delete
Provider & | operator= (const Provider &)=delete
virtual const Updates & | updates () const
| Provides non-mutable access to this provider's updates. More...
virtual const Controller::Ptr & | state_controller () const
| Access to the controller facade of this provider instance. More...
virtual bool | supports (const Features &f) const
| Checks if the provider supports a specific feature. More...
virtual bool | requires (const Requirements &r) const
| Checks if the provider has got a specific requirement. More...
virtual bool | matches_criteria (const Criteria &criteria)
| Checks if a provider satisfies a set of accuracy criteria. More...
virtual void | on_wifi_and_cell_reporting_state_changed (WifiAndCellIdReportingState state)
| Called by the engine whenever the wifi and cell ID reporting state changes. More...
virtual void | on_reference_location_updated (const Update< Position > &position)
| Called by the engine whenever the reference location changed. More...
virtual void | on_reference_velocity_updated (const Update< Velocity > &velocity)
| Called by the engine whenever the reference velocity changed. More...
virtual void | on_reference_heading_updated (const Update< Heading > &heading)
| Called by the engine whenever the reference heading changed. More...

## Protected Member Functions
| Provider (const Features &features=Features::none, const Requirements &requirements=Requirements::none)
virtual Updates & | mutable_updates ()
virtual void | start_position_updates ()
| Implementation-specific, empty by default. More...
virtual void | stop_position_updates ()
| Implementation-specific, empty by default. More...
virtual void | start_heading_updates ()
| Implementation-specific, empty by default. More...
virtual void | stop_heading_updates ()
| Implementation-specific, empty by default. More...
virtual void | start_velocity_updates ()
| Implementation-specific, empty by default. More...
virtual void | stop_velocity_updates ()
| Implementation-specific, empty by default. More...

## Detailed Description

The Provider class is the abstract base of all positioning providers.

Definition at line 45 of file provider.h.

## Member Typedef Documentation

## ◆ Ptr

typedef std::shared_ptr<Provider> com::ubuntu::location::Provider::Ptr

Definition at line 48 of file provider.h.

## Member Enumeration Documentation

## ◆ Features

enum com::ubuntu::location::Provider::Features : std::size_t
| strong

Enumerates the known features that can be supported by providers.

Enumerator
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.

Definition at line 53 of file provider.h.

## ◆ Requirements

enum com::ubuntu::location::Provider::Requirements : std::size_t
| strong

Enumerates the requirements of a provider implementation.

Enumerator
none | The provider does not require anything.
satellites | The provider requires satellites to be visible.
cell_network | The provider requires a cell-network to work correctly.
data_network | The provider requires a data-network to work correctly.
monetary_spending | Using the provider results in monetary cost.

Definition at line 64 of file provider.h.

## Constructor & Destructor Documentation

## ◆ ~Provider()

virtual com::ubuntu::location::Provider::~Provider | ( |  | ) |
| virtualdefault

## ◆ Provider() [1/2]

com::ubuntu::location::Provider::Provider | ( | const Provider & |  | ) |
| delete

## ◆ Provider() [2/2]

com::ubuntu::location::Provider::Provider | ( | const Features & | features = `Features::none`,
|  | const Requirements & | requirements = `Requirements::none`
| ) |  |
| explicitprotected

## Member Function Documentation

## ◆ matches_criteria()

virtual bool com::ubuntu::location::Provider::matches_criteria | ( | const Criteria & | criteria | ) |
| virtual

Checks if a provider satisfies a set of accuracy criteria.

Parameters

  [in] | criteria | The criteria to check.

Returns
  true iff the provider satisfies the given criteria.

Reimplemented in com::ubuntu::location::FusionProvider.

## ◆ mutable_updates()

virtual Updates& com::ubuntu::location::Provider::mutable_updates | ( |  | ) |
| protectedvirtual

## ◆ on_reference_heading_updated()

virtual void com::ubuntu::location::Provider::on_reference_heading_updated | ( | const Update< Heading > & | heading | ) |
| virtual

Called by the engine whenever the reference heading changed.

Parameters

  heading | The new reference heading.

Reimplemented in com::ubuntu::location::FusionProvider.

## ◆ on_reference_location_updated()

virtual void com::ubuntu::location::Provider::on_reference_location_updated | ( | const Update< Position > & | position | ) |
| virtual

Called by the engine whenever the reference location changed.

Parameters

  position | The new reference location.

Reimplemented in com::ubuntu::location::FusionProvider.

## ◆ on_reference_velocity_updated()

virtual void com::ubuntu::location::Provider::on_reference_velocity_updated | ( | const Update< Velocity > & | velocity | ) |
| virtual

Called by the engine whenever the reference velocity changed.

Parameters

  velocity | The new reference velocity.

Reimplemented in com::ubuntu::location::FusionProvider.

## ◆ on_wifi_and_cell_reporting_state_changed()

virtual void com::ubuntu::location::Provider::on_wifi_and_cell_reporting_state_changed | ( | WifiAndCellIdReportingState | state | ) |
| virtual

Called by the engine whenever the wifi and cell ID reporting state changes.

Parameters

  state | The new state.

Reimplemented in com::ubuntu::location::FusionProvider.

## ◆ operator=()

Provider& com::ubuntu::location::Provider::operator= | ( | const Provider & |  | ) |
| delete

## ◆ requires()

virtual bool com::ubuntu::location::Provider::requires | ( | const Requirements & | r | ) | const
| virtual

Checks if the provider has got a specific requirement.

Parameters

  r | Requirement to test for.

Returns
  true iff the provider has the specific requirement.

## ◆ start_heading_updates()

virtual void com::ubuntu::location::Provider::start_heading_updates | ( |  | ) |
| protectedvirtual

Implementation-specific, empty by default.

Reimplemented in com::ubuntu::location::FusionProvider, and com::ubuntu::location::ProxyProvider.

## ◆ start_position_updates()

virtual void com::ubuntu::location::Provider::start_position_updates | ( |  | ) |
| protectedvirtual

Implementation-specific, empty by default.

Reimplemented in com::ubuntu::location::FusionProvider, and com::ubuntu::location::ProxyProvider.

## ◆ start_velocity_updates()

virtual void com::ubuntu::location::Provider::start_velocity_updates | ( |  | ) |
| protectedvirtual

Implementation-specific, empty by default.

Reimplemented in com::ubuntu::location::FusionProvider, and com::ubuntu::location::ProxyProvider.

## ◆ state_controller()

virtual const Controller::Ptr& com::ubuntu::location::Provider::state_controller | ( |  | ) | const
| virtual

Access to the controller facade of this provider instance.

## ◆ stop_heading_updates()

virtual void com::ubuntu::location::Provider::stop_heading_updates | ( |  | ) |
| protectedvirtual

Implementation-specific, empty by default.

Reimplemented in com::ubuntu::location::FusionProvider, and com::ubuntu::location::ProxyProvider.

## ◆ stop_position_updates()

virtual void com::ubuntu::location::Provider::stop_position_updates | ( |  | ) |
| protectedvirtual

Implementation-specific, empty by default.

Reimplemented in com::ubuntu::location::FusionProvider, and com::ubuntu::location::ProxyProvider.

## ◆ stop_velocity_updates()

virtual void com::ubuntu::location::Provider::stop_velocity_updates | ( |  | ) |
| protectedvirtual

Implementation-specific, empty by default.

Reimplemented in com::ubuntu::location::FusionProvider, and com::ubuntu::location::ProxyProvider.

## ◆ supports()

virtual bool com::ubuntu::location::Provider::supports | ( | const Features & | f | ) | const
| virtual

Checks if the provider supports a specific feature.

Parameters

  f | Feature to test for

Returns
  true iff the provider supports the feature.

## ◆ updates()

virtual const Updates& com::ubuntu::location::Provider::updates | ( |  | ) | const
| virtual

Provides non-mutable access to this provider's updates.

Returns
  A non-mutable reference to the updates.

## Member Data Documentation

## ◆ controller

Controller::Ptr com::ubuntu::location::Provider::controller = Controller::Ptr{}

Definition at line 279 of file provider.h.

## ◆ features

Features com::ubuntu::location::Provider::features = Features::none

Definition at line 276 of file provider.h.

## ◆ requirements

Requirements com::ubuntu::location::Provider::requirements = Requirements::none

Definition at line 277 of file provider.h.

## ◆ updates

Updates com::ubuntu::location::Provider::updates

Definition at line 278 of file provider.h.

The documentation for this class was generated from the following file:

- /build/location-service-git/src/location-service/include/location_service/com/ubuntu/location/provider.h