blob: d9a4e5b287217dcbed5d89834bc46146709f1cca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#pragma once
#include "generator/factory_utils.hpp"
#include "generator/translator_coastline.hpp"
#include "generator/translator_country.hpp"
#include "generator/translator_streets.hpp"
#include "generator/translator_geo_objects.hpp"
#include "generator/translator_interface.hpp"
#include "generator/translator_region.hpp"
#include "generator/translator_world.hpp"
#include "base/assert.hpp"
#include <memory>
#include <utility>
namespace generator
{
enum class TranslatorType
{
Regions,
Streets,
GeoObjects,
Country,
CountryWithAds,
Coastline,
World,
WorldWithAds
};
template <class... Args>
std::shared_ptr<TranslatorInterface> CreateTranslator(TranslatorType type, Args&&... args)
{
switch (type)
{
case TranslatorType::Coastline:
return create<TranslatorCoastline>(std::forward<Args>(args)...);
case TranslatorType::Country:
return create<TranslatorCountry>(std::forward<Args>(args)...);
case TranslatorType::CountryWithAds:
return create<TranslatorCountryWithAds>(std::forward<Args>(args)...);
case TranslatorType::Regions:
return create<TranslatorRegion>(std::forward<Args>(args)...);
case TranslatorType::Streets:
return create<TranslatorStreets>(std::forward<Args>(args)...);
case TranslatorType::GeoObjects:
return create<TranslatorGeoObjects>(std::forward<Args>(args)...);
case TranslatorType::World:
return create<TranslatorWorld>(std::forward<Args>(args)...);
case TranslatorType::WorldWithAds:
return create<TranslatorWorldWithAds>(std::forward<Args>(args)...);
}
UNREACHABLE();
}
} // namespace generator
|