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

Method RebuildRouteOnTrafficUpdate

libs/routing/routing_session.cpp:146–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void RoutingSession::RebuildRouteOnTrafficUpdate()
147{
148 CHECK_THREAD_CHECKER(m_threadChecker, ());
149 m2::PointD startPoint;
150
151 {
152 startPoint = m_lastGoodPosition;
153
154 switch (m_state)
155 {
156 case SessionState::NoValidRoute:
157 case SessionState::RouteFinished: return;
158
159 case SessionState::RouteBuilding:
160 case SessionState::RouteNotStarted:
161 case SessionState::RouteNoFollowing:
162 case SessionState::RouteRebuilding: startPoint = m_checkpoints.GetPointFrom(); break;
163
164 case SessionState::OnRoute:
165 case SessionState::RouteNeedsRebuild: break;
166 }
167
168 // Cancel current route building.
169 m_router->ClearState();
170 }
171
172 RebuildRoute(startPoint, m_rebuildReadyCallback, nullptr /* needMoreMapsCallback */,
173 nullptr /* removeRouteCallback */, RouterDelegate::kNoTimeout, SessionState::RouteRebuilding,
174 false /* adjustToPrevRoute */);
175}
176
177bool RoutingSession::IsActive() const
178{

Callers

nothing calls this directly

Calls 1

ClearStateMethod · 0.45

Tested by

no test coverage detected