Welcome to mirror list, hosted at ThFree Co, Russian Federation.

emitter_factory.hpp « generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c212fb52474af76565661d6cba553bc5e08ddf78 (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
#pragma once

#include "generator/emitter_booking.hpp"
#include "generator/emitter_coastline.hpp"
#include "generator/emitter_country.hpp"
#include "generator/emitter_interface.hpp"
#include "generator/emitter_noop.hpp"
#include "generator/emitter_restaurants.hpp"
#include "generator/emitter_simple.hpp"
#include "generator/emitter_world.hpp"
#include "generator/factory_utils.hpp"

#include "base/assert.hpp"

#include <memory>
#include <utility>

namespace generator
{
enum class EmitterType
{
  Restaurants,
  Simple,
  SimpleWithPreserialize,
  Country,
  Coastline,
  World,
  Noop
  //  Booking
};

template <class... Args>
std::shared_ptr<EmitterInterface> CreateEmitter(EmitterType type, Args&&... args)
{
  switch (type)
  {
  case EmitterType::Coastline:
    return create<EmitterCoastline>(std::forward<Args>(args)...);
  case EmitterType::Country:
    return create<EmitterCountry>(std::forward<Args>(args)...);
  case EmitterType::Simple:
    return create<EmitterSimple>(std::forward<Args>(args)...);
  case EmitterType::SimpleWithPreserialize:
    return create<EmitterPreserialize>(std::forward<Args>(args)...);
  case EmitterType::Restaurants:
    return create<EmitterRestaurants>(std::forward<Args>(args)...);
  case EmitterType::World:
    return create<EmitterWorld>(std::forward<Args>(args)...);
  case EmitterType::Noop:
    return create<EmitterNoop>(std::forward<Args>(args)...);
  }
  UNREACHABLE();
}
}  // namespace generator