Functions
lanelet::helper Namespace Reference

Functions

template<typename FwIter , typename Func >
void forEachPair (FwIter first, FwIter end, Func f)
 apply a function for each pair of adjacent elements in a range More...
 
template<typename FwIter , typename Func >
FwIter forEachPairUntil (FwIter first, FwIter end, Func f)
 Apply a function of all pairs in a sequenc in sorted order until a predicate returns true. More...
 

Function Documentation

◆ forEachPair()

template<typename FwIter , typename Func >
void lanelet::helper::forEachPair ( FwIter  first,
FwIter  end,
Func  f 
)

apply a function for each pair of adjacent elements in a range

Parameters
firstfirst element in range
endpast-the-end iterator
ffunction/lambda to apply (defines operator())

This is useful for iterating over a the segments in a LineString.

Definition at line 15 of file GeometryHelper.h.

◆ forEachPairUntil()

template<typename FwIter , typename Func >
FwIter lanelet::helper::forEachPairUntil ( FwIter  first,
FwIter  end,
Func  f 
)

Apply a function of all pairs in a sequenc in sorted order until a predicate returns true.

Parameters
firstbegin of the range to iterate over
endend of the range to iterate over
ffunction returning something convertible to bool. If the result is true, the iteration is stopped
Returns
Iterator to the first element of the pair that returned true or end

Works similar to forEachPair but stops if f returns true. Useful for implementing a search on segments.

Definition at line 38 of file GeometryHelper.h.



lanelet2_core
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:25:53