diff --git a/base/base_tests/stl_helpers_test.cpp b/base/base_tests/stl_helpers_test.cpp index 12130cc519..aac0393117 100644 --- a/base/base_tests/stl_helpers_test.cpp +++ b/base/base_tests/stl_helpers_test.cpp @@ -91,7 +91,11 @@ UNIT_TEST(SortUniquePred) }; vector v = {{1, 22}, {2, 33}, {1, 23}, {4, 54}, {3, 34}, {5, 23}, {2, 23}, {7, 32}, {1, 12}}; - my::SortUnique([](Foo const & f1, Foo const & f2) { return f1.i < f2.i; }, v); + my::SortUnique([](Foo const & f1, Foo const & f2) + { + return f1.i < f2.i; + }, + v); TEST_EQUAL(v.size(), 6, ()); TEST_EQUAL(v[0].i, 1, ()); diff --git a/base/stl_helpers.hpp b/base/stl_helpers.hpp index db5cf870f0..035b77e161 100644 --- a/base/stl_helpers.hpp +++ b/base/stl_helpers.hpp @@ -96,8 +96,10 @@ template void SortUnique(function const & comp, vector & v) { sort(v.begin(), v.end(), comp); - function const pred = - [&comp](T const &t1, T const &t2) { return !comp(t1, t2) && !comp(t2, t1); }; + function const pred = [&comp](T const & t1, T const & t2) + { + return !comp(t1, t2) && !comp(t2, t1); + }; v.erase(unique(v.begin(), v.end(), pred), v.end()); } diff --git a/pedestrian_routing_tests/pedestrian_routing_tests.cpp b/pedestrian_routing_tests/pedestrian_routing_tests.cpp index 1921f03bf1..d7733240f7 100644 --- a/pedestrian_routing_tests/pedestrian_routing_tests.cpp +++ b/pedestrian_routing_tests/pedestrian_routing_tests.cpp @@ -94,9 +94,9 @@ unique_ptr CreatePedestrianAStarTestRouter(Index & index, stor auto UKGetter = [&](m2::PointD const & pt) { return cig.GetRegionCountryId(pt); }; unique_ptr vehicleModelFactory(new SimplifiedPedestrianModelFactory()); unique_ptr algorithm(new routing::AStarRoutingAlgorithm()); - unique_ptr router(new routing::RoadGraphRouter("test-astar-pedestrian", index, UKGetter, - true /* onewayAsBidirectional */, - move(vehicleModelFactory), move(algorithm), nullptr)); + unique_ptr router(new routing::RoadGraphRouter( + "test-astar-pedestrian", index, UKGetter, true /* onewayAsBidirectional */, + move(vehicleModelFactory), move(algorithm), nullptr)); return router; } @@ -105,9 +105,9 @@ unique_ptr CreatePedestrianAStarBidirectionalTestRouter(Index auto UKGetter = [&](m2::PointD const & pt) { return cig.GetRegionCountryId(pt); }; unique_ptr vehicleModelFactory(new SimplifiedPedestrianModelFactory()); unique_ptr algorithm(new routing::AStarBidirectionalRoutingAlgorithm()); - unique_ptr router(new routing::RoadGraphRouter("test-astar-bidirectional-pedestrian", index, UKGetter, - true /* onewayAsBidirectional */, - move(vehicleModelFactory), move(algorithm), nullptr)); + unique_ptr router(new routing::RoadGraphRouter( + "test-astar-bidirectional-pedestrian", index, UKGetter, true /* onewayAsBidirectional */, + move(vehicleModelFactory), move(algorithm), nullptr)); return router; } @@ -124,7 +124,8 @@ m2::PointD GetPointOnEdge(routing::Edge & e, double posAlong) void GetNearestPedestrianEdges(Index & index, m2::PointD const & pt, vector> & edges) { unique_ptr vehicleModelFactory(new SimplifiedPedestrianModelFactory()); - routing::FeaturesRoadGraph roadGraph(index, true /* onewayAsBidirectional */, move(vehicleModelFactory)); + routing::FeaturesRoadGraph roadGraph(index, true /* onewayAsBidirectional */, + move(vehicleModelFactory)); roadGraph.FindClosestEdges(pt, 1 /*count*/, edges); } 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 && 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 && vehicleModelFactory, unique_ptr && algorithm, unique_ptr && directionsEngine) - : m_name(name) - , m_countryFileFn(countryFileFn) - , m_index(index) - , m_algorithm(move(algorithm)) - , m_roadGraph(make_unique(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(index, onewayAsBidirectional, move(vehicleModelFactory))) + , m_directionsEngine(move(directionsEngine)) { } @@ -259,10 +259,9 @@ unique_ptr CreatePedestrianAStarRouter(Index & index, TCountryFileFn co unique_ptr vehicleModelFactory(new PedestrianModelFactory()); unique_ptr algorithm(new AStarRoutingAlgorithm()); unique_ptr directionsEngine(new PedestrianDirectionsEngine()); - unique_ptr router(new RoadGraphRouter("astar-pedestrian", index, countryFileFn, - true /* onewayAsBidirectional */, - move(vehicleModelFactory), move(algorithm), - move(directionsEngine))); + unique_ptr router(new RoadGraphRouter( + "astar-pedestrian", index, countryFileFn, true /* onewayAsBidirectional */, + move(vehicleModelFactory), move(algorithm), move(directionsEngine))); return router; } @@ -271,10 +270,9 @@ unique_ptr CreatePedestrianAStarBidirectionalRouter(Index & index, TCou unique_ptr vehicleModelFactory(new PedestrianModelFactory()); unique_ptr algorithm(new AStarBidirectionalRoutingAlgorithm()); unique_ptr directionsEngine(new PedestrianDirectionsEngine()); - unique_ptr router(new RoadGraphRouter("astar-bidirectional-pedestrian", index, - countryFileFn, true /* onewayAsBidirectional */, - move(vehicleModelFactory), - move(algorithm), move(directionsEngine))); + unique_ptr router(new RoadGraphRouter( + "astar-bidirectional-pedestrian", index, countryFileFn, true /* onewayAsBidirectional */, + move(vehicleModelFactory), move(algorithm), move(directionsEngine))); return router; } @@ -283,9 +281,9 @@ unique_ptr CreateBicycleAStarBidirectionalRouter(Index & index, TCountr unique_ptr vehicleModelFactory(new BicycleModelFactory()); unique_ptr algorithm(new AStarBidirectionalRoutingAlgorithm()); unique_ptr directionsEngine(new BicycleDirectionsEngine(index)); - unique_ptr router(new RoadGraphRouter("astar-bidirectional-bicycle", index, countryFileFn, - false /* onewayAsBidirectional */, move(vehicleModelFactory), - move(algorithm), move(directionsEngine))); + unique_ptr 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 && vehicleModelFactory, unique_ptr && algorithm,