Files
comaps/indexer/caching_rank_table_loader.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
787 B
C++

#pragma once
#include "indexer/feature_decl.hpp"
#include "indexer/mwm_set.hpp"
#include "indexer/rank_table.hpp"
#include "base/macros.hpp"
#include <map>
#include <memory>
#include <string>
class DataSource;
struct FeatureID;
// *NOTE* This class IS NOT thread-safe.
class CachingRankTableLoader
{
public:
CachingRankTableLoader(DataSource const & dataSource, std::string const & sectionName);
/// @return 0 if there is no rank for feature.
uint8_t Get(FeatureID const & featureId) const;
void OnMwmDeregistered(platform::LocalCountryFile const & localFile);
private:
DataSource const & m_dataSource;
std::string const m_sectionName;
mutable std::map<MwmSet::MwmId, std::unique_ptr<search::RankTable>> m_deserializers;
DISALLOW_COPY(CachingRankTableLoader);
};