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

Method ForEachRecord

libs/coding/var_record_reader.hpp:28–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27 template <class FnT>
28 void ForEachRecord(FnT && fn) const
29 {
30 ReaderSource source(m_reader);
31 while (source.Size() > 0)
32 {
33 auto const pos = source.Pos();
34 uint32_t const recordSize = ReadVarUint<uint32_t>(source);
35 std::vector<uint8_t> buffer(recordSize);
36 source.Read(buffer.data(), recordSize);
37 fn(static_cast<uint32_t>(pos), std::move(buffer));
38 }
39 }
40
41private:
42 ReaderT m_reader;

Callers 3

UNIT_TESTFunction · 0.80
ForEachMethod · 0.80
ForEachOffsetMethod · 0.80

Calls 4

SizeMethod · 0.45
PosMethod · 0.45
ReadMethod · 0.45
dataMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.64