#pragma once #include "openlr/stats.hpp" #include "indexer/data_source.hpp" #include "base/exception.hpp" #include #include #include #include #include namespace openlr { struct LinearSegment; struct DecodedPath; DECLARE_EXCEPTION(DecoderError, RootException); class Graph; class RoadInfoGetter; class OpenLRDecoder { public: using CountryParentNameGetter = std::function; class SegmentsFilter { public: SegmentsFilter(std::string const & idsPath, bool const multipointsOnly); bool Matches(LinearSegment const & segment) const; private: std::unordered_set m_ids; bool m_idsSet; bool const m_multipointsOnly; }; OpenLRDecoder(std::vector const & dataSources, CountryParentNameGetter const & countryParentNameGetter); // Maps partner segments to mwm paths. |segments| should be sorted by partner id. void DecodeV1(std::vector const & segments, uint32_t const numThreads, std::vector & paths); void DecodeV2(std::vector const & segments, uint32_t const numThreads, std::vector & paths); private: template void Decode(std::vector const & segments, uint32_t const numThreads, std::vector & paths); std::vector const & m_dataSources; CountryParentNameGetter m_countryParentNameGetter; }; } // namespace openlr