Files
comaps/generator/restriction_writer.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

53 lines
1.2 KiB
C++

#pragma once
#include "generator/collector_interface.hpp"
#include "generator/intermediate_data.hpp"
#include <fstream>
#include <memory>
#include <string>
namespace routing_builder
{
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, IDRInterfacePtr const & cache);
// generator::CollectorInterface overrides:
std::shared_ptr<CollectorInterface> Clone(IDRInterfacePtr const & cache = {}) const override;
void CollectRelation(RelationElement const & relationElement) override;
void Finish() override;
IMPLEMENT_COLLECTOR_IFACE(RestrictionWriter);
void MergeInto(RestrictionWriter & collector) const;
static ViaType ConvertFromString(std::string const & str);
protected:
// generator::CollectorInterface overrides:
void Save() override;
void OrderCollectedData() override;
private:
std::ofstream m_stream;
IDRInterfacePtr m_cache;
};
std::string DebugPrint(RestrictionWriter::ViaType const & type);
} // namespace routing_builder