Make edge metrics strongly typed (#6421)
This change takes the existing typedefs for weight, duration and distance, and makes them proper types, using the existing Alias functionality. Primarily this is to prevent bugs where the metrics are switched, but it also adds additional documentation. For example, it now makes it clear (despite the naming of variables) that most of the trip algorithm is running on the duration metric. I've not made any changes to the casts performed between metrics and numeric types, they now just more explicit.
This commit is contained in:
@@ -47,11 +47,11 @@ class MockBaseDataFacade : public engine::datafacade::BaseDataFacade
|
||||
}
|
||||
TurnPenalty GetWeightPenaltyForEdgeID(const unsigned /* id */) const override final
|
||||
{
|
||||
return 0;
|
||||
return {0};
|
||||
}
|
||||
TurnPenalty GetDurationPenaltyForEdgeID(const unsigned /* id */) const override final
|
||||
{
|
||||
return 0;
|
||||
return {0};
|
||||
}
|
||||
std::string GetTimestamp() const override { return ""; }
|
||||
NodeForwardRange GetUncompressedForwardGeometry(const EdgeID /* id */) const override
|
||||
|
||||
Reference in New Issue
Block a user