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

Method OnTrafficInfoAdded

libs/routing/routing_session.cpp:888–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886}
887
888void RoutingSession::OnTrafficInfoAdded(TrafficInfo && info)
889{
890 TrafficInfo::Coloring const & fullColoring = info.GetColoring();
891 auto coloring = std::make_shared<TrafficInfo::Coloring>();
892 for (auto const & kv : fullColoring)
893 {
894 ASSERT_NOT_EQUAL(kv.second, SpeedGroup::Unknown, ());
895 coloring->insert(kv);
896 }
897
898 // Note. |coloring| should not be used after this call on gui thread.
899 auto const mwmId = info.GetMwmId();
900 GetPlatform().RunTask(Platform::Thread::Gui, [this, mwmId, coloring]()
901 {
902 Set(mwmId, coloring);
903 RebuildRouteOnTrafficUpdate();
904 });
905}
906
907void RoutingSession::OnTrafficInfoRemoved(MwmSet::MwmId const & mwmId)
908{

Callers 1

OnTrafficDataResponseMethod · 0.80

Calls 4

RunTaskMethod · 0.80
SetFunction · 0.50
insertMethod · 0.45
GetMwmIdMethod · 0.45

Tested by

no test coverage detected