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

Function CopyWithoutOffsets

tools/openlr/openlr_decoder.cpp:195–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193
194template <typename InputIterator, typename OutputIterator>
195void CopyWithoutOffsets(InputIterator start, InputIterator stop, OutputIterator out, uint32_t positiveOffset,
196 uint32_t negativeOffset, bool keepEnds)
197{
198 auto from = start;
199 auto to = stop;
200
201 if (distance(start, stop) > 1)
202 {
203 from = CutOffset(start, stop, positiveOffset, keepEnds);
204 // |to| points past the last edge we need to take.
205 to = CutOffset(reverse_iterator<InputIterator>(stop), reverse_iterator<InputIterator>(start), negativeOffset,
206 keepEnds)
207 .base();
208 }
209
210 if (!keepEnds)
211 CHECK(from <= to, ("From iterator is less or equal than to."));
212
213 if (from >= to)
214 return;
215
216 copy(from, to, out);
217}
218
219class SegmentsDecoderV2
220{

Callers 2

DecodeSegmentMethod · 0.85
DecodeSegmentMethod · 0.85

Calls 2

distanceFunction · 0.85
CutOffsetFunction · 0.85

Tested by

no test coverage detected