#pragma once #include "generator/collector_interface.hpp" #include "generator/intermediate_data.hpp" #include #include #include class RelationElement; namespace generator { namespace cache { class IntermediateDataReaderInterface; } // namespace cache } // namespace generator namespace routing { class RestrictionWriter : public generator::CollectorInterface { public: enum class ViaType { Node, Way, Count, }; static std::string const kNodeString; static std::string const kWayString; RestrictionWriter( std::string const & filename, std::shared_ptr const & cache); // generator::CollectorInterface overrides: std::shared_ptr Clone( std::shared_ptr const & cache = {}) const override; void CollectRelation(RelationElement const & relationElement) override; void Finish() override; void Merge(generator::CollectorInterface const & collector) override; void MergeInto(RestrictionWriter & collector) const override; static ViaType ConvertFromString(std::string const & str); protected: // generator::CollectorInterface overrides: void Save() override; void OrderCollectedData() override; private: std::ofstream m_stream; std::shared_ptr m_cache; }; std::string DebugPrint(RestrictionWriter::ViaType const & type); } // namespace routing