blob: 64617610e02514b8dde13c70ef03bb7bd16ae35f (
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
|
#pragma once
#include "generator/emitter_interface.hpp"
#include "generator/feature_builder.hpp"
#include "generator/feature_generator.hpp"
#include "indexer/feature_data.hpp"
#include "base/geo_object_id.hpp"
#include "base/logging.hpp"
#include <map>
namespace generator
{
using namespace std;
template <typename Dataset>
class EmitterBooking : public EmitterInterface
{
public:
EmitterBooking(Dataset const & dataset, map<base::GeoObjectId, feature::FeatureBuilder> & features)
: m_dataset(dataset), m_features(features)
{
}
// EmitterInterface overrides:
void Process(feature::FeatureBuilder & fb) override
{
if (m_dataset.NecessaryMatchingConditionHolds(fb))
m_features.emplace(fb.GetMostGenericOsmId(), fb);
}
void GetNames(vector<string> & names) const override
{
names.clear();
}
bool Finish() override
{
LOG_SHORT(LINFO, ("Num of booking elements:", m_features.size()));
return true;
}
private:
Dataset const & m_dataset;
map<base::GeoObjectId, feature::FeatureBuilder> & m_features;
};
} // namespace generator
|