MCPcopy Create free account
hub / github.com/comaps/comaps / ReadDelta

Function ReadDelta

libs/routing/coding.hpp:19–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17{
18template <typename T, typename Source>
19T ReadDelta(BitReader<Source> & reader)
20{
21 static_assert(std::is_unsigned<T>::value, "T should be an unsigned type");
22 uint64_t const decoded = coding::DeltaCoder::Decode(reader);
23 if (decoded > std::numeric_limits<T>::max())
24 MYTHROW(CorruptedDataException, ("Decoded value", decoded, "out of limit", std::numeric_limits<T>::max()));
25
26 return static_cast<T>(decoded);
27}
28
29template <typename T, typename Sink>
30void WriteDelta(BitWriter<Sink> & writer, T value)

Callers

nothing calls this directly

Calls 1

DecodeFunction · 0.50

Tested by

no test coverage detected