MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / ReadRefrencedBlock

Method ReadRefrencedBlock

include/util/indexed_data.hpp:240–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238 /// Output [first..last) is a range of the referenced data at local_index.
239 template <typename DataIterator>
240 void ReadRefrencedBlock(const BlockReference &,
241 std::uint32_t local_index,
242 DataIterator &first,
243 DataIterator &last) const
244 {
245 DataIterator fixed_lengths = first; // iterator to the fixed lengths part
246 std::advance(first, BLOCK_SIZE); // advance first to the block data part
247 for (std::uint32_t i = 0; i < local_index; ++i)
248 {
249 first += static_cast<unsigned char>(*fixed_lengths++);
250 }
251
252 if (local_index < BLOCK_SIZE)
253 {
254 last = first + static_cast<unsigned char>(*fixed_lengths);
255 }
256 }
257};
258
259namespace detail

Callers 1

atMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected