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

Method GetRoutePointsToSave

libs/map/routing_manager.cpp:1598–1624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1596}
1597
1598vector<RouteMarkData> RoutingManager::GetRoutePointsToSave() const
1599{
1600 auto points = GetRoutePoints();
1601 if (points.size() < 2 || points.back().m_isPassed)
1602 return {};
1603
1604 vector<RouteMarkData> result;
1605 result.reserve(points.size());
1606
1607 // Save last passed point. It will be used on points loading if my position
1608 // isn't determined.
1609 result.emplace_back(GetLastPassedPoint(m_bmManager, points));
1610
1611 for (auto & p : points)
1612 {
1613 // Here we skip passed points and the start point.
1614 if (p.m_isPassed || p.m_pointType == RouteMarkType::Start)
1615 continue;
1616
1617 result.push_back(std::move(p));
1618 }
1619
1620 if (result.size() < 2)
1621 return {};
1622
1623 return result;
1624}
1625
1626void RoutingManager::OnExtrapolatedLocationUpdate(location::GpsInfo const & info)
1627{

Callers

nothing calls this directly

Calls 6

GetLastPassedPointFunction · 0.85
backMethod · 0.80
sizeMethod · 0.45
reserveMethod · 0.45
emplace_backMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected