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

Function ReadVectorOfPOD

libs/coding/read_write_utils.hpp:116–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115template <class TSource, class TCont>
116void ReadVectorOfPOD(TSource & src, TCont & v)
117{
118 typedef typename TCont::value_type ValueT;
119 /// This assert fails on std::pair<int, int> and OsmID class because std::pair is not trivially copyable:
120 /// std::pair has a non-trivial copy-assignment and move-assignment operator.
121 // static_assert(std::is_trivially_copyable_v<ValueT>);
122
123 uint32_t const count = ReadVarUint<uint32_t>(src);
124 if (count > 0)
125 {
126 v.resize(count);
127 src.Read(&v[0], count * sizeof(ValueT));
128 }
129}
130
131template <class TSink, class TCont>
132void WriteVectorOfPOD(TSink & sink, TCont const & v)

Callers 13

ReadMiniRoundaboutFunction · 0.85
OrderCollectedDataMethod · 0.85
WriteMetalinesSectionFunction · 0.85
DeserializeMethod · 0.85
ReadAndCheckHeaderMethod · 0.85
DeserializeMethod · 0.85
ReadFunction · 0.85
UNIT_TESTFunction · 0.85
DeserializeFromSourceMethod · 0.85

Calls 2

resizeMethod · 0.45
ReadMethod · 0.45

Tested by 3

ReadFunction · 0.68
UNIT_TESTFunction · 0.68
UNIT_TESTFunction · 0.68