osrm-backend/include
Michael Bell 7f014bd616 Clarify identifier types used in data facade
The data facade interface contains numerous methods for looking up
datapoints by identifiers.
Many of the parameters use the NodeID or EdgeID types. However, these two
identifier types are used for representing three different contexts:

1. Node-based graph edges and nodes
2. Edge-based graph edges and nodes
3. Packed geometries

Consider the use of identifier parameters in these examples:

---

GetWeightPenaltyForEdgeID(const EdgeID id)  <- edge-based edge

GetUncompressedForwardWeights(const EdgeID id) <- packed geometry

IsLeftHandDriving(const NodeID id) <- edge-based node

GetBearingClass(const NodeID node) <- node-based node

---

This mixing of contexts within the same interface makes it
difficult to understand the relationships and dependencies between
the OSRM datasets.

For 1. and 2. we continue to use the NodeID and EdgeID types, but
change the interface parameter names to identify them as
edge-based or node-based graph properties.

For 3. we define a new type definition, PackedGeometryID.

These changes are to aid with readability. A next step would be
to strongly type these definitions, leveraging the Alias template
already used for OSM identifiers.
2022-08-21 21:37:39 +02:00
..
contractor Configure Undefined Behaviour Sanitizer (#6290) 2022-08-01 22:40:26 +01:00
customizer Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
engine Clarify identifier types used in data facade 2022-08-21 21:37:39 +02:00
extractor Fix distance calculation consistency. (#6315) 2022-08-19 22:31:40 +01:00
guidance Enable even more clang-tidy checks (#6273) 2022-07-04 21:46:59 +01:00
nodejs Validate source/destination indices correctly in nodejs support (#5595) 2021-01-28 06:02:01 -08:00
osrm Undo libosrm API break by adding old interface as method overload (#5861) 2021-01-27 09:14:44 -08:00
partitioner Enable even more clang-tidy checks (#6273) 2022-07-04 21:46:59 +01:00
server Use Boost.Beast to parse HTTP request (#6294) 2022-08-02 21:12:05 +01:00
storage Enable even more clang-tidy checks (#6273) 2022-07-04 21:46:59 +01:00
updater Upgrade formatting to clang-format 10 (#5895) 2020-11-26 07:21:39 -08:00
util Clarify identifier types used in data facade 2022-08-21 21:37:39 +02:00