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

Method EncodeAndWriteImpl

libs/coding/huffman.hpp:265–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263
264 template <typename TWriter, typename It>
265 uint32_t EncodeAndWriteImpl(TWriter & writer, It begin, It end) const
266 {
267 static_assert(sizeof(*begin) <= 4, "");
268
269 size_t const d = base::asserted_cast<size_t>(std::distance(begin, end));
270 BitWriter<TWriter> bitWriter(writer);
271 WriteVarUint(writer, d);
272 uint32_t sz = 0;
273 for (; begin != end; ++begin)
274 sz += EncodeAndWrite(bitWriter, static_cast<uint32_t>(*begin));
275 return sz;
276 }
277
278 template <typename TSource>
279 uint32_t ReadAndDecode(BitReader<TSource> & bitReader) const

Callers

nothing calls this directly

Calls 2

distanceFunction · 0.85
WriteVarUintFunction · 0.85

Tested by

no test coverage detected