feat: unify turn_penalties_index dump same with turn_weight_penalties and turn_duration_penalties

This commit is contained in:
Jay Zhang
2020-10-23 09:38:56 +00:00
parent 1ba8aba466
commit 7d28b7aa3a
3 changed files with 28 additions and 35 deletions
+21
View File
@@ -399,6 +399,27 @@ inline void readTurnDurationPenalty(const boost::filesystem::path &path, TurnPen
storage::serialization::read(reader, "/common/turn_penalty/duration", turn_penalty);
}
// writes .osrm.turn_penalties_index
template <typename TurnIndexT>
inline void writeTurnPenaltiesIndex(const boost::filesystem::path &path,
const TurnIndexT &turn_penalties_index)
{
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
storage::tar::FileWriter writer{path, fingerprint};
storage::serialization::write(writer, "/extractor/turn_index", turn_penalties_index);
}
// read .osrm.turn_penalties_index
template <typename TurnIndexT>
inline void readTurnPenaltiesIndex(const boost::filesystem::path &path, TurnIndexT &turn_penalties_index)
{
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
storage::tar::FileReader reader{path, fingerprint};
storage::serialization::read(reader, "/extractor/turn_index", turn_penalties_index);
}
// writes .osrm.restrictions
template <typename ConditionalRestrictionsT>
inline void writeConditionalRestrictions(const boost::filesystem::path &path,