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

Method ClearCache

libs/map/traffic_manager.cpp:416–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416void TrafficManager::ClearCache(MwmSet::MwmId const & mwmId)
417{
418 auto const it = m_mwmCache.find(mwmId);
419 if (it == m_mwmCache.end())
420 return;
421
422 if (it->second.m_isLoaded)
423 {
424 ASSERT_GREATER_OR_EQUAL(m_currentCacheSizeBytes, it->second.m_dataSize, ());
425 m_currentCacheSizeBytes -= it->second.m_dataSize;
426
427 m_drapeEngine.SafeCall(&df::DrapeEngine::ClearTrafficCache, mwmId);
428
429 GetPlatform().RunTask(Platform::Thread::Gui, [this, mwmId]() { m_observer.OnTrafficInfoRemoved(mwmId); });
430 }
431 m_mwmCache.erase(it);
432 m_trafficETags.erase(mwmId);
433 m_activeDrapeMwms.erase(mwmId);
434 m_activeRoutingMwms.erase(mwmId);
435 m_lastDrapeMwmsByRect.clear();
436 m_lastRoutingMwmsByRect.clear();
437}
438
439bool TrafficManager::IsEnabled() const
440{

Callers 1

ClearCachesMethod · 0.45

Calls 7

SafeCallMethod · 0.80
RunTaskMethod · 0.80
OnTrafficInfoRemovedMethod · 0.80
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected