forked from organicmaps/organicmaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtranslator_factory.hpp
37 lines (32 loc) · 1013 Bytes
/
translator_factory.hpp
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
#pragma once
#include "generator/factory_utils.hpp"
#include "generator/translator_coastline.hpp"
//#include "generator/translator_complex.hpp"
#include "generator/translator_country.hpp"
#include "generator/translator_interface.hpp"
#include "generator/translator_world.hpp"
#include "base/assert.hpp"
#include <memory>
#include <utility>
namespace generator
{
enum class TranslatorType
{
Country,
Coastline,
World,
//Complex
};
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::World: return create<TranslatorWorld>(std::forward<Args>(args)...);
//case TranslatorType::Complex: return create<TranslatorComplex>(std::forward<Args>(args)...);
}
UNREACHABLE();
}
} // namespace generator