From b45b5c76194b70046ae5678627fd5fe64f9f83a3 Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 19 May 2016 16:32:52 +0300 Subject: [PATCH] git-clang-format --- indexer/ftypes_matcher.cpp | 25 +++++++++--------- routing/bicycle_directions.cpp | 9 ++++--- routing/osrm_router.cpp | 26 +++++++------------ routing/road_graph_router.cpp | 8 +++--- .../bicycle_turn_test.cpp | 4 +-- .../pedestrian_route_test.cpp | 4 +-- .../routing_test_tools.cpp | 18 ++++++------- routing/routing_result_graph.hpp | 3 +-- 8 files changed, 47 insertions(+), 50 deletions(-) diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp index d40060b40b..d47b009fc5 100644 --- a/indexer/ftypes_matcher.cpp +++ b/indexer/ftypes_matcher.cpp @@ -13,6 +13,7 @@ namespace class HighwayClasses { map m_map; + public: HighwayClasses() { @@ -61,19 +62,19 @@ char const * HighwayClassToString(ftypes::HighwayClass const cls) { switch (cls) { - case ftypes::HighwayClass::Undefined: return "Undefined"; - case ftypes::HighwayClass::Error: return "Error"; - case ftypes::HighwayClass::Trunk: return "Trunk"; - case ftypes::HighwayClass::Primary: return "Primary"; - case ftypes::HighwayClass::Secondary: return "Secondary"; - case ftypes::HighwayClass::Tertiary: return "Tertiary"; - case ftypes::HighwayClass::LivingStreet: return "LivingStreet"; - case ftypes::HighwayClass::Service: return "Service"; - case ftypes::HighwayClass::Pedestrian: return "Pedestrian"; - case ftypes::HighwayClass::Count: return "Count"; + case ftypes::HighwayClass::Undefined: return "Undefined"; + case ftypes::HighwayClass::Error: return "Error"; + case ftypes::HighwayClass::Trunk: return "Trunk"; + case ftypes::HighwayClass::Primary: return "Primary"; + case ftypes::HighwayClass::Secondary: return "Secondary"; + case ftypes::HighwayClass::Tertiary: return "Tertiary"; + case ftypes::HighwayClass::LivingStreet: return "LivingStreet"; + case ftypes::HighwayClass::Service: return "Service"; + case ftypes::HighwayClass::Pedestrian: return "Pedestrian"; + case ftypes::HighwayClass::Count: return "Count"; } } -} // namespace +} // namespace namespace ftypes { @@ -482,4 +483,4 @@ bool IsTypeConformed(uint32_t type, StringIL const & path) } return true; } -} // namespace ftypes +} // namespace ftypes diff --git a/routing/bicycle_directions.cpp b/routing/bicycle_directions.cpp index 31a05f3cea..c9d8f42596 100644 --- a/routing/bicycle_directions.cpp +++ b/routing/bicycle_directions.cpp @@ -18,7 +18,8 @@ using namespace routing::turns; class RoutingResultGraph : public IRoutingResult { public: - RoutingResultGraph(IRoadGraph::TEdgeVector const & routeEdges, TAdjacentEdgesMap const & adjacentEdges, + RoutingResultGraph(IRoadGraph::TEdgeVector const & routeEdges, + TAdjacentEdgesMap const & adjacentEdges, TUnpackedPathSegments const & pathSegments) : m_routeEdges(routeEdges) , m_adjacentEdges(adjacentEdges) @@ -150,7 +151,8 @@ void BicycleDirectionsEngine::Generate(IRoadGraph const & graph, vector const & path, +void BicycleDirectionsEngine::LoadPathGeometry(FeatureID const & featureId, + vector const & path, LoadedPathSegment & pathSegment) { pathSegment.Clear(); diff --git a/routing/osrm_router.cpp b/routing/osrm_router.cpp index 88aeee52dd..090a17efb6 100644 --- a/routing/osrm_router.cpp +++ b/routing/osrm_router.cpp @@ -60,12 +60,10 @@ class OSRMRoutingResult : public turns::IRoutingResult { public: // turns::IRoutingResult overrides: - TUnpackedPathSegments const & GetSegments() const override - { - return m_loadedSegments; - } - void GetPossibleTurns(TNodeId node, m2::PointD const & ingoingPoint, m2::PointD const & junctionPoint, - size_t & ingoingCount, turns::TurnCandidates & outgoingTurns) const override + TUnpackedPathSegments const & GetSegments() const override { return m_loadedSegments; } + void GetPossibleTurns(TNodeId node, m2::PointD const & ingoingPoint, + m2::PointD const & junctionPoint, size_t & ingoingCount, + turns::TurnCandidates & outgoingTurns) const override { double const kReadCrossEpsilon = 1.0E-4; @@ -145,22 +143,16 @@ public: sort(outgoingTurns.candidates.begin(), outgoingTurns.candidates.end(), [](turns::TurnCandidate const & t1, turns::TurnCandidate const & t2) - { - return t1.angle < t2.angle; - }); + { + return t1.angle < t2.angle; + }); } double GetPathLength() const override { return m_rawResult.shortestPathLength; } - m2::PointD const & GetStartPoint() const override - { - return m_rawResult.sourceEdge.segmentPoint; - } + m2::PointD const & GetStartPoint() const override { return m_rawResult.sourceEdge.segmentPoint; } - m2::PointD const & GetEndPoint() const override - { - return m_rawResult.targetEdge.segmentPoint; - } + m2::PointD const & GetEndPoint() const override { return m_rawResult.targetEdge.segmentPoint; } OSRMRoutingResult(Index const & index, RoutingMapping & mapping, RawRoutingResult & result) : m_rawResult(result), m_index(index), m_routingMapping(mapping) diff --git a/routing/road_graph_router.cpp b/routing/road_graph_router.cpp index 46719f87c0..0cab63e835 100644 --- a/routing/road_graph_router.cpp +++ b/routing/road_graph_router.cpp @@ -259,7 +259,8 @@ unique_ptr CreatePedestrianAStarRouter(Index & index, TCountryFileFn co unique_ptr algorithm(new AStarRoutingAlgorithm()); unique_ptr directionsEngine(new PedestrianDirectionsEngine()); unique_ptr router(new RoadGraphRouter("astar-pedestrian", index, countryFileFn, - move(vehicleModelFactory), move(algorithm), move(directionsEngine))); + move(vehicleModelFactory), move(algorithm), + move(directionsEngine))); return router; } @@ -268,8 +269,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, - move(vehicleModelFactory), move(algorithm), move(directionsEngine))); + unique_ptr router(new RoadGraphRouter("astar-bidirectional-pedestrian", index, + countryFileFn, move(vehicleModelFactory), + move(algorithm), move(directionsEngine))); return router; } diff --git a/routing/routing_integration_tests/bicycle_turn_test.cpp b/routing/routing_integration_tests/bicycle_turn_test.cpp index aeddcd3ace..f3906d80d4 100644 --- a/routing/routing_integration_tests/bicycle_turn_test.cpp +++ b/routing/routing_integration_tests/bicycle_turn_test.cpp @@ -58,8 +58,8 @@ UNIT_TEST(RussiaMoscowSalameiNerisPossibleTurnCorrectionBicycleWayTurnTest) UNIT_TEST(RussiaMoscowSevTushinoParkBicycleOnePointTurnTest) { m2::PointD const point = MercatorBounds::FromLatLon(55.8719, 37.4464); - TRouteResult const routeResult = integration::CalculateRoute( - integration::GetBicycleComponents(), point, {0.0, 0.0}, point); + TRouteResult const routeResult = + integration::CalculateRoute(integration::GetBicycleComponents(), point, {0.0, 0.0}, point); Route const & route = *routeResult.first; IRouter::ResultCode const result = routeResult.second; diff --git a/routing/routing_integration_tests/pedestrian_route_test.cpp b/routing/routing_integration_tests/pedestrian_route_test.cpp index 6107515e01..7beb0515cd 100644 --- a/routing/routing_integration_tests/pedestrian_route_test.cpp +++ b/routing/routing_integration_tests/pedestrian_route_test.cpp @@ -519,8 +519,8 @@ UNIT_TEST(MoscowChistiePrudiSelectPointsInConnectedGraph) UNIT_TEST(RussiaMoscowSevTushinoParkPedestrianOnePointTurnTest) { m2::PointD const point = MercatorBounds::FromLatLon(55.8719, 37.4464); - TRouteResult const routeResult = integration::CalculateRoute( - integration::GetPedestrianComponents(), point, {0.0, 0.0}, point); + TRouteResult const routeResult = + integration::CalculateRoute(integration::GetPedestrianComponents(), point, {0.0, 0.0}, point); Route const & route = *routeResult.first; IRouter::ResultCode const result = routeResult.second; diff --git a/routing/routing_integration_tests/routing_test_tools.cpp b/routing/routing_integration_tests/routing_test_tools.cpp index b224c525b4..56d7ba83aa 100644 --- a/routing/routing_integration_tests/routing_test_tools.cpp +++ b/routing/routing_integration_tests/routing_test_tools.cpp @@ -36,16 +36,16 @@ using TRouterFactory = namespace { - double kErrorMeters = 1.0; - double kErrorSeconds = 1.0; - void ChangeMaxNumberOfOpenFiles(size_t n) - { - struct rlimit rlp; - getrlimit(RLIMIT_NOFILE, &rlp); - rlp.rlim_cur = n; - setrlimit(RLIMIT_NOFILE, &rlp); - } +double kErrorMeters = 1.0; +double kErrorSeconds = 1.0; +void ChangeMaxNumberOfOpenFiles(size_t n) +{ + struct rlimit rlp; + getrlimit(RLIMIT_NOFILE, &rlp); + rlp.rlim_cur = n; + setrlimit(RLIMIT_NOFILE, &rlp); } +} // namespace namespace integration { diff --git a/routing/routing_result_graph.hpp b/routing/routing_result_graph.hpp index fe74b25702..07c482f80c 100644 --- a/routing/routing_result_graph.hpp +++ b/routing/routing_result_graph.hpp @@ -21,8 +21,7 @@ public: /// \brief For a |node|, |junctionPoint| and |ingoingPoint| (point before the |node|) /// this method computes number of ingoing ways to |junctionPoint| and fills |outgoingTurns|. virtual void GetPossibleTurns(TNodeId node, m2::PointD const & ingoingPoint, - m2::PointD const & junctionPoint, - size_t & ingoingCount, + m2::PointD const & junctionPoint, size_t & ingoingCount, TurnCandidates & outgoingTurns) const = 0; virtual double GetPathLength() const = 0; virtual m2::PointD const & GetStartPoint() const = 0;