#ifndef OSRM_INCLUDE_UTIL_IO_HPP_ #define OSRM_INCLUDE_UTIL_IO_HPP_ #include "util/log.hpp" #include #include #include #include #include #include #include #include #include "storage/io.hpp" #include "util/fingerprint.hpp" namespace osrm { namespace util { template void deserializeAdjacencyArray(const std::string &filename, std::vector &offsets, std::vector &data) { storage::io::FileReader file(filename, storage::io::FileReader::HasNoFingerprint); file.DeserializeVector(offsets); file.DeserializeVector(data); // offsets have to match up with the size of the data if (offsets.empty() || (offsets.back() != boost::numeric_cast(data.size()))) throw util::exception( "Error in " + filename + (offsets.empty() ? "Offsets are empty" : "Offset and data size do not match") + SOURCE_REF); } } // namespace util } // namespace osrm #endif // OSRM_INCLUDE_UTIL_IO_HPP_