Files
comaps/traffic/traffic_cache.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

33 lines
701 B
C++

#pragma once
#include "traffic/traffic_info.hpp"
#include "indexer/mwm_set.hpp"
#include <map>
#include <memory>
#include <mutex>
namespace traffic
{
using AllMwmTrafficInfo = std::map<MwmSet::MwmId, std::shared_ptr<const traffic::TrafficInfo::Coloring>>;
class TrafficCache
{
public:
TrafficCache() = default;
virtual ~TrafficCache() = default;
virtual void CopyTraffic(AllMwmTrafficInfo & trafficColoring) const;
protected:
void Set(MwmSet::MwmId const & mwmId, std::shared_ptr<TrafficInfo::Coloring const> coloring);
void Remove(MwmSet::MwmId const & mwmId);
void Clear();
private:
mutable std::mutex m_mutex;
AllMwmTrafficInfo m_trafficColoring;
};
} // namespace traffic