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

Method FinishRecord

libs/coding/var_serial_vector.hpp:26–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 ~VarSerialVectorWriter() { CHECK_EQUAL(m_recordNumber, m_size, ()); }
25
26 void FinishRecord()
27 {
28 CHECK_LESS(m_recordNumber, m_size, ());
29
30 uint64_t const pos = m_writer.Pos();
31 uint64_t const recordSize64 = pos - GetDataStartPos();
32 uint32_t const recordSize = static_cast<uint32_t>(recordSize64);
33 CHECK_EQUAL(recordSize, recordSize64, ());
34
35 m_writer.Seek(m_sizesOffset + m_recordNumber * sizeof(uint32_t));
36 WriteToSink(m_writer, recordSize);
37 m_writer.Seek(pos);
38
39 ++m_recordNumber;
40 }
41
42private:
43 uint64_t GetDataStartPos() const { return m_sizesOffset + m_size * sizeof(uint32_t); }

Callers 2

UNIT_TESTFunction · 0.80
IndexScalesFunction · 0.80

Calls 3

WriteToSinkFunction · 0.85
PosMethod · 0.45
SeekMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.64