Use nested namespace
It's a mechanical change to modernize the code base
This commit is contained in:
@@ -21,13 +21,7 @@
|
||||
|
||||
using TurnInstruction = osrm::guidance::TurnInstruction;
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace api
|
||||
{
|
||||
namespace json
|
||||
namespace osrm::engine::api::json
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
@@ -294,7 +288,4 @@ util::json::Array makeRouteLegs(std::vector<guidance::RouteLeg> legs,
|
||||
}
|
||||
return json_legs;
|
||||
}
|
||||
} // namespace json
|
||||
} // namespace api
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
|
||||
MMapMemoryAllocator::MMapMemoryAllocator(const storage::StorageConfig &config)
|
||||
@@ -67,6 +63,4 @@ MMapMemoryAllocator::~MMapMemoryAllocator() {}
|
||||
|
||||
const storage::SharedDataIndex &MMapMemoryAllocator::GetIndex() { return index; }
|
||||
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -3,11 +3,7 @@
|
||||
|
||||
#include "boost/assert.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
|
||||
ProcessMemoryAllocator::ProcessMemoryAllocator(const storage::StorageConfig &config)
|
||||
@@ -38,6 +34,4 @@ ProcessMemoryAllocator::~ProcessMemoryAllocator() {}
|
||||
|
||||
const storage::SharedDataIndex &ProcessMemoryAllocator::GetIndex() { return index; }
|
||||
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -6,11 +6,7 @@
|
||||
|
||||
#include "boost/assert.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace datafacade
|
||||
namespace osrm::engine::datafacade
|
||||
{
|
||||
|
||||
SharedMemoryAllocator::SharedMemoryAllocator(
|
||||
@@ -41,6 +37,4 @@ SharedMemoryAllocator::~SharedMemoryAllocator() {}
|
||||
|
||||
const storage::SharedDataIndex &SharedMemoryAllocator::GetIndex() { return index; }
|
||||
|
||||
} // namespace datafacade
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
#include <stack>
|
||||
#include <utility>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
// Normed to the thresholds table
|
||||
@@ -119,5 +117,4 @@ std::vector<util::Coordinate> douglasPeucker(std::vector<util::Coordinate>::cons
|
||||
|
||||
return simplified_geometry;
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "engine/engine_config.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
bool EngineConfig::IsValid() const
|
||||
@@ -27,5 +25,4 @@ bool EngineConfig::IsValid() const
|
||||
storage_config.IsValid()) &&
|
||||
limits_valid;
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::engine::guidance
|
||||
{
|
||||
namespace
|
||||
{
|
||||
@@ -90,6 +86,4 @@ std::vector<util::Coordinate> assembleOverview(const std::vector<LegGeometry> &l
|
||||
return overview_geometry;
|
||||
}
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
|
||||
#include <numeric>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::engine::guidance
|
||||
{
|
||||
|
||||
Route assembleRoute(const std::vector<RouteLeg> &route_legs)
|
||||
@@ -27,6 +23,4 @@ Route assembleRoute(const std::vector<RouteLeg> &route_legs)
|
||||
return Route{distance, duration, weight};
|
||||
}
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -8,13 +8,7 @@
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
{
|
||||
namespace detail
|
||||
namespace osrm::engine::guidance::detail
|
||||
{
|
||||
|
||||
std::pair<short, short> getDepartBearings(const LegGeometry &leg_geometry,
|
||||
@@ -50,7 +44,4 @@ std::pair<short, short> getArriveBearings(const LegGeometry &leg_geometry,
|
||||
return std::make_pair<short, short>(
|
||||
std::round(util::coordinate_calculation::bearing(pre_turn_coordinate, turn_coordinate)), 0);
|
||||
}
|
||||
} // namespace detail
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -6,11 +6,7 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::engine::guidance
|
||||
{
|
||||
using namespace osrm::guidance;
|
||||
|
||||
@@ -419,6 +415,4 @@ bool straightTurnFollowedByChoiceless(const RouteStepIterator step_entering_inte
|
||||
noIntermediaryIntersections(*step_entering_intersection);
|
||||
}
|
||||
|
||||
} /* namespace guidance */
|
||||
} /* namespace engine */
|
||||
} /* namespace osrm */
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::engine::guidance
|
||||
{
|
||||
using osrm::util::angularDeviation;
|
||||
using namespace osrm::guidance;
|
||||
@@ -667,6 +663,4 @@ RouteSteps collapseSegregatedTurnInstructions(RouteSteps steps)
|
||||
return steps;
|
||||
}
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::engine::guidance
|
||||
{
|
||||
using namespace osrm::guidance;
|
||||
|
||||
@@ -209,6 +205,4 @@ std::vector<RouteStep> anticipateLaneChange(std::vector<RouteStep> steps,
|
||||
return steps;
|
||||
}
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -21,11 +21,7 @@
|
||||
#include <limits>
|
||||
#include <utility>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::engine::guidance
|
||||
{
|
||||
using namespace osrm::guidance;
|
||||
|
||||
@@ -718,6 +714,4 @@ void applyOverrides(const datafacade::BaseDataFacade &facade,
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <iterator>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace guidance
|
||||
namespace osrm::engine::guidance
|
||||
{
|
||||
using namespace osrm::guidance;
|
||||
|
||||
@@ -85,6 +81,4 @@ std::vector<RouteStep> suppressShortNameSegments(std::vector<RouteStep> steps)
|
||||
return removeNoTurnInstructions(std::move(steps));
|
||||
}
|
||||
|
||||
} // namespace guidance
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
+1
-4
@@ -9,9 +9,7 @@
|
||||
#include <tuple>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
bool SegmentHint::IsValid(const util::Coordinate new_input_coordinates,
|
||||
@@ -124,5 +122,4 @@ bool Hint::IsValid(const util::Coordinate new_input_coordinates,
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -16,11 +16,7 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace plugins
|
||||
namespace osrm::engine::plugins
|
||||
{
|
||||
|
||||
// Filters PhantomNodes to obtain a set of viable candidates
|
||||
@@ -314,6 +310,4 @@ Status MatchPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -7,11 +7,7 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/numeric/conversion/cast.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace plugins
|
||||
namespace osrm::engine::plugins
|
||||
{
|
||||
|
||||
NearestPlugin::NearestPlugin(const int max_results_) : max_results{max_results_} {}
|
||||
@@ -57,6 +53,4 @@ Status NearestPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -11,11 +11,7 @@
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace plugins
|
||||
namespace osrm::engine::plugins
|
||||
{
|
||||
|
||||
TablePlugin::TablePlugin(const int max_locations_distance_table)
|
||||
@@ -157,6 +153,4 @@ Status TablePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -26,11 +26,7 @@
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace plugins
|
||||
namespace osrm::engine::plugins
|
||||
{
|
||||
|
||||
constexpr const static int MIN_ZOOM_FOR_TURNS = 15;
|
||||
@@ -695,6 +691,4 @@ Status TilePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -13,11 +13,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace plugins
|
||||
namespace osrm::engine::plugins
|
||||
{
|
||||
|
||||
bool IsStronglyConnectedComponent(const util::DistTableWrapper<EdgeDuration> &result_table)
|
||||
@@ -297,6 +293,4 @@ Status TripPlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithms,
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace plugins
|
||||
namespace osrm::engine::plugins
|
||||
{
|
||||
|
||||
ViaRoutePlugin::ViaRoutePlugin(int max_locations_viaroute, int max_alternatives)
|
||||
@@ -186,6 +182,4 @@ Status ViaRoutePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithm
|
||||
|
||||
return Status::Ok;
|
||||
}
|
||||
} // namespace plugins
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -7,11 +7,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace detail // anonymous to keep TU local
|
||||
namespace osrm::engine::detail // anonymous to keep TU local
|
||||
{
|
||||
|
||||
std::string encode(int number_to_encode)
|
||||
@@ -75,6 +71,4 @@ std::int32_t decode_polyline_integer(std::string::const_iterator &first,
|
||||
result = ((result & 1) == 1) ? ~(result >> 1) : (result >> 1);
|
||||
return static_cast<std::int32_t>(result);
|
||||
}
|
||||
} // namespace detail
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -11,11 +11,7 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
// Unqualified calls below are from the ch namespace.
|
||||
@@ -854,6 +850,4 @@ InternalManyRoutesResult alternativePathSearch(SearchEngineData<Algorithm> &engi
|
||||
return InternalManyRoutesResult{{std::move(primary_route), std::move(secondary_route)}};
|
||||
}
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -15,11 +15,7 @@
|
||||
|
||||
#include <boost/iterator/function_output_iterator.hpp>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
// Unqualified calls below are from the mld namespace.
|
||||
@@ -960,6 +956,4 @@ InternalManyRoutesResult alternativePathSearch(SearchEngineData<Algorithm> &sear
|
||||
return InternalManyRoutesResult{std::move(routes)};
|
||||
}
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -3,11 +3,7 @@
|
||||
#include "engine/routing_algorithms/routing_base_ch.hpp"
|
||||
#include "engine/routing_algorithms/routing_base_mld.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
/// This is a stripped down version of the general shortest path algorithm.
|
||||
@@ -91,6 +87,4 @@ InternalRouteResult directShortestPathSearch(SearchEngineData<mld::Algorithm> &e
|
||||
return extractRoute(facade, weight, endpoint_candidates, unpacked_nodes, unpacked_edges);
|
||||
}
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -8,11 +8,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
namespace ch
|
||||
@@ -251,6 +247,4 @@ manyToManySearch(SearchEngineData<ch::Algorithm> &engine_working_data,
|
||||
return std::make_pair(std::move(durations_table), std::move(distances_table));
|
||||
}
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
namespace mld
|
||||
@@ -676,6 +672,4 @@ manyToManySearch(SearchEngineData<mld::Algorithm> &engine_working_data,
|
||||
calculate_distance);
|
||||
}
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -17,11 +17,7 @@
|
||||
#include <numeric>
|
||||
#include <utility>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
namespace
|
||||
@@ -457,8 +453,6 @@ mapMatching(SearchEngineData<mld::Algorithm> &engine_working_data,
|
||||
const std::vector<boost::optional<double>> &trace_gps_precision,
|
||||
const bool allow_splitting);
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
//[1] "Hidden Markov Map Matching Through Noise and Sparseness"; P. Newson and J. Krumm; 2009; ACM
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#include "engine/routing_algorithms/routing_base.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
bool requiresForwardLoop(const PhantomNode &source, const PhantomNode &target)
|
||||
@@ -107,6 +103,4 @@ PhantomEndpoints endpointsFromCandidates(const PhantomEndpointCandidates &candid
|
||||
return PhantomEndpoints{*source_it, *target_it};
|
||||
}
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
#include "engine/routing_algorithms/routing_base_ch.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
{
|
||||
namespace ch
|
||||
namespace osrm::engine::routing_algorithms::ch
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -208,8 +202,4 @@ double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
|
||||
|
||||
return getPathDistance(facade, unpacked_path, source_phantom, target_phantom);
|
||||
}
|
||||
} // namespace ch
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
#include "engine/routing_algorithms/routing_base_mld.hpp"
|
||||
#include "engine/routing_algorithms/shortest_path_impl.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
template InternalRouteResult
|
||||
@@ -21,6 +17,4 @@ shortestPathSearch(SearchEngineData<mld::Algorithm> &engine_working_data,
|
||||
const std::vector<PhantomNodeCandidates> &waypoint_candidates,
|
||||
const boost::optional<bool> continue_straight_at_waypoint);
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#include "engine/routing_algorithms/tile_turns.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
{
|
||||
namespace routing_algorithms
|
||||
namespace osrm::engine::routing_algorithms
|
||||
{
|
||||
|
||||
namespace
|
||||
@@ -269,6 +265,4 @@ std::vector<TurnData> getTileTurns(const DataFacade<mld::Algorithm> &facade,
|
||||
return generateTurns(facade, edges, sorted_edge_indexes, edge_finder);
|
||||
}
|
||||
|
||||
} // namespace routing_algorithms
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "engine/search_engine_data.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace engine
|
||||
namespace osrm::engine
|
||||
{
|
||||
|
||||
// CH heaps
|
||||
@@ -130,5 +128,4 @@ void SearchEngineData<MLD>::InitializeOrClearManyToManyThreadLocalStorage(
|
||||
many_to_many_heap.reset(new ManyToManyQueryHeap(number_of_nodes, number_of_boundary_nodes));
|
||||
}
|
||||
}
|
||||
} // namespace engine
|
||||
} // namespace osrm
|
||||
|
||||
Reference in New Issue
Block a user