diff options
Diffstat (limited to 'routing')
-rw-r--r-- | routing/features_road_graph.cpp | 10 | ||||
-rw-r--r-- | routing/road_graph.cpp | 6 | ||||
-rw-r--r-- | routing/road_graph.hpp | 12 | ||||
-rw-r--r-- | routing/road_graph_router.cpp | 36 | ||||
-rw-r--r-- | routing/road_graph_router.hpp | 3 |
5 files changed, 36 insertions, 31 deletions
diff --git a/routing/features_road_graph.cpp b/routing/features_road_graph.cpp index 1fa3793f48..8b3f2a17c2 100644 --- a/routing/features_road_graph.cpp +++ b/routing/features_road_graph.cpp @@ -103,8 +103,9 @@ void FeaturesRoadGraph::RoadInfoCache::Clear() FeaturesRoadGraph::FeaturesRoadGraph(Index const & index, bool onewayAsBidirectional, unique_ptr<IVehicleModelFactory> && vehicleModelFactory) - : m_index(index), m_onewayAsBidirectional(onewayAsBidirectional), - m_vehicleModel(move(vehicleModelFactory)) + : m_index(index) + , m_onewayAsBidirectional(onewayAsBidirectional) + , m_vehicleModel(move(vehicleModelFactory)) { } @@ -113,9 +114,8 @@ uint32_t FeaturesRoadGraph::GetStreetReadScale() { return scales::GetUpperScale( class CrossFeaturesLoader { public: - CrossFeaturesLoader(FeaturesRoadGraph const & graph, - IRoadGraph::ICrossEdgesLoader & edgesLoader) - : m_graph(graph), m_edgesLoader(edgesLoader) + CrossFeaturesLoader(FeaturesRoadGraph const & graph, IRoadGraph::ICrossEdgesLoader & edgesLoader) + : m_graph(graph), m_edgesLoader(edgesLoader) {} void operator()(FeatureType & ft) diff --git a/routing/road_graph.cpp b/routing/road_graph.cpp index 36ff80188e..73dbf8953a 100644 --- a/routing/road_graph.cpp +++ b/routing/road_graph.cpp @@ -167,7 +167,8 @@ IRoadGraph::RoadInfo::RoadInfo(bool bidirectional, double speedKMPH, initializer {} // IRoadGraph::CrossOutgoingLoader --------------------------------------------- -void IRoadGraph::CrossOutgoingLoader::LoadEdge(FeatureID const & featureId, RoadInfo const & roadInfo) +void IRoadGraph::CrossOutgoingLoader::LoadEdge(FeatureID const & featureId, + RoadInfo const & roadInfo) { size_t const numPoints = roadInfo.m_points.size(); @@ -197,7 +198,8 @@ void IRoadGraph::CrossOutgoingLoader::LoadEdge(FeatureID const & featureId, Road } // IRoadGraph::CrossIngoingLoader ---------------------------------------------- -void IRoadGraph::CrossIngoingLoader::LoadEdge(FeatureID const & featureId, RoadInfo const & roadInfo) +void IRoadGraph::CrossIngoingLoader::LoadEdge(FeatureID const & featureId, + RoadInfo const & roadInfo) { size_t const numPoints = roadInfo.m_points.size(); diff --git a/routing/road_graph.hpp b/routing/road_graph.hpp index 8c26f8a867..916706fba2 100644 --- a/routing/road_graph.hpp +++ b/routing/road_graph.hpp @@ -103,7 +103,9 @@ public: { public: ICrossEdgesLoader(m2::PointD const & cross, bool onewayAsBidirectional, TEdgeVector & edges) - : m_cross(cross), m_onewayAsBidirectional(onewayAsBidirectional), m_edges(edges) {} + : m_cross(cross), m_onewayAsBidirectional(onewayAsBidirectional), m_edges(edges) + { + } virtual ~ICrossEdgesLoader() = default; void operator()(FeatureID const & featureId, RoadInfo const & roadInfo) @@ -124,7 +126,9 @@ public: { public: CrossOutgoingLoader(m2::PointD const & cross, bool onewayAsBidirectional, TEdgeVector & edges) - : ICrossEdgesLoader(cross, onewayAsBidirectional, edges) {} + : ICrossEdgesLoader(cross, onewayAsBidirectional, edges) + { + } // ICrossEdgesLoader overrides: virtual void LoadEdge(FeatureID const & featureId, RoadInfo const & roadInfo) override; @@ -134,7 +138,9 @@ public: { public: CrossIngoingLoader(m2::PointD const & cross, bool onewayAsBidirectional, TEdgeVector & edges) - : ICrossEdgesLoader(cross, onewayAsBidirectional, edges) {} + : ICrossEdgesLoader(cross, onewayAsBidirectional, edges) + { + } // ICrossEdgesLoader overrides: virtual void LoadEdge(FeatureID const & featureId, RoadInfo const & roadInfo) override; }; diff --git a/routing/road_graph_router.cpp b/routing/road_graph_router.cpp index cc3be95ee3..7e75f58396 100644 --- a/routing/road_graph_router.cpp +++ b/routing/road_graph_router.cpp @@ -131,17 +131,17 @@ void FindClosestEdges(IRoadGraph const & graph, m2::PointD const & point, RoadGraphRouter::~RoadGraphRouter() {} RoadGraphRouter::RoadGraphRouter(string const & name, Index const & index, - TCountryFileFn const & countryFileFn, - bool onewayAsBidirectional, + TCountryFileFn const & countryFileFn, bool onewayAsBidirectional, unique_ptr<IVehicleModelFactory> && vehicleModelFactory, unique_ptr<IRoutingAlgorithm> && algorithm, unique_ptr<IDirectionsEngine> && directionsEngine) - : m_name(name) - , m_countryFileFn(countryFileFn) - , m_index(index) - , m_algorithm(move(algorithm)) - , m_roadGraph(make_unique<FeaturesRoadGraph>(index, onewayAsBidirectional, move(vehicleModelFactory))) - , m_directionsEngine(move(directionsEngine)) + : m_name(name) + , m_countryFileFn(countryFileFn) + , m_index(index) + , m_algorithm(move(algorithm)) + , m_roadGraph( + make_unique<FeaturesRoadGraph>(index, onewayAsBidirectional, move(vehicleModelFactory))) + , m_directionsEngine(move(directionsEngine)) { } @@ -259,10 +259,9 @@ unique_ptr<IRouter> CreatePedestrianAStarRouter(Index & index, TCountryFileFn co unique_ptr<IVehicleModelFactory> vehicleModelFactory(new PedestrianModelFactory()); unique_ptr<IRoutingAlgorithm> algorithm(new AStarRoutingAlgorithm()); unique_ptr<IDirectionsEngine> directionsEngine(new PedestrianDirectionsEngine()); - unique_ptr<IRouter> router(new RoadGraphRouter("astar-pedestrian", index, countryFileFn, - true /* onewayAsBidirectional */, - move(vehicleModelFactory), move(algorithm), - move(directionsEngine))); + unique_ptr<IRouter> router(new RoadGraphRouter( + "astar-pedestrian", index, countryFileFn, true /* onewayAsBidirectional */, + move(vehicleModelFactory), move(algorithm), move(directionsEngine))); return router; } @@ -271,10 +270,9 @@ unique_ptr<IRouter> CreatePedestrianAStarBidirectionalRouter(Index & index, TCou unique_ptr<IVehicleModelFactory> vehicleModelFactory(new PedestrianModelFactory()); unique_ptr<IRoutingAlgorithm> algorithm(new AStarBidirectionalRoutingAlgorithm()); unique_ptr<IDirectionsEngine> directionsEngine(new PedestrianDirectionsEngine()); - unique_ptr<IRouter> router(new RoadGraphRouter("astar-bidirectional-pedestrian", index, - countryFileFn, true /* onewayAsBidirectional */, - move(vehicleModelFactory), - move(algorithm), move(directionsEngine))); + unique_ptr<IRouter> router(new RoadGraphRouter( + "astar-bidirectional-pedestrian", index, countryFileFn, true /* onewayAsBidirectional */, + move(vehicleModelFactory), move(algorithm), move(directionsEngine))); return router; } @@ -283,9 +281,9 @@ unique_ptr<IRouter> CreateBicycleAStarBidirectionalRouter(Index & index, TCountr unique_ptr<IVehicleModelFactory> vehicleModelFactory(new BicycleModelFactory()); unique_ptr<IRoutingAlgorithm> algorithm(new AStarBidirectionalRoutingAlgorithm()); unique_ptr<IDirectionsEngine> directionsEngine(new BicycleDirectionsEngine(index)); - unique_ptr<IRouter> router(new RoadGraphRouter("astar-bidirectional-bicycle", index, countryFileFn, - false /* onewayAsBidirectional */, move(vehicleModelFactory), - move(algorithm), move(directionsEngine))); + unique_ptr<IRouter> router(new RoadGraphRouter( + "astar-bidirectional-bicycle", index, countryFileFn, false /* onewayAsBidirectional */, + move(vehicleModelFactory), move(algorithm), move(directionsEngine))); return router; } } // namespace routing diff --git a/routing/road_graph_router.hpp b/routing/road_graph_router.hpp index ca6eba45c3..c9894d3107 100644 --- a/routing/road_graph_router.hpp +++ b/routing/road_graph_router.hpp @@ -23,8 +23,7 @@ namespace routing class RoadGraphRouter : public IRouter { public: - RoadGraphRouter(string const & name, Index const & index, - TCountryFileFn const & countryFileFn, + RoadGraphRouter(string const & name, Index const & index, TCountryFileFn const & countryFileFn, bool onewayAsBidirectional, unique_ptr<IVehicleModelFactory> && vehicleModelFactory, unique_ptr<IRoutingAlgorithm> && algorithm, |