diff --git a/generator/generator_tests/restriction_collector_test.cpp b/generator/generator_tests/restriction_collector_test.cpp index efa668c09b..aa886f7a2d 100644 --- a/generator/generator_tests/restriction_collector_test.cpp +++ b/generator/generator_tests/restriction_collector_test.cpp @@ -3,7 +3,7 @@ #include "generator/osm_id.hpp" #include "generator/restriction_collector.hpp" -#include "indexer/routing.hpp" +#include "routing/routing_serializer.hpp" #include "platform/platform_tests_support/scoped_dir.hpp" #include "platform/platform_tests_support/scoped_file.hpp" diff --git a/generator/generator_tests/restriction_test.cpp b/generator/generator_tests/restriction_test.cpp index 711065b0a2..8973866e4d 100644 --- a/generator/generator_tests/restriction_test.cpp +++ b/generator/generator_tests/restriction_test.cpp @@ -6,9 +6,10 @@ #include "generator/restriction_collector.hpp" #include "generator/restriction_generator.hpp" +#include "routing/restriction_loader.hpp" + #include "indexer/index.hpp" #include "indexer/mwm_set.hpp" -#include "indexer/restriction_loader.hpp" #include "coding/file_name_utils.hpp" diff --git a/generator/restriction_collector.hpp b/generator/restriction_collector.hpp index 19444a0c52..8f6e60ae8d 100644 --- a/generator/restriction_collector.hpp +++ b/generator/restriction_collector.hpp @@ -1,6 +1,6 @@ #pragma once -#include "indexer/routing.hpp" +#include "routing/routing_serializer.hpp" #include "std/functional.hpp" #include "std/limits.hpp" diff --git a/generator/restriction_generator.cpp b/generator/restriction_generator.cpp index 3483b176fb..2a5eb1a4bf 100644 --- a/generator/restriction_generator.cpp +++ b/generator/restriction_generator.cpp @@ -12,8 +12,6 @@ #include "std/algorithm.hpp" -using namespace feature; - namespace routing { bool BuildRoadRestrictions(string const & mwmPath, string const & restrictionPath, diff --git a/generator/restriction_writer.cpp b/generator/restriction_writer.cpp index 636d0e3ce7..f8550f2549 100644 --- a/generator/restriction_writer.cpp +++ b/generator/restriction_writer.cpp @@ -4,7 +4,7 @@ #include "generator/osm_id.hpp" #include "generator/restriction_collector.hpp" -#include "indexer/routing.hpp" +#include "routing/routing_serializer.hpp" #include "base/logging.hpp" diff --git a/indexer/indexer.pro b/indexer/indexer.pro index 38f5a0d9a3..69a8396265 100644 --- a/indexer/indexer.pro +++ b/indexer/indexer.pro @@ -56,8 +56,6 @@ SOURCES += \ point_to_int64.cpp \ postcodes_matcher.cpp \ # it's in indexer due to editor wich is in indexer and depends on postcodes_marcher rank_table.cpp \ - restriction_loader.cpp \ - routing.cpp \ scales.cpp \ search_delimiters.cpp \ # it's in indexer because of CategoriesHolder dependency. search_string_utils.cpp \ # it's in indexer because of CategoriesHolder dependency. @@ -119,8 +117,6 @@ HEADERS += \ point_to_int64.hpp \ postcodes_matcher.hpp \ # it's in indexer due to editor wich is in indexer and depends on postcodes_marcher rank_table.hpp \ - restriction_loader.hpp \ - routing.hpp \ scale_index.hpp \ scale_index_builder.hpp \ scales.hpp \ diff --git a/indexer/restriction_loader.cpp b/routing/restriction_loader.cpp similarity index 82% rename from indexer/restriction_loader.cpp rename to routing/restriction_loader.cpp index 314189d43b..afb032a3a9 100644 --- a/indexer/restriction_loader.cpp +++ b/routing/restriction_loader.cpp @@ -1,9 +1,7 @@ -#include "indexer/restriction_loader.hpp" -#include "indexer/routing.hpp" +#include "routing/restriction_loader.hpp" +#include "routing/routing_serializer.hpp" -using namespace routing; - -namespace feature +namespace routing { RestrictionLoader::RestrictionLoader(MwmValue const & mwmValue) : m_countryFileName(mwmValue.GetCountryFileName()) @@ -26,4 +24,4 @@ RestrictionLoader::RestrictionLoader(MwmValue const & mwmValue) ("File", m_countryFileName, "Error while reading", ROUTING_FILE_TAG, "section.", e.Msg())); } } -} // namespace feature +} // namespace routing diff --git a/indexer/restriction_loader.hpp b/routing/restriction_loader.hpp similarity index 67% rename from indexer/restriction_loader.hpp rename to routing/restriction_loader.hpp index b64117ca9a..999e9021b1 100644 --- a/indexer/restriction_loader.hpp +++ b/routing/restriction_loader.hpp @@ -1,14 +1,15 @@ #pragma once +#include "routing/routing_serializer.hpp" + #include "indexer/index.hpp" -#include "indexer/routing.hpp" #include "coding/file_container.hpp" #include "std/string.hpp" #include "std/unique_ptr.hpp" -namespace feature +namespace routing { class RestrictionLoader { @@ -16,12 +17,12 @@ public: explicit RestrictionLoader(MwmValue const & mwmValue); bool HasRestrictions() const { return !m_restrictions.empty(); } - routing::RestrictionVec const & GetRestrictions() const { return m_restrictions; } + RestrictionVec const & GetRestrictions() const { return m_restrictions; } private: unique_ptr m_reader; RoutingHeader m_header; - routing::RestrictionVec m_restrictions; + RestrictionVec m_restrictions; string const m_countryFileName; }; -} // namespace feature +} // namespace routing diff --git a/routing/routing.pro b/routing/routing.pro index 8eca9f8dd7..6a82def091 100644 --- a/routing/routing.pro +++ b/routing/routing.pro @@ -33,6 +33,7 @@ SOURCES += \ osrm_path_segment_factory.cpp \ pedestrian_directions.cpp \ pedestrian_model.cpp \ + restriction_loader.cpp \ road_graph.cpp \ road_graph_router.cpp \ route.cpp \ @@ -40,6 +41,7 @@ SOURCES += \ router_delegate.cpp \ routing_algorithm.cpp \ routing_mapping.cpp \ + routing_serializer.cpp \ routing_session.cpp \ speed_camera.cpp \ turns.cpp \ @@ -74,6 +76,7 @@ HEADERS += \ osrm_path_segment_factory.hpp \ pedestrian_directions.hpp \ pedestrian_model.hpp \ + restriction_loader.hpp \ road_graph.hpp \ road_graph_router.hpp \ route.hpp \ @@ -83,6 +86,7 @@ HEADERS += \ routing_helpers.hpp \ routing_mapping.hpp \ routing_result_graph.hpp \ + routing_serializer.hpp \ routing_session.hpp \ routing_settings.hpp \ speed_camera.hpp \ diff --git a/indexer/routing.cpp b/routing/routing_serializer.cpp similarity index 96% rename from indexer/routing.cpp rename to routing/routing_serializer.cpp index 283a238702..209e94e96e 100644 --- a/indexer/routing.cpp +++ b/routing/routing_serializer.cpp @@ -1,4 +1,4 @@ -#include "indexer/routing.hpp" +#include "routing/routing_serializer.hpp" namespace { diff --git a/indexer/routing.hpp b/routing/routing_serializer.hpp similarity index 99% rename from indexer/routing.hpp rename to routing/routing_serializer.hpp index ae269a4149..e9355c1493 100644 --- a/indexer/routing.hpp +++ b/routing/routing_serializer.hpp @@ -51,10 +51,7 @@ using RestrictionVec = vector; string ToString(Restriction::Type const & type); string DebugPrint(Restriction::Type const & type); string DebugPrint(Restriction const & restriction); -} // namespace routing -namespace feature -{ struct RoutingHeader { RoutingHeader() { Reset(); } @@ -202,4 +199,4 @@ private: return true; } }; -} // namespace feature +} // namespace routing