| 15 | // reads .osrm.cell_metrics file |
| 16 | template <typename CellMetricT> |
| 17 | inline void readCellMetrics(const std::filesystem::path &path, |
| 18 | std::unordered_map<std::string, std::vector<CellMetricT>> &metrics) |
| 19 | { |
| 20 | static_assert(std::is_same<CellMetricView, CellMetricT>::value || |
| 21 | std::is_same<CellMetric, CellMetricT>::value, |
| 22 | ""); |
| 23 | |
| 24 | const auto fingerprint = storage::tar::FileReader::VerifyFingerprint; |
| 25 | storage::tar::FileReader reader{path, fingerprint}; |
| 26 | |
| 27 | for (auto &pair : metrics) |
| 28 | { |
| 29 | const auto &metric_name = pair.first; |
| 30 | auto &metric_exclude_classes = pair.second; |
| 31 | |
| 32 | auto prefix = "/mld/metrics/" + metric_name + "/exclude"; |
| 33 | auto num_exclude_classes = reader.ReadElementCount64(prefix); |
| 34 | metric_exclude_classes.resize(num_exclude_classes); |
| 35 | |
| 36 | auto id = 0; |
| 37 | for (auto &metric : metric_exclude_classes) |
| 38 | { |
| 39 | serialization::read(reader, prefix + "/" + std::to_string(id++), metric); |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | // writes .osrm.cell_metrics file |
| 45 | template <typename CellMetricT> |
no test coverage detected