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

Method AssignRoute

libs/routing/routing_session.cpp:569–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567}
568
569void RoutingSession::AssignRoute(std::shared_ptr<Route> const & route, RouterResultCode e)
570{
571 CHECK_THREAD_CHECKER(m_threadChecker, ());
572
573 if (e != RouterResultCode::NoError)
574 {
575 // Route building was not success. If the former route is valid let's continue moving along it.
576 // If not, let's set corresponding state.
577 if (m_route->IsValid())
578 SetState(SessionState::OnRoute);
579 else
580 SetState(SessionState::NoValidRoute);
581 return;
582 }
583
584 RemoveRoute();
585 SetState(SessionState::RouteNotStarted);
586 m_lastCompletionPercent = 0;
587 m_checkpoints.SetPointFrom(route->GetPoly().Front());
588
589 route->SetRoutingSettings(m_routingSettings);
590 m_route = route;
591 m_speedCameraManager.Reset();
592 m_speedCameraManager.SetRoute(m_route);
593}
594
595void RoutingSession::SetRouter(std::unique_ptr<IRouter> && router, std::unique_ptr<AbsentRegionsFinder> && finder)
596{

Callers 1

operator()Method · 0.80

Calls 6

SetPointFromMethod · 0.80
SetRouteMethod · 0.80
IsValidMethod · 0.45
FrontMethod · 0.45
SetRoutingSettingsMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected