Use nested namespace

It's a mechanical change to modernize the code base
This commit is contained in:
Dennis Luxen
2022-12-11 10:10:26 +01:00
parent 152a52bc1a
commit a4aa153ba4
456 changed files with 469 additions and 2474 deletions
+1 -4
View File
@@ -3,9 +3,7 @@
#include "extractor/intersection/constants.hpp"
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// what angle is interpreted as going straight
@@ -30,7 +28,6 @@ const double constexpr INCREASES_BY_FOURTY_PERCENT = 1.4;
const int constexpr MAX_SLIPROAD_THRESHOLD = 250;
} // namespace guidance
} // namespace osrm
#endif // OSRM_GUIDANCE_CONSTANTS_HPP_
+1 -4
View File
@@ -3,9 +3,7 @@
#include "guidance/intersection_handler.hpp"
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// Intersection handlers deal with all issues related to intersections.
@@ -35,7 +33,6 @@ class DrivewayHandler final : public IntersectionHandler
Intersection intersection) const override final;
};
} // namespace guidance
} // namespace osrm
#endif /* OSRM_GUIDANCE_DRIVEWAY_HANDLER_HPP */
+1 -7
View File
@@ -10,11 +10,7 @@
#include <boost/assert.hpp>
namespace osrm
{
namespace guidance
{
namespace files
namespace osrm::guidance::files
{
// reads .osrm.edges
@@ -51,8 +47,6 @@ inline void writeTurnData(const boost::filesystem::path &path,
writer.WriteFrom("/common/connectivity_checksum", connectivity_checksum);
serialization::write(writer, "/common/turn_data", turn_data);
}
} // namespace files
} // namespace guidance
} // namespace osrm
#endif
+1 -4
View File
@@ -19,9 +19,7 @@
#include <unordered_set>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
using BearingClassesVector = std::vector<BearingClassID>;
using BearingClassesMap = util::ConcurrentIDMap<util::guidance::BearingClass, BearingClassID>;
@@ -45,7 +43,6 @@ void annotateTurns(const util::NodeBasedDynamicGraph &node_based_graph,
EntryClassesMap &entry_class_hash,
std::uint32_t &connectivity_checksum);
} // namespace guidance
} // namespace osrm
#endif
+1 -4
View File
@@ -4,9 +4,7 @@
#include "extractor/intersection/intersection_view.hpp"
#include "guidance/turn_instruction.hpp"
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// A Connected Road is the internal representation of a potential turn. Internally, we require
@@ -122,7 +120,6 @@ inline std::string toString(const ConnectedRoad &road)
return result;
}
} // namespace guidance
} // namespace osrm
#endif /* OSRM_GUIDANCE_INTERSECTION_HPP_*/
+1 -4
View File
@@ -20,9 +20,7 @@
#include <boost/optional.hpp>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// Intersection handlers deal with all issues related to intersections.
@@ -660,7 +658,6 @@ std::size_t IntersectionHandler::findObviousTurn(const EdgeID via_edge,
return 0;
}
} // namespace guidance
} // namespace osrm
#endif /*OSRM_GUIDANCE_INTERSECTION_HANDLER_HPP_*/
+1 -4
View File
@@ -12,9 +12,7 @@
#include "util/guidance/name_announcements.hpp"
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
template <typename IntersectionType>
@@ -60,7 +58,6 @@ inline bool isThroughStreet(const std::size_t index,
return false;
}
} // namespace guidance
} // namespace osrm
#endif /*OSRM_GUIDANCE_IS_THROUGH_STREET_HPP_*/
+1 -4
View File
@@ -12,9 +12,7 @@
#include <vector>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// Intersection handlers deal with all issues related to intersections.
@@ -58,7 +56,6 @@ class MotorwayHandler final : public IntersectionHandler
Intersection fallback(Intersection intersection) const;
};
} // namespace guidance
} // namespace osrm
#endif /*OSRM_GUIDANCE_MOTORWAY_HANDLER_HPP_*/
+1 -7
View File
@@ -9,11 +9,7 @@
#include "util/attributes.hpp"
namespace osrm
{
namespace extractor
{
namespace guidance
namespace osrm::extractor::guidance
{
// Public service vehicle lanes and similar can introduce additional lanes into the lane string that
@@ -105,8 +101,6 @@ inline std::string applyAccessTokens(std::string lane_string, const std::string
return result_string;
}
} // namespace guidance
} // namespace extractor
} // namespace osrm
#endif // OSRM_GUIDANCE_PARSING_TOOLKIT_HPP_
+1 -4
View File
@@ -17,9 +17,7 @@
#include <unordered_set>
#include <vector>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
namespace detail
@@ -84,7 +82,6 @@ class RoundaboutHandler final : public IntersectionHandler
const extractor::intersection::CoordinateExtractor coordinate_extractor;
};
} // namespace guidance
} // namespace osrm
#endif /*OSRM_GUIDANCE_ROUNDABOUT_HANDLER_HPP_*/
+1 -4
View File
@@ -1,9 +1,7 @@
#ifndef OSRM_GUIDANCE_ROUNDABOUT_TYPES_HPP_
#define OSRM_GUIDANCE_ROUNDABOUT_TYPES_HPP_
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
enum class RoundaboutType
{
@@ -12,7 +10,6 @@ enum class RoundaboutType
Rotary, // traffic circle (large roundabout) with dedicated name
RoundaboutIntersection // small roundabout with distinct turns, handled as intersection
};
} /* namespace guidance */
} /* namespace osrm */
#endif /* OSRM_EXTRACTOR_GUIDANCE_ROUNDABOUT_TYPES_HPP_ */
+1 -7
View File
@@ -8,11 +8,7 @@
#include <boost/assert.hpp>
namespace osrm
{
namespace guidance
{
namespace serialization
namespace osrm::guidance::serialization
{
// read/write for turn data file
@@ -49,8 +45,6 @@ inline void write(storage::tar::FileWriter &writer,
storage::serialization::write(
writer, name + "/post_turn_bearings", turn_data_container.post_turn_bearings);
}
} // namespace serialization
} // namespace guidance
} // namespace osrm
#endif
+1 -4
View File
@@ -13,9 +13,7 @@
#include <boost/optional.hpp>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// Intersection handlers deal with all issues related to intersections.
@@ -81,7 +79,6 @@ class SliproadHandler final : public IntersectionHandler
const extractor::intersection::CoordinateExtractor coordinate_extractor;
};
} // namespace guidance
} // namespace osrm
#endif /*OSRM_GUIDANCE_SLIPROAD_HANDLER_HPP_*/
+1 -4
View File
@@ -15,9 +15,7 @@
#include <cstdint>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// Unconditionally runs over all intersections and gathers statistics for
@@ -107,7 +105,6 @@ class StatisticsHandler final : public IntersectionHandler
mutable std::map<DirectionModifier::Enum, std::uint64_t> modifier_hist;
};
} // namespace guidance
} // namespace osrm
#endif // OSRM_GUIDANCE_VALIDATION_HANDLER_HPP_
+1 -4
View File
@@ -8,9 +8,7 @@
#include "util/node_based_graph.hpp"
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// Suppresses instructions for certain modes.
@@ -40,7 +38,6 @@ class SuppressModeHandler final : public IntersectionHandler
Intersection intersection) const override final;
};
} // namespace guidance
} // namespace osrm
#endif /* OSRM_GUIDANCE_SUPPRESS_MODE_HANDLER_HPP_ */
+1 -4
View File
@@ -29,9 +29,7 @@
#include <utility>
#include <vector>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
class TurnAnalysis
@@ -75,7 +73,6 @@ class TurnAnalysis
setTurnTypes(const NodeID from, const EdgeID via_edge, Intersection intersection) const;
}; // class TurnAnalysis
} // namespace guidance
} // namespace osrm
#endif // OSRM_GUIDANCE_TURN_ANALYSIS
+1 -4
View File
@@ -5,9 +5,7 @@
#include <boost/assert.hpp>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
#pragma pack(push, 1)
@@ -29,7 +27,6 @@ class TurnBearing
};
#pragma pack(pop)
} // namespace guidance
} // namespace osrm
#endif /* OSRM_INCLUDE_GUIDANCE_TURN_BEARING_HPP_ */
+1 -4
View File
@@ -9,15 +9,12 @@
#include <utility>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
std::pair<util::guidance::EntryClass, util::guidance::BearingClass>
classifyIntersection(Intersection intersection, const osrm::util::Coordinate &location);
} // namespace guidance
} // namespace osrm
#endif // OSRM_GUIDANCE_TURN_CLASSIFICATION_HPP_
+1 -4
View File
@@ -12,9 +12,7 @@
#include "util/typedefs.hpp"
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
namespace detail
{
@@ -116,7 +114,6 @@ template <storage::Ownership Ownership> class TurnDataContainerImpl
using TurnDataExternalContainer = detail::TurnDataContainerImpl<storage::Ownership::External>;
using TurnDataContainer = detail::TurnDataContainerImpl<storage::Ownership::Container>;
using TurnDataView = detail::TurnDataContainerImpl<storage::Ownership::View>;
} // namespace guidance
} // namespace osrm
#endif
+1 -5
View File
@@ -20,10 +20,7 @@ namespace extractor
class CompressedEdgeContainer;
}
namespace guidance
{
namespace lanes
namespace guidance::lanes
{
// OSRM processes edges by looking at a via_edge, coming into an intersection. For turn lanes, we
@@ -45,7 +42,6 @@ bool findPreviousIntersection(
EdgeID &result_via_edge,
extractor::intersection::IntersectionView &result_intersection);
} // namespace lanes
} // namespace guidance
} // namespace osrm
+1 -4
View File
@@ -17,9 +17,7 @@
#include <utility>
#include <vector>
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// Intersection handlers deal with all issues related to intersections.
@@ -111,7 +109,6 @@ class TurnHandler final : public IntersectionHandler
const std::size_t up_to) const;
};
} // namespace guidance
} // namespace osrm
#endif /*OSRM_GUIDANCE_TURN_HANDLER_HPP_*/
+1 -4
View File
@@ -8,9 +8,7 @@
#include "util/attributes.hpp"
#include "util/typedefs.hpp"
namespace osrm
{
namespace guidance
namespace osrm::guidance
{
// direction modifiers based on angle
@@ -393,7 +391,6 @@ inline std::string instructionModifierToString(const DirectionModifier::Enum mod
return detail::modifier_names[static_cast<std::size_t>(modifier)];
}
} // namespace guidance
} // namespace osrm
#endif // OSRM_GUIDANCE_TURN_INSTRUCTION_HPP_
+1 -7
View File
@@ -5,19 +5,13 @@
#include "guidance/turn_lane_data.hpp"
#include "util/attributes.hpp"
namespace osrm
{
namespace guidance
{
namespace lanes
namespace osrm::guidance::lanes
{
OSRM_ATTR_WARN_UNUSED
LaneDataVector handleNoneValueAtSimpleTurn(LaneDataVector lane_data,
const Intersection &intersection);
} // namespace lanes
} // namespace guidance
} // namespace osrm
#endif /* OSRM_GUIDANCE_TURN_LANE_AUGMENTATION_HPP_ */
+1 -8
View File
@@ -6,11 +6,7 @@
#include "util/typedefs.hpp"
#include <vector>
namespace osrm
{
namespace guidance
{
namespace lanes
namespace osrm::guidance::lanes
{
struct TurnLaneData
@@ -37,9 +33,6 @@ LaneDataVector::iterator findTag(const extractor::TurnLaneType::Mask tag, LaneDa
// Returns true if any of the queried tags is contained
bool hasTag(const extractor::TurnLaneType::Mask tag, const LaneDataVector &data);
} // namespace lanes
} // namespace guidance
} // namespace osrm
#endif /* OSRM_GUIDANCE_TURN_LANE_DATA_HPP_ */
+1 -10
View File
@@ -22,14 +22,7 @@
#include <utility>
#include <vector>
namespace osrm
{
namespace guidance
{
// Given an Intersection, the graph to access the data and the turn lanes, the turn lane matcher
// assigns appropriate turn tupels to the different turns.
namespace lanes
namespace osrm::guidance::lanes
{
namespace
@@ -140,8 +133,6 @@ class TurnLaneHandler
LaneDataVector &lane_data) const;
};
} // namespace lanes
} // namespace guidance
} // namespace osrm
#endif // OSRM_EXTRACTOR_GUIDANCE_TURN_LANE_HANDLER_HPP_
+1 -7
View File
@@ -9,11 +9,7 @@
#include "util/guidance/turn_lanes.hpp"
#include "util/node_based_graph.hpp"
namespace osrm
{
namespace guidance
{
namespace lanes
namespace osrm::guidance::lanes
{
// Translate Turn Lane Tags into a matching modifier
@@ -45,8 +41,6 @@ Intersection triviallyMatchLanesToTurns(Intersection intersection,
const LaneDescriptionID lane_string_id,
util::guidance::LaneDataIdMap &lane_data_to_id);
} // namespace lanes
} // namespace guidance
} // namespace osrm
#endif /*OSRM_GUIDANCE_TURN_LANE_MATCHER_HPP_*/