~sil2100/location-service/gps-arm64

« back to all changes in this revision

Viewing changes to src/location_service/com/ubuntu/location/providers/config.cpp

  • Committer: Thomas Voß
  • Date: 2013-05-28 14:20:45 UTC
  • Revision ID: thomas.voss@canonical.com-20130528142045-kq5umqdmm4o53vwk
Initial push.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "com/ubuntu/location/provider.h"
 
2
#include "com/ubuntu/location/provider_factory.h"
 
3
 
 
4
#include <map>
 
5
 
 
6
namespace cul = com::ubuntu::location;
 
7
 
 
8
namespace
 
9
{
 
10
struct FactoryInjector
 
11
{
 
12
    FactoryInjector(const std::string& name, const std::function<cul::Provider::Ptr(const cul::ProviderFactory::Configuration&)>& f)
 
13
    {
 
14
        com::ubuntu::location::ProviderFactory::instance().add_factory_for_name(name, f);
 
15
    }
 
16
};
 
17
}
 
18
#if defined(COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_GEOCLUE)
 
19
#include "com/ubuntu/location/providers/geoclue/provider.h"
 
20
static FactoryInjector geoclue_injector
 
21
{
 
22
    "geoclue::Provider", 
 
23
    com::ubuntu::location::providers::geoclue::Provider::create_instance
 
24
};
 
25
#endif // COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_GEOCLUE
 
26
 
 
27
#if defined(COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_GPS)
 
28
#include "com/ubuntu/location/providers/gps/provider.h"
 
29
static FactoryInjector gps_injector
 
30
{
 
31
    "gps::Provider", 
 
32
    com::ubuntu::location::providers::gps::Provider::create_instance
 
33
};
 
34
#endif // COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_GPS
 
35
 
 
36
#if defined(COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_SKYHOOK)
 
37
#include "com/ubuntu/location/providers/skyhook/provider.h"
 
38
static FactoryInjector skyhook_injector
 
39
{
 
40
    "skyhook::Provider", 
 
41
    com::ubuntu::location::providers::skyhook::Provider::create_instance
 
42
};
 
43
#endif // COM_UBUNTU_LOCATION_SERVICE_PROVIDERS_SKYHOOK
 
44