1
#ifndef LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_FACTORY_H_
2
#define LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_FACTORY_H_
4
#include "com/ubuntu/location/provider.h"
23
typedef std::map<std::string, std::string> Configuration; // TODO(tvoss): Make this a little more sophisticated.
24
typedef std::function<Provider::Ptr(const Configuration&)> Factory;
26
static ProviderFactory& instance();
28
void add_factory_for_name(const std::string& name, const Factory& factory);
30
Provider::Ptr create_provider_for_name_with_config(const std::string& name, const Configuration& config);
32
void enumerate(const std::function<void(const std::string&, const Factory&)>& enumerator);
35
ProviderFactory() = default;
36
~ProviderFactory() = default;
38
ProviderFactory(const ProviderFactory&) = delete;
39
ProviderFactory& operator=(const ProviderFactory&) = delete;
42
std::map<std::string, Factory> factory_store;
48
#endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDER_FACTORY_H_