Files
comaps/drape_frontend/metaline_manager.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

46 lines
912 B
C++

#pragma once
#include "drape_frontend/read_metaline_task.hpp"
#include "drape/drape_routine.hpp"
#include "drape/pointers.hpp"
#include "indexer/feature_decl.hpp"
#include <memory>
#include <mutex>
#include <set>
namespace df
{
class ThreadsCommutator;
class MetalineManager
{
public:
MetalineManager(ref_ptr<ThreadsCommutator> commutator,
MapDataProvider & model);
~MetalineManager();
void Stop();
void Update(std::set<MwmSet::MwmId> const & mwms);
m2::SharedSpline GetMetaline(FeatureID const & fid) const;
private:
void OnTaskFinished(std::shared_ptr<ReadMetalineTask> const & task);
MapDataProvider & m_model;
ref_ptr<ThreadsCommutator> m_commutator;
dp::ActiveTasks<ReadMetalineTask> m_activeTasks;
MetalineCache m_metalineCache;
mutable std::mutex m_metalineCacheMutex;
std::set<MwmSet::MwmId> m_mwms;
std::mutex m_mwmsMutex;
};
} // namespace df