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

Function WriteVectorOfPOD

libs/coding/read_write_utils.hpp:132–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130
131template <class TSink, class TCont>
132void WriteVectorOfPOD(TSink & sink, TCont const & v)
133{
134 typedef typename TCont::value_type ValueT;
135 /// This assert fails on std::pair<int, int> and OsmID class because std::pair is not trivially copyable:
136 /// std::pair has a non-trivial copy-assignment and move-assignment operator.
137 // static_assert(std::is_trivially_copyable_v<ValueT>);
138
139 uint32_t const count = static_cast<uint32_t>(v.size());
140 WriteVarUint(sink, count);
141
142 if (count > 0)
143 sink.Write(&v[0], count * sizeof(ValueT));
144}
145
146template <class ReaderT, class WriterT>
147void ReadAndWrite(ReaderT & reader, WriterT & writer, size_t bufferSize = 4 * 1024)

Callers 13

SaveMethod · 0.85
WriteMiniRoundaboutFunction · 0.85
SaveMethod · 0.85
OrderCollectedDataMethod · 0.85
SerializeMethod · 0.85
WriteMethod · 0.85
SerializeMethod · 0.85
UNIT_TESTFunction · 0.85
SerializeMethod · 0.85

Calls 3

WriteVarUintFunction · 0.85
sizeMethod · 0.45
WriteMethod · 0.45

Tested by 2

UNIT_TESTFunction · 0.68
UNIT_TESTFunction · 0.68