Welcome to mirror list, hosted at ThFree Co, Russian Federation.

traffic_cache.cpp « traffic - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 604aeee80f56779d2630d6fe97ba8c2b499b8a28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "traffic/traffic_cache.hpp"

namespace traffic
{
using namespace std;

void TrafficCache::Set(MwmSet::MwmId const & mwmId, shared_ptr<TrafficInfo::Coloring const> coloring)
{
  lock_guard<mutex> guard(mutex);
  m_trafficColoring[mwmId] = coloring;
}

void TrafficCache::Remove(MwmSet::MwmId const & mwmId)
{
  lock_guard<mutex> guard(mutex);
  m_trafficColoring.erase(mwmId);
}

void TrafficCache::CopyTraffic(AllMwmTrafficInfo & trafficColoring) const
{
  lock_guard<mutex> guard(mutex);
  trafficColoring = m_trafficColoring;
}

void TrafficCache::Clear()
{
  lock_guard<mutex> guard(mutex);
  m_trafficColoring.clear();
}
}  // namespace traffic