#pragma once #include "generator/collector_collection.hpp" #include "generator/feature_maker_base.hpp" #include "generator/filter_collection.hpp" #include "generator/filter_interface.hpp" #include "generator/relation_tags_enricher.hpp" #include "generator/translator_interface.hpp" #include #include #include struct OsmElement; namespace generator { class EmitterInterface; class CollectorInterface; namespace cache { class IntermediateDataReader; } // namespace cache // Implementing this base class allows an object to create FeatureBuilder1 from OsmElement and then process it. // You can add any collectors and filters. class Translator : public TranslatorInterface { public: explicit Translator(std::shared_ptr emitter, cache::IntermediateDataReader & cache, std::shared_ptr maker, FilterCollection const & filters, CollectorCollection const & collectors); explicit Translator(std::shared_ptr emitter, cache::IntermediateDataReader & cache, std::shared_ptr maker); // TranslatorInterface overrides: void Emit(OsmElement & element) override; bool Finish() override; void GetNames(std::vector & names) const override; void AddCollector(std::shared_ptr collector); void AddCollectorCollection(CollectorCollection const & collectors); void AddFilter(std::shared_ptr filter); void AddFilterCollection(FilterCollection const & filters); protected: FilterCollection m_filters; CollectorCollection m_collectors; RelationTagsEnricher m_tagsEnricher; std::shared_ptr m_featureMaker; std::shared_ptr m_emitter; cache::IntermediateDataReader & m_cache; }; } // namespace generator