| 44 | // writes .osrm.cell_metrics file |
| 45 | template <typename CellMetricT> |
| 46 | inline void |
| 47 | writeCellMetrics(const std::filesystem::path &path, |
| 48 | const std::unordered_map<std::string, std::vector<CellMetricT>> &metrics) |
| 49 | { |
| 50 | static_assert(std::is_same<CellMetricView, CellMetricT>::value || |
| 51 | std::is_same<CellMetric, CellMetricT>::value, |
| 52 | ""); |
| 53 | |
| 54 | const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint; |
| 55 | storage::tar::FileWriter writer{path, fingerprint}; |
| 56 | |
| 57 | for (const auto &pair : metrics) |
| 58 | { |
| 59 | const auto &metric_name = pair.first; |
| 60 | const auto &metric_exclude_classes = pair.second; |
| 61 | |
| 62 | auto prefix = "/mld/metrics/" + metric_name + "/exclude"; |
| 63 | writer.WriteElementCount64(prefix, metric_exclude_classes.size()); |
| 64 | |
| 65 | auto id = 0; |
| 66 | for (auto &exclude_metric : metric_exclude_classes) |
| 67 | { |
| 68 | serialization::write(writer, prefix + "/" + std::to_string(id++), exclude_metric); |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | // reads .osrm.mldgr file |
| 74 | template <typename MultiLevelGraphT> |
no test coverage detected