| 57 | |
| 58 | template <typename VectorT> |
| 59 | void readBoolVector(tar::FileReader &reader, const std::string &name, VectorT &data) |
| 60 | { |
| 61 | const auto count = reader.ReadElementCount64(name); |
| 62 | data.resize(count); |
| 63 | std::uint64_t index = 0; |
| 64 | |
| 65 | using BlockType = std::uint64_t; |
| 66 | constexpr std::uint64_t BLOCK_BITS = CHAR_BIT * sizeof(BlockType); |
| 67 | |
| 68 | const auto decode = [&](const BlockType block) |
| 69 | { |
| 70 | auto read_size = std::min<std::size_t>(count - index, BLOCK_BITS); |
| 71 | unpackBits<VectorT, BlockType>(data, index, read_size, block); |
| 72 | index += BLOCK_BITS; |
| 73 | }; |
| 74 | |
| 75 | reader.ReadStreaming<BlockType>(name, osrm::util::make_function_output_iterator(decode)); |
| 76 | } |
| 77 | |
| 78 | template <typename VectorT> |
| 79 | void writeBoolVector(tar::FileWriter &writer, const std::string &name, const VectorT &data) |
no test coverage detected