ubuntu-location-service  ..
An aggregating location service providing positioning and geocoding capabilities to applications.
com::ubuntu::location::Engine Class Reference

The Engine class encapsulates a positioning engine, relying on a set of providers and reporters to acquire and publish location information. More...

#include <engine.h>

+ Inheritance diagram for com::ubuntu::location::Engine:
+ Collaboration diagram for com::ubuntu::location::Engine:

Classes

struct  Configuration
 The Configuration struct summarizes the state of the engine. More...
 
struct  Updates
 Summarizes all updates delivered via the engine. More...
 

Public Types

enum  Status {
  Status::off,
  Status::on,
  Status::active
}
 The State enum models the current state of the engine. More...
 
typedef std::shared_ptr< EnginePtr
 

Public Member Functions

 Engine (const std::shared_ptr< ProviderSelectionPolicy > &provider_selection_policy)
 
 Engine (const Engine &)=delete
 
Engineoperator= (const Engine &)=delete
 
virtual ~Engine ()
 
virtual ProviderSelection determine_provider_selection_for_criteria (const Criteria &criteria)
 Calculates a set of providers that satisfies the given criteria. More...
 
virtual bool has_provider (const Provider::Ptr &provider) noexcept
 Checks if the engine knows about a specific provider. More...
 
virtual void add_provider (const Provider::Ptr &provider)
 Makes a provider known to the engine. More...
 
virtual void remove_provider (const Provider::Ptr &provider) noexcept
 Removes a provider from the engine. More...
 
virtual void for_each_provider (const std::function< void(const Provider::Ptr &)> &enumerator) const noexcept
 Iterates all known providers and invokes the provided enumerator for each of them. More...
 
- Public Member Functions inherited from com::ubuntu::location::ProviderEnumerator
 ProviderEnumerator (const ProviderEnumerator &)=delete
 
virtual ~ProviderEnumerator ()=default
 
ProviderEnumeratoroperator= (const ProviderEnumerator &)=delete
 
bool operator== (const ProviderEnumerator &) const =delete
 
virtual void for_each_provider (const std::function< void(const std::shared_ptr< Provider > &)> &) const =0
 

Public Attributes

Configuration configuration
 The engine's configuration. More...
 
Updates updates
 All updates distributed via the engine. More...
 

Additional Inherited Members

- Protected Member Functions inherited from com::ubuntu::location::ProviderEnumerator
 ProviderEnumerator ()=default
 

Detailed Description

The Engine class encapsulates a positioning engine, relying on a set of providers and reporters to acquire and publish location information.

Definition at line 45 of file engine.h.

Member Typedef Documentation

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

Definition at line 48 of file engine.h.

Member Enumeration Documentation

The State enum models the current state of the engine.

Enumerator
off 

The engine is currently offline.

on 

The engine and providers are powered on but not navigating.

active 

The engine and providers are powered on and navigating.

Definition at line 53 of file engine.h.

Constructor & Destructor Documentation

com::ubuntu::location::Engine::Engine ( const std::shared_ptr< ProviderSelectionPolicy > &  provider_selection_policy)
com::ubuntu::location::Engine::Engine ( const Engine )
delete
virtual com::ubuntu::location::Engine::~Engine ( )
virtual

Member Function Documentation

virtual void com::ubuntu::location::Engine::add_provider ( const Provider::Ptr provider)
virtual

Makes a provider known to the engine.

Parameters
providerThe new provider.
virtual ProviderSelection com::ubuntu::location::Engine::determine_provider_selection_for_criteria ( const Criteria criteria)
virtual

Calculates a set of providers that satisfies the given criteria.

Parameters
[in]criteriaThe criteria to be satisfied by the returned provider selection.
Returns
A provider selection that satisfies the given criteria.
virtual void com::ubuntu::location::Engine::for_each_provider ( const std::function< void(const Provider::Ptr &)> &  enumerator) const
virtualnoexcept

Iterates all known providers and invokes the provided enumerator for each of them.

Parameters
enumeratorThe functor to be invoked for each provider.
virtual bool com::ubuntu::location::Engine::has_provider ( const Provider::Ptr provider)
virtualnoexcept

Checks if the engine knows about a specific provider.

Returns
True iff the engine knows about the provider.
Engine& com::ubuntu::location::Engine::operator= ( const Engine )
delete
virtual void com::ubuntu::location::Engine::remove_provider ( const Provider::Ptr provider)
virtualnoexcept

Removes a provider from the engine.

Parameters
providerThe provider to be removed.

Member Data Documentation

Configuration com::ubuntu::location::Engine::configuration

The engine's configuration.

Definition at line 132 of file engine.h.

Updates com::ubuntu::location::Engine::updates

All updates distributed via the engine.

Definition at line 135 of file engine.h.


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