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

Function ReadGamma

libs/routing/coding.hpp:41–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40template <typename T, typename Source>
41T ReadGamma(BitReader<Source> & reader)
42{
43 static_assert(std::is_unsigned<T>::value, "T should be an unsigned type");
44 uint64_t const decoded = coding::GammaCoder::Decode(reader);
45 if (decoded > std::numeric_limits<T>::max())
46 MYTHROW(CorruptedDataException, ("Decoded value", decoded, "out of limit", std::numeric_limits<T>::max()));
47
48 return static_cast<T>(decoded);
49}
50
51template <typename T, typename Sink>
52void WriteGamma(BitWriter<Sink> & writer, T value)

Callers

nothing calls this directly

Calls 1

DecodeFunction · 0.50

Tested by

no test coverage detected