From dce0ce0e177a721fc0367014e4e909166e26b198 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Mon, 3 Apr 2017 14:21:13 +0000 Subject: [PATCH] Fix readGraph to not use UseSharedMemory --- include/contractor/files.hpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/include/contractor/files.hpp b/include/contractor/files.hpp index fc52b3492..55eba978c 100644 --- a/include/contractor/files.hpp +++ b/include/contractor/files.hpp @@ -15,11 +15,13 @@ namespace files { // reads .osrm.hsgr file -template -inline void readGraph(const boost::filesystem::path &path, - unsigned &checksum, - detail::QueryGraph &graph) +template +inline void readGraph(const boost::filesystem::path &path, unsigned &checksum, QueryGraphT &graph) { + static_assert(std::is_same::value || + std::is_same::value, + "graph must be of type QueryGraph<>"); + const auto fingerprint = storage::io::FileReader::VerifyFingerprint; storage::io::FileReader reader{path, fingerprint}; @@ -28,18 +30,19 @@ inline void readGraph(const boost::filesystem::path &path, } // writes .osrm.hsgr file -template -inline void writeGraph(const boost::filesystem::path &path, - unsigned checksum, - const detail::QueryGraph &graph) +template +inline void +writeGraph(const boost::filesystem::path &path, unsigned checksum, const QueryGraphT &graph) { + static_assert(std::is_same::value || + std::is_same::value, + "graph must be of type QueryGraph<>"); const auto fingerprint = storage::io::FileWriter::GenerateFingerprint; storage::io::FileWriter writer{path, fingerprint}; writer.WriteOne(checksum); util::serialization::write(writer, graph); } - } } }