From 39eeb42b7f4af4a3b53d9ed0efa0db3e7ce4f0b7 Mon Sep 17 00:00:00 2001 From: Maksim Andrianov Date: Tue, 1 Oct 2019 17:28:46 +0300 Subject: [PATCH] [generator] Clang-format --- generator/generator_tool/generator_tool.cpp | 15 +++-- generator/processor_booking.hpp | 12 ++-- generator/processor_coastline.cpp | 13 ++--- generator/processor_country.cpp | 22 ++++--- generator/processor_factory.hpp | 17 ++---- generator/processor_interface.hpp | 3 +- generator/processor_simple.cpp | 25 +++----- generator/processor_simple.hpp | 3 +- generator/processor_world.cpp | 16 ++---- generator/translator.cpp | 8 +-- generator/translator.hpp | 4 +- generator/translator_coastline.cpp | 21 +++---- generator/translator_collection.cpp | 13 ++--- generator/translator_collection.hpp | 3 +- generator/translator_country.cpp | 63 ++++++++++++--------- generator/translator_country.hpp | 2 +- generator/translator_factory.hpp | 11 ++-- generator/translator_world.cpp | 30 +++++----- 18 files changed, 125 insertions(+), 156 deletions(-) diff --git a/generator/generator_tool/generator_tool.cpp b/generator/generator_tool/generator_tool.cpp index b097700122..34aef471b0 100644 --- a/generator/generator_tool/generator_tool.cpp +++ b/generator/generator_tool/generator_tool.cpp @@ -121,8 +121,9 @@ DEFINE_string(cities_boundaries_data, "", "File with cities boundaries"); DEFINE_bool(generate_cities_ids, false, "Generate the cities ids section"); DEFINE_bool(generate_world, false, "Generate separate world file."); -DEFINE_bool(have_borders_for_whole_world, false, "If it is set to true, the optimization of checking that the " - "fb belongs to the country border will be applied."); +DEFINE_bool(have_borders_for_whole_world, false, + "If it is set to true, the optimization of checking that the " + "fb belongs to the country border will be applied."); DEFINE_string( nodes_list_path, "", @@ -201,7 +202,7 @@ int GeneratorToolMain(int argc, char ** argv) CHECK(IsLittleEndian(), ("Only little-endian architectures are supported.")); google::SetUsageMessage( - "Takes OSM XML data from stdin and creates data and index files in several passes."); + "Takes OSM XML data from stdin and creates data and index files in several passes."); google::SetVersionString(std::to_string(omim::build_version::git::kTimestamp) + " " + omim::build_version::git::kHash); google::ParseCommandLineFlags(&argc, &argv, true); @@ -224,8 +225,8 @@ int GeneratorToolMain(int argc, char ** argv) feature::GenerateInfo genInfo; genInfo.m_verbose = FLAGS_verbose; genInfo.m_intermediateDir = FLAGS_intermediate_data_path.empty() - ? path - : base::AddSlashIfNeeded(FLAGS_intermediate_data_path); + ? path + : base::AddSlashIfNeeded(FLAGS_intermediate_data_path); genInfo.m_targetDir = genInfo.m_tmpDir = path; /// @todo Probably, it's better to add separate option for .mwm.tmp files. @@ -273,9 +274,7 @@ int GeneratorToolMain(int argc, char ** argv) } // Generate .mwm.tmp files. - if (FLAGS_generate_features || - FLAGS_generate_world || - FLAGS_make_coasts) + if (FLAGS_generate_features || FLAGS_generate_world || FLAGS_make_coasts) { RawGenerator rawGenerator(genInfo, threadsCount); if (FLAGS_generate_features) diff --git a/generator/processor_booking.hpp b/generator/processor_booking.hpp index cb83baed57..05f0a30163 100644 --- a/generator/processor_booking.hpp +++ b/generator/processor_booking.hpp @@ -20,8 +20,11 @@ template class ProcessorBooking : public FeatureProcessorInterface { public: - ProcessorBooking(Dataset const & dataset, std::map & features) - : m_dataset(dataset), m_features(features) {} + ProcessorBooking(Dataset const & dataset, + std::map & features) + : m_dataset(dataset), m_features(features) + { + } // FeatureProcessorInterface overrides: virtual std::shared_ptr Clone() const override @@ -38,10 +41,7 @@ public: void Finish() override {} - void Merge(FeatureProcessorInterface const &) override - { - CHECK(false, ()); - } + void Merge(FeatureProcessorInterface const &) override { CHECK(false, ()); } private: Dataset const & m_dataset; diff --git a/generator/processor_coastline.cpp b/generator/processor_coastline.cpp index f411ddcdc8..bd7f49e3a7 100644 --- a/generator/processor_coastline.cpp +++ b/generator/processor_coastline.cpp @@ -20,7 +20,8 @@ ProcessorCoastline::ProcessorCoastline(std::shared_ptr co m_processingChain = std::make_shared(); m_processingChain->Add(std::make_shared()); auto affiliation = std::make_shared(WORLD_COASTS_FILE_NAME); - m_affiliationsLayer = std::make_shared>(kAffiliationsBufferSize, affiliation, m_queue); + m_affiliationsLayer = + std::make_shared>(kAffiliationsBufferSize, affiliation, m_queue); m_processingChain->Add(m_affiliationsLayer); } @@ -34,15 +35,9 @@ void ProcessorCoastline::Process(feature::FeatureBuilder & feature) m_processingChain->Handle(feature); } -void ProcessorCoastline::Finish() -{ - m_affiliationsLayer->AddBufferToQueue(); -} +void ProcessorCoastline::Finish() { m_affiliationsLayer->AddBufferToQueue(); } -void ProcessorCoastline::Merge(FeatureProcessorInterface const & other) -{ - other.MergeInto(*this); -} +void ProcessorCoastline::Merge(FeatureProcessorInterface const & other) { other.MergeInto(*this); } void ProcessorCoastline::MergeInto(ProcessorCoastline & other) const { diff --git a/generator/processor_country.cpp b/generator/processor_country.cpp index d041887e27..d274e4eacf 100644 --- a/generator/processor_country.cpp +++ b/generator/processor_country.cpp @@ -10,7 +10,8 @@ namespace generator { ProcessorCountry::ProcessorCountry(std::shared_ptr const & queue, - std::string const & bordersPath, std::string const & layerLogFilename, + std::string const & bordersPath, + std::string const & layerLogFilename, bool haveBordersForWholeWorld) : m_bordersPath(bordersPath) , m_layerLogFilename(layerLogFilename) @@ -20,14 +21,17 @@ ProcessorCountry::ProcessorCountry(std::shared_ptr const m_processingChain = std::make_shared(); m_processingChain->Add(std::make_shared()); m_processingChain->Add(std::make_shared()); - auto affiliation = std::make_shared(bordersPath, haveBordersForWholeWorld); - m_affiliationsLayer = std::make_shared>(kAffiliationsBufferSize, affiliation, m_queue); + auto affiliation = std::make_shared( + bordersPath, haveBordersForWholeWorld); + m_affiliationsLayer = + std::make_shared>(kAffiliationsBufferSize, affiliation, m_queue); m_processingChain->Add(m_affiliationsLayer); } std::shared_ptr ProcessorCountry::Clone() const { - return std::make_shared(m_queue, m_bordersPath, m_layerLogFilename, m_haveBordersForWholeWorld); + return std::make_shared(m_queue, m_bordersPath, m_layerLogFilename, + m_haveBordersForWholeWorld); } void ProcessorCountry::Process(feature::FeatureBuilder & feature) @@ -35,10 +39,7 @@ void ProcessorCountry::Process(feature::FeatureBuilder & feature) m_processingChain->Handle(feature); } -void ProcessorCountry::Finish() -{ - m_affiliationsLayer->AddBufferToQueue(); -} +void ProcessorCountry::Finish() { m_affiliationsLayer->AddBufferToQueue(); } void ProcessorCountry::WriteDump() { @@ -49,10 +50,7 @@ void ProcessorCountry::WriteDump() LOG(LINFO, ("Skipped elements were saved to", m_layerLogFilename)); } -void ProcessorCountry::Merge(FeatureProcessorInterface const & other) -{ - other.MergeInto(*this); -} +void ProcessorCountry::Merge(FeatureProcessorInterface const & other) { other.MergeInto(*this); } void ProcessorCountry::MergeInto(ProcessorCountry & other) const { diff --git a/generator/processor_factory.hpp b/generator/processor_factory.hpp index e48a378b96..4995c4046f 100644 --- a/generator/processor_factory.hpp +++ b/generator/processor_factory.hpp @@ -27,20 +27,15 @@ enum class ProcessorType }; template -std::shared_ptr CreateProcessor(ProcessorType type, Args&&... args) +std::shared_ptr CreateProcessor(ProcessorType type, Args &&... args) { switch (type) { - case ProcessorType::Coastline: - return create(std::forward(args)...); - case ProcessorType::Country: - return create(std::forward(args)...); - case ProcessorType::Simple: - return create(std::forward(args)...); - case ProcessorType::World: - return create(std::forward(args)...); - case ProcessorType::Noop: - return create(std::forward(args)...); + case ProcessorType::Coastline: return create(std::forward(args)...); + case ProcessorType::Country: return create(std::forward(args)...); + case ProcessorType::Simple: return create(std::forward(args)...); + case ProcessorType::World: return create(std::forward(args)...); + case ProcessorType::Noop: return create(std::forward(args)...); } UNREACHABLE(); } diff --git a/generator/processor_interface.hpp b/generator/processor_interface.hpp index dcd67083f1..5bb1ff5817 100644 --- a/generator/processor_interface.hpp +++ b/generator/processor_interface.hpp @@ -19,7 +19,8 @@ class ProcessorNoop; class ProcessorSimple; class ProcessorWorld; -// Implementing this interface allows an object to process FeatureBuilder objects and broadcast them. +// Implementing this interface allows an object to process FeatureBuilder objects and broadcast +// them. class FeatureProcessorInterface { public: diff --git a/generator/processor_simple.cpp b/generator/processor_simple.cpp index 71f5a95208..8d2a0068cb 100644 --- a/generator/processor_simple.cpp +++ b/generator/processor_simple.cpp @@ -9,35 +9,26 @@ namespace generator { ProcessorSimple::ProcessorSimple(std::shared_ptr const & queue, std::string const & name) - : m_name(name) - , m_queue(queue) + : m_name(name), m_queue(queue) { m_processingChain = std::make_shared(); auto affiliation = std::make_shared(name); - m_affiliationsLayer = std::make_shared>(kAffiliationsBufferSize, affiliation, m_queue); + m_affiliationsLayer = + std::make_shared>( + kAffiliationsBufferSize, affiliation, m_queue); m_processingChain->Add(m_affiliationsLayer); } -std::shared_ptrProcessorSimple::Clone() const +std::shared_ptr ProcessorSimple::Clone() const { return std::make_shared(m_queue, m_name); } -void ProcessorSimple::Process(feature::FeatureBuilder & fb) -{ - m_processingChain->Handle(fb); -} +void ProcessorSimple::Process(feature::FeatureBuilder & fb) { m_processingChain->Handle(fb); } -void ProcessorSimple::Finish() -{ - m_affiliationsLayer->AddBufferToQueue(); -} +void ProcessorSimple::Finish() { m_affiliationsLayer->AddBufferToQueue(); } -void ProcessorSimple::Merge(FeatureProcessorInterface const & other) -{ - other.MergeInto(*this); -} +void ProcessorSimple::Merge(FeatureProcessorInterface const & other) { other.MergeInto(*this); } void ProcessorSimple::MergeInto(ProcessorSimple & other) const { diff --git a/generator/processor_simple.hpp b/generator/processor_simple.hpp index c9c8594426..d24722e8de 100644 --- a/generator/processor_simple.hpp +++ b/generator/processor_simple.hpp @@ -30,7 +30,8 @@ public: private: std::string m_name; - std::shared_ptr> m_affiliationsLayer; + std::shared_ptr> + m_affiliationsLayer; std::shared_ptr m_queue; std::shared_ptr m_processingChain; }; diff --git a/generator/processor_world.cpp b/generator/processor_world.cpp index 89c91b888d..a89b903ad6 100644 --- a/generator/processor_world.cpp +++ b/generator/processor_world.cpp @@ -10,14 +10,14 @@ namespace generator { ProcessorWorld::ProcessorWorld(std::shared_ptr const & queue, std::string const & popularityFilename) - : m_popularityFilename(popularityFilename) - , m_queue(queue) + : m_popularityFilename(popularityFilename), m_queue(queue) { m_processingChain = std::make_shared(); m_processingChain->Add(std::make_shared()); m_processingChain->Add(std::make_shared(popularityFilename)); auto affiliation = std::make_shared(WORLD_FILE_NAME); - m_affiliationsLayer = std::make_shared>(kAffiliationsBufferSize, affiliation, m_queue); + m_affiliationsLayer = + std::make_shared>(kAffiliationsBufferSize, affiliation, m_queue); m_processingChain->Add(m_affiliationsLayer); } @@ -31,15 +31,9 @@ void ProcessorWorld::Process(feature::FeatureBuilder & feature) m_processingChain->Handle(feature); } -void ProcessorWorld::Finish() -{ - m_affiliationsLayer->AddBufferToQueue(); -} +void ProcessorWorld::Finish() { m_affiliationsLayer->AddBufferToQueue(); } -void ProcessorWorld::Merge(FeatureProcessorInterface const & other) -{ - other.MergeInto(*this); -} +void ProcessorWorld::Merge(FeatureProcessorInterface const & other) { other.MergeInto(*this); } void ProcessorWorld::MergeInto(ProcessorWorld & other) const { diff --git a/generator/translator.cpp b/generator/translator.cpp index 0b5403f3e3..9954898134 100644 --- a/generator/translator.cpp +++ b/generator/translator.cpp @@ -28,7 +28,8 @@ Translator::Translator(std::shared_ptr const & proces Translator::Translator(std::shared_ptr const & processor, std::shared_ptr const & cache, std::shared_ptr const & maker) - : Translator(processor, cache, maker, std::make_shared(), std::make_shared()) + : Translator(processor, cache, maker, std::make_shared(), + std::make_shared()) { } @@ -37,10 +38,7 @@ void Translator::SetCollector(std::shared_ptr const & collec m_collector = collector; } -void Translator::SetFilter(std::shared_ptr const & filter) -{ - m_filter = filter; -} +void Translator::SetFilter(std::shared_ptr const & filter) { m_filter = filter; } void Translator::Emit(OsmElement & element) { diff --git a/generator/translator.hpp b/generator/translator.hpp index 1b050557dc..b6d55f649d 100644 --- a/generator/translator.hpp +++ b/generator/translator.hpp @@ -21,8 +21,8 @@ namespace cache class IntermediateData; } // namespace cache -// Implementing this base class allows an object to create FeatureBuilder from OsmElement and then process it. -// You can add any collectors and filters. +// Implementing this base class allows an object to create FeatureBuilder from OsmElement and then +// process it. You can add any collectors and filters. class Translator : public TranslatorInterface { public: diff --git a/generator/translator_coastline.cpp b/generator/translator_coastline.cpp index e3ec0ba3a7..cb8a3b3156 100644 --- a/generator/translator_coastline.cpp +++ b/generator/translator_coastline.cpp @@ -39,30 +39,25 @@ public: }; } // namespace -TranslatorCoastline::TranslatorCoastline(std::shared_ptr const & processor, - std::shared_ptr const & cache) +TranslatorCoastline::TranslatorCoastline( + std::shared_ptr const & processor, + std::shared_ptr const & cache) : Translator(processor, cache, std::make_shared(cache)) { auto filters = std::make_shared(); filters->Append(std::make_shared()); filters->Append(std::make_shared()); - filters->Append(std::make_shared(base::JoinPath(GetPlatform().ResourcesDir(), SKIPPED_ELEMENTS_FILE))); + filters->Append(std::make_shared( + base::JoinPath(GetPlatform().ResourcesDir(), SKIPPED_ELEMENTS_FILE))); SetFilter(filters); } -std::shared_ptr -TranslatorCoastline::Clone() const +std::shared_ptr TranslatorCoastline::Clone() const { return Translator::CloneBase(); } -void TranslatorCoastline::Merge(TranslatorInterface const & other) -{ - other.MergeInto(*this); -} +void TranslatorCoastline::Merge(TranslatorInterface const & other) { other.MergeInto(*this); } -void TranslatorCoastline::MergeInto(TranslatorCoastline & other) const -{ - MergeIntoBase(other); -} +void TranslatorCoastline::MergeInto(TranslatorCoastline & other) const { MergeIntoBase(other); } } // namespace generator diff --git a/generator/translator_collection.cpp b/generator/translator_collection.cpp index aeb3ef9401..7592688dc8 100644 --- a/generator/translator_collection.cpp +++ b/generator/translator_collection.cpp @@ -7,8 +7,7 @@ namespace generator { -std::shared_ptr -TranslatorCollection::Clone() const +std::shared_ptr TranslatorCollection::Clone() const { auto p = std::make_shared(); for (auto const & c : m_collection) @@ -33,15 +32,11 @@ void TranslatorCollection::Finish() bool TranslatorCollection::Save() { - return std::all_of(std::begin(m_collection), std::end(m_collection), [](auto & t) { - return t->Save(); - }); + return std::all_of(std::begin(m_collection), std::end(m_collection), + [](auto & t) { return t->Save(); }); } -void TranslatorCollection::Merge(TranslatorInterface const & other) -{ - other.MergeInto(*this); -} +void TranslatorCollection::Merge(TranslatorInterface const & other) { other.MergeInto(*this); } void TranslatorCollection::MergeInto(TranslatorCollection & other) const { diff --git a/generator/translator_collection.hpp b/generator/translator_collection.hpp index 66a867d27d..f15e6a1c1f 100644 --- a/generator/translator_collection.hpp +++ b/generator/translator_collection.hpp @@ -8,7 +8,8 @@ namespace generator { // This class allows you to work with a group of translators as with one. -class TranslatorCollection : public CollectionBase>, public TranslatorInterface +class TranslatorCollection : public CollectionBase>, + public TranslatorInterface { public: // TranslatorInterface overrides: diff --git a/generator/translator_country.cpp b/generator/translator_country.cpp index 64c7477e72..676bcd1f65 100644 --- a/generator/translator_country.cpp +++ b/generator/translator_country.cpp @@ -21,8 +21,8 @@ #include "platform/platform.hpp" -#include "base/file_name_utils.hpp" #include "base/assert.hpp" +#include "base/file_name_utils.hpp" #include #include @@ -39,7 +39,9 @@ class RelationCollector { public: explicit RelationCollector(std::shared_ptr const & collectors) - : m_collectors(collectors) {} + : m_collectors(collectors) + { + } template base::ControlFlow operator()(uint64_t id, Reader & reader) @@ -79,35 +81,50 @@ TranslatorCountry::TranslatorCountry(std::shared_ptr std::shared_ptr const & cache, feature::GenerateInfo const & info, bool needMixTags) : Translator(processor, cache, std::make_shared(cache)) - , m_tagAdmixer(std::make_shared(info.GetIntermediateFileName("ways", ".csv"), info.GetIntermediateFileName("towns", ".csv"))) - , m_tagReplacer(std::make_shared(base::JoinPath(GetPlatform().ResourcesDir(), REPLACED_TAGS_FILE))) + , m_tagAdmixer(std::make_shared(info.GetIntermediateFileName("ways", ".csv"), + info.GetIntermediateFileName("towns", ".csv"))) + , m_tagReplacer(std::make_shared( + base::JoinPath(GetPlatform().ResourcesDir(), REPLACED_TAGS_FILE))) { if (needMixTags) - m_osmTagMixer = std::make_shared(base::JoinPath(GetPlatform().ResourcesDir(), MIXED_TAGS_FILE)); - + { + m_osmTagMixer = std::make_shared( + base::JoinPath(GetPlatform().ResourcesDir(), MIXED_TAGS_FILE)); + } auto filters = std::make_shared(); filters->Append(std::make_shared()); - filters->Append(std::make_shared(base::JoinPath(GetPlatform().ResourcesDir(), SKIPPED_ELEMENTS_FILE))); + filters->Append(std::make_shared( + base::JoinPath(GetPlatform().ResourcesDir(), SKIPPED_ELEMENTS_FILE))); SetFilter(filters); auto collectors = std::make_shared(); - collectors->Append(std::make_shared(info.GetIntermediateFileName(METALINES_FILENAME))); - collectors->Append(std::make_shared(info.GetIntermediateFileName(CITIES_AREAS_TMP_FILENAME))); - // These are the four collector that collect additional information for the future building of routing section. - collectors->Append(std::make_shared(info.GetIntermediateFileName(MAXSPEEDS_FILENAME))); - collectors->Append(std::make_shared(info.GetIntermediateFileName(RESTRICTIONS_FILENAME), cache->GetCache())); - collectors->Append(std::make_shared(info.GetIntermediateFileName(ROAD_ACCESS_FILENAME))); - collectors->Append(std::make_shared(info.GetIntermediateFileName(CAMERAS_TO_WAYS_FILENAME))); - collectors->Append(std::make_shared(info.m_intermediateDir, info.m_targetDir, info.m_haveBordersForWholeWorld)); + collectors->Append(std::make_shared( + info.GetIntermediateFileName(METALINES_FILENAME))); + collectors->Append( + std::make_shared(info.GetIntermediateFileName(CITIES_AREAS_TMP_FILENAME))); + // These are the four collector that collect additional information for the future building of + // routing section. + collectors->Append( + std::make_shared(info.GetIntermediateFileName(MAXSPEEDS_FILENAME))); + collectors->Append(std::make_shared( + info.GetIntermediateFileName(RESTRICTIONS_FILENAME), cache->GetCache())); + collectors->Append(std::make_shared( + info.GetIntermediateFileName(ROAD_ACCESS_FILENAME))); + collectors->Append(std::make_shared( + info.GetIntermediateFileName(CAMERAS_TO_WAYS_FILENAME))); + collectors->Append(std::make_shared( + info.m_intermediateDir, info.m_targetDir, info.m_haveBordersForWholeWorld)); if (info.m_genAddresses) collectors->Append(std::make_shared(info.GetAddressesFileName())); if (!info.m_idToWikidataFilename.empty()) - collectors->Append(std::make_shared(info.m_idToWikidataFilename, "wikidata" /* tagKey */, WikiDataValidator)); + { + collectors->Append(std::make_shared(info.m_idToWikidataFilename, + "wikidata" /* tagKey */, WikiDataValidator)); + } SetCollector(collectors); } -std::shared_ptr -TranslatorCountry::Clone() const +std::shared_ptr TranslatorCountry::Clone() const { auto copy = Translator::CloneBase(); copy->m_tagAdmixer = m_tagAdmixer; @@ -126,15 +143,9 @@ void TranslatorCountry::Preprocess(OsmElement & element) CollectFromRelations(element); } -void TranslatorCountry::Merge(TranslatorInterface const & other) -{ - other.MergeInto(*this); -} +void TranslatorCountry::Merge(TranslatorInterface const & other) { other.MergeInto(*this); } -void TranslatorCountry::MergeInto(TranslatorCountry & other) const -{ - MergeIntoBase(other); -} +void TranslatorCountry::MergeInto(TranslatorCountry & other) const { MergeIntoBase(other); } void TranslatorCountry::CollectFromRelations(OsmElement const & element) { diff --git a/generator/translator_country.hpp b/generator/translator_country.hpp index 3c9941ae99..749065f2d9 100644 --- a/generator/translator_country.hpp +++ b/generator/translator_country.hpp @@ -21,7 +21,7 @@ namespace generator // The TranslatorArea class implements translator for building countries. class TranslatorCountry : public Translator { -public: +public: explicit TranslatorCountry(std::shared_ptr const & processor, std::shared_ptr const & cache, feature::GenerateInfo const & info, bool needMixTags = false); diff --git a/generator/translator_factory.hpp b/generator/translator_factory.hpp index da1d3372ed..6260f3aefd 100644 --- a/generator/translator_factory.hpp +++ b/generator/translator_factory.hpp @@ -21,16 +21,13 @@ enum class TranslatorType }; template -std::shared_ptr CreateTranslator(TranslatorType type, Args&&... args) +std::shared_ptr CreateTranslator(TranslatorType type, Args &&... args) { switch (type) { - case TranslatorType::Coastline: - return create(std::forward(args)...); - case TranslatorType::Country: - return create(std::forward(args)...); - case TranslatorType::World: - return create(std::forward(args)...); + case TranslatorType::Coastline: return create(std::forward(args)...); + case TranslatorType::Country: return create(std::forward(args)...); + case TranslatorType::World: return create(std::forward(args)...); } UNREACHABLE(); } diff --git a/generator/translator_world.cpp b/generator/translator_world.cpp index b7b23934fc..18a9fcf7fb 100644 --- a/generator/translator_world.cpp +++ b/generator/translator_world.cpp @@ -3,8 +3,8 @@ #include "generator/collector_interface.hpp" #include "generator/feature_maker.hpp" #include "generator/filter_collection.hpp" -#include "generator/filter_planet.hpp" #include "generator/filter_elements.hpp" +#include "generator/filter_planet.hpp" #include "generator/filter_world.hpp" #include "generator/generate_info.hpp" #include "generator/intermediate_data.hpp" @@ -25,20 +25,24 @@ TranslatorWorld::TranslatorWorld(std::shared_ptr cons std::shared_ptr const & cache, feature::GenerateInfo const & info, bool needMixTags) : Translator(processor, cache, std::make_shared(cache)) - , m_tagAdmixer(std::make_shared(info.GetIntermediateFileName("ways", ".csv"), info.GetIntermediateFileName("towns", ".csv"))) - , m_tagReplacer(std::make_shared(base::JoinPath(GetPlatform().ResourcesDir(), REPLACED_TAGS_FILE))) + , m_tagAdmixer(std::make_shared(info.GetIntermediateFileName("ways", ".csv"), + info.GetIntermediateFileName("towns", ".csv"))) + , m_tagReplacer(std::make_shared( + base::JoinPath(GetPlatform().ResourcesDir(), REPLACED_TAGS_FILE))) { if (needMixTags) - m_osmTagMixer = std::make_shared(base::JoinPath(GetPlatform().ResourcesDir(), MIXED_TAGS_FILE)); - + { + m_osmTagMixer = std::make_shared( + base::JoinPath(GetPlatform().ResourcesDir(), MIXED_TAGS_FILE)); + } auto filters = std::make_shared(); filters->Append(std::make_shared()); - filters->Append(std::make_shared(base::JoinPath(GetPlatform().ResourcesDir(), SKIPPED_ELEMENTS_FILE))); + filters->Append(std::make_shared( + base::JoinPath(GetPlatform().ResourcesDir(), SKIPPED_ELEMENTS_FILE))); SetFilter(filters); } -std::shared_ptr -TranslatorWorld::Clone() const +std::shared_ptr TranslatorWorld::Clone() const { auto copy = Translator::CloneBase(); copy->m_tagAdmixer = m_tagAdmixer; @@ -56,13 +60,7 @@ void TranslatorWorld::Preprocess(OsmElement & element) m_osmTagMixer->Process(element); } -void TranslatorWorld::Merge(TranslatorInterface const & other) -{ - other.MergeInto(*this); -} +void TranslatorWorld::Merge(TranslatorInterface const & other) { other.MergeInto(*this); } -void TranslatorWorld::MergeInto(TranslatorWorld & other) const -{ - MergeIntoBase(other); -} +void TranslatorWorld::MergeInto(TranslatorWorld & other) const { MergeIntoBase(other); } } // namespace generator