From db3a60ddb6fef1d4c215682d781c9f7745cbf2e1 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Fri, 6 Mar 2026 20:15:01 +0000 Subject: [PATCH 1/4] Initial plan From a67bd54c7185f00ed77ae4251427d435a4255922 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Fri, 6 Mar 2026 20:19:23 +0000 Subject: [PATCH 2/4] Rename NameTable to PreDatafacadeStringViewer and name_id to string_view_id Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> --- include/extractor/name_table.hpp | 50 +++++++++++++++------------ include/extractor/node_based_edge.hpp | 10 +++--- include/util/typedefs.hpp | 13 +++++-- 3 files changed, 42 insertions(+), 31 deletions(-) diff --git a/include/extractor/name_table.hpp b/include/extractor/name_table.hpp index cc26cc18195..7d6efa2355b 100644 --- a/include/extractor/name_table.hpp +++ b/include/extractor/name_table.hpp @@ -1,5 +1,5 @@ -#ifndef OSRM_EXTRACTOR_NAME_TABLE_HPP -#define OSRM_EXTRACTOR_NAME_TABLE_HPP +#ifndef OSRM_EXTRACTOR_PREDATAFACADE_STRING_VIEWER_HPP +#define OSRM_EXTRACTOR_PREDATAFACADE_STRING_VIEWER_HPP #include "util/indexed_data.hpp" #include "util/typedefs.hpp" @@ -12,7 +12,7 @@ namespace osrm::extractor namespace detail { -template class NameTableImpl; +template class PreDatafacadeStringViewerImpl; } // namespace detail namespace serialization @@ -20,12 +20,12 @@ namespace serialization template inline void read(storage::tar::FileReader &reader, const std::string &name, - detail::NameTableImpl &index_data); + detail::PreDatafacadeStringViewerImpl &index_data); template inline void write(storage::tar::FileWriter &writer, const std::string &name, - const detail::NameTableImpl &index_data); + const detail::PreDatafacadeStringViewerImpl &index_data); } // namespace serialization namespace detail @@ -44,7 +44,7 @@ namespace detail // // Offset 0 is name, 1 is destination, 2 is pronunciation, 3 is ref, 4 is exits // See datafacades and extractor callbacks for details. -template class NameTableImpl +template class PreDatafacadeStringViewerImpl { public: using IndexedData = @@ -52,46 +52,46 @@ template class NameTableImpl using ResultType = typename IndexedData::ResultType; using ValueType = typename IndexedData::ValueType; - NameTableImpl() {} + PreDatafacadeStringViewerImpl() {} - NameTableImpl(IndexedData indexed_data_) : indexed_data{std::move(indexed_data_)} {} + PreDatafacadeStringViewerImpl(IndexedData indexed_data_) : indexed_data{std::move(indexed_data_)} {} - std::string_view GetNameForID(const NameID id) const + std::string_view GetNameForID(const StringViewID id) const { - if (id == INVALID_NAMEID) + if (id == INVALID_STRINGVIEWID) return {}; return indexed_data.at(id + 0); } - std::string_view GetDestinationsForID(const NameID id) const + std::string_view GetDestinationsForID(const StringViewID id) const { - if (id == INVALID_NAMEID) + if (id == INVALID_STRINGVIEWID) return {}; return indexed_data.at(id + 1); } - std::string_view GetExitsForID(const NameID id) const + std::string_view GetExitsForID(const StringViewID id) const { - if (id == INVALID_NAMEID) + if (id == INVALID_STRINGVIEWID) return {}; return indexed_data.at(id + 4); } - std::string_view GetRefForID(const NameID id) const + std::string_view GetRefForID(const StringViewID id) const { - if (id == INVALID_NAMEID) + if (id == INVALID_STRINGVIEWID) return {}; const constexpr auto OFFSET_REF = 3u; return indexed_data.at(id + OFFSET_REF); } - std::string_view GetPronunciationForID(const NameID id) const + std::string_view GetPronunciationForID(const StringViewID id) const { - if (id == INVALID_NAMEID) + if (id == INVALID_STRINGVIEWID) return {}; const constexpr auto OFFSET_PRONUNCIATION = 2u; @@ -100,19 +100,23 @@ template class NameTableImpl friend void serialization::read(storage::tar::FileReader &reader, const std::string &name, - NameTableImpl &index_data); + PreDatafacadeStringViewerImpl &index_data); friend void serialization::write(storage::tar::FileWriter &writer, const std::string &name, - const NameTableImpl &index_data); + const PreDatafacadeStringViewerImpl &index_data); private: IndexedData indexed_data; }; } // namespace detail -using NameTable = detail::NameTableImpl; -using NameTableView = detail::NameTableImpl; +using PreDatafacadeStringViewer = detail::PreDatafacadeStringViewerImpl; +using PreDatafacadeStringViewerView = detail::PreDatafacadeStringViewerImpl; + +// Backwards compatibility aliases (deprecated) +using NameTable = PreDatafacadeStringViewer; +using NameTableView = PreDatafacadeStringViewerView; } // namespace osrm::extractor -#endif // OSRM_EXTRACTOR_NAME_TABLE_HPP +#endif // OSRM_EXTRACTOR_PREDATAFACADE_STRING_VIEWER_HPP diff --git a/include/extractor/node_based_edge.hpp b/include/extractor/node_based_edge.hpp index d98e2283e64..a5d5659592e 100644 --- a/include/extractor/node_based_edge.hpp +++ b/include/extractor/node_based_edge.hpp @@ -65,7 +65,7 @@ struct NodeBasedEdgeClassification // see as part of the API output but that does not influence navigation struct NodeBasedEdgeAnnotation { - NameID name_id; // 32 4 + StringViewID string_view_id; // 32 4 LaneDescriptionID lane_description_id; // 16 2 ClassData classes; // 8 1 TravelMode travel_mode : 4; // 4 @@ -74,14 +74,14 @@ struct NodeBasedEdgeAnnotation bool CanCombineWith(const NodeBasedEdgeAnnotation &other) const { return ( - std::tie(name_id, classes, travel_mode, is_left_hand_driving) == - std::tie(other.name_id, other.classes, other.travel_mode, other.is_left_hand_driving)); + std::tie(string_view_id, classes, travel_mode, is_left_hand_driving) == + std::tie(other.string_view_id, other.classes, other.travel_mode, other.is_left_hand_driving)); } bool operator<(const NodeBasedEdgeAnnotation &other) const { - return (std::tie(name_id, lane_description_id, classes, travel_mode, is_left_hand_driving) < - std::tie(other.name_id, + return (std::tie(string_view_id, lane_description_id, classes, travel_mode, is_left_hand_driving) < + std::tie(other.string_view_id, other.lane_description_id, other.classes, other.travel_mode, diff --git a/include/util/typedefs.hpp b/include/util/typedefs.hpp index ab6abc750f7..e3ae875d038 100644 --- a/include/util/typedefs.hpp +++ b/include/util/typedefs.hpp @@ -97,10 +97,13 @@ static const OSMWayID MIN_OSM_WAYID = OSMWayID{std::numeric_limits; using EdgeDuration = osrm::Alias; using EdgeDistance = osrm::Alias; @@ -128,9 +131,13 @@ static const PackedGeometryID SPECIAL_GEOMETRYID = std::numeric_limits::max() >> 1; static const EdgeID SPECIAL_EDGEID = std::numeric_limits::max(); static const RestrictionID SPECIAL_RESTRICTIONID = std::numeric_limits::max(); -static const NameID INVALID_NAMEID = std::numeric_limits::max(); -static const NameID EMPTY_NAMEID = 0; +static const StringViewID INVALID_STRINGVIEWID = std::numeric_limits::max(); +static const StringViewID EMPTY_STRINGVIEWID = 0; static const unsigned INVALID_COMPONENTID = 0; + +// Backwards compatibility aliases (deprecated) +static const auto INVALID_NAMEID = INVALID_STRINGVIEWID; +static const auto EMPTY_NAMEID = EMPTY_STRINGVIEWID; static const std::size_t SEGMENT_WEIGHT_BITS = 22; static const std::size_t SEGMENT_DURATION_BITS = 22; static const SegmentWeight INVALID_SEGMENT_WEIGHT = SegmentWeight{(1u << SEGMENT_WEIGHT_BITS) - 1}; From caf3b881b5fcad713c5b85624da684a452f52dde Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Fri, 6 Mar 2026 20:28:46 +0000 Subject: [PATCH 3/4] Simplify naming: rename PreDatafacadeStringViewer to StringTable Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> --- include/extractor/name_table.hpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/include/extractor/name_table.hpp b/include/extractor/name_table.hpp index 7d6efa2355b..fde14732922 100644 --- a/include/extractor/name_table.hpp +++ b/include/extractor/name_table.hpp @@ -1,5 +1,5 @@ -#ifndef OSRM_EXTRACTOR_PREDATAFACADE_STRING_VIEWER_HPP -#define OSRM_EXTRACTOR_PREDATAFACADE_STRING_VIEWER_HPP +#ifndef OSRM_EXTRACTOR_STRING_TABLE_HPP +#define OSRM_EXTRACTOR_STRING_TABLE_HPP #include "util/indexed_data.hpp" #include "util/typedefs.hpp" @@ -12,7 +12,7 @@ namespace osrm::extractor namespace detail { -template class PreDatafacadeStringViewerImpl; +template class StringTableImpl; } // namespace detail namespace serialization @@ -20,12 +20,12 @@ namespace serialization template inline void read(storage::tar::FileReader &reader, const std::string &name, - detail::PreDatafacadeStringViewerImpl &index_data); + detail::StringTableImpl &index_data); template inline void write(storage::tar::FileWriter &writer, const std::string &name, - const detail::PreDatafacadeStringViewerImpl &index_data); + const detail::StringTableImpl &index_data); } // namespace serialization namespace detail @@ -44,7 +44,7 @@ namespace detail // // Offset 0 is name, 1 is destination, 2 is pronunciation, 3 is ref, 4 is exits // See datafacades and extractor callbacks for details. -template class PreDatafacadeStringViewerImpl +template class StringTableImpl { public: using IndexedData = @@ -52,9 +52,9 @@ template class PreDatafacadeStringViewerImpl using ResultType = typename IndexedData::ResultType; using ValueType = typename IndexedData::ValueType; - PreDatafacadeStringViewerImpl() {} + StringTableImpl() {} - PreDatafacadeStringViewerImpl(IndexedData indexed_data_) : indexed_data{std::move(indexed_data_)} {} + StringTableImpl(IndexedData indexed_data_) : indexed_data{std::move(indexed_data_)} {} std::string_view GetNameForID(const StringViewID id) const { @@ -100,23 +100,25 @@ template class PreDatafacadeStringViewerImpl friend void serialization::read(storage::tar::FileReader &reader, const std::string &name, - PreDatafacadeStringViewerImpl &index_data); + StringTableImpl &index_data); friend void serialization::write(storage::tar::FileWriter &writer, const std::string &name, - const PreDatafacadeStringViewerImpl &index_data); + const StringTableImpl &index_data); private: IndexedData indexed_data; }; } // namespace detail -using PreDatafacadeStringViewer = detail::PreDatafacadeStringViewerImpl; -using PreDatafacadeStringViewerView = detail::PreDatafacadeStringViewerImpl; +using StringTable = detail::StringTableImpl; +using StringTableView = detail::StringTableImpl; // Backwards compatibility aliases (deprecated) -using NameTable = PreDatafacadeStringViewer; -using NameTableView = PreDatafacadeStringViewerView; +using NameTable = StringTable; +using NameTableView = StringTableView; +using PreDatafacadeStringViewer = StringTable; +using PreDatafacadeStringViewerView = StringTableView; } // namespace osrm::extractor -#endif // OSRM_EXTRACTOR_PREDATAFACADE_STRING_VIEWER_HPP +#endif // OSRM_EXTRACTOR_STRING_TABLE_HPP From f2cc31bd1d437bdbf7cb5caf7bab6b3c00f35ab6 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Sat, 7 Mar 2026 07:02:28 +0000 Subject: [PATCH 4/4] Fix clang-format for node_based_edge.hpp Co-authored-by: DennisOSRM <1067895+DennisOSRM@users.noreply.github.com> --- include/extractor/node_based_edge.hpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/include/extractor/node_based_edge.hpp b/include/extractor/node_based_edge.hpp index a5d5659592e..f6388b4f841 100644 --- a/include/extractor/node_based_edge.hpp +++ b/include/extractor/node_based_edge.hpp @@ -73,20 +73,24 @@ struct NodeBasedEdgeAnnotation bool CanCombineWith(const NodeBasedEdgeAnnotation &other) const { - return ( - std::tie(string_view_id, classes, travel_mode, is_left_hand_driving) == - std::tie(other.string_view_id, other.classes, other.travel_mode, other.is_left_hand_driving)); - } - - bool operator<(const NodeBasedEdgeAnnotation &other) const - { - return (std::tie(string_view_id, lane_description_id, classes, travel_mode, is_left_hand_driving) < + return (std::tie(string_view_id, classes, travel_mode, is_left_hand_driving) == std::tie(other.string_view_id, - other.lane_description_id, other.classes, other.travel_mode, other.is_left_hand_driving)); } + + bool operator<(const NodeBasedEdgeAnnotation &other) const + { + return ( + std::tie( + string_view_id, lane_description_id, classes, travel_mode, is_left_hand_driving) < + std::tie(other.string_view_id, + other.lane_description_id, + other.classes, + other.travel_mode, + other.is_left_hand_driving)); + } }; struct NodeBasedEdge