diff --git a/libs/indexer/CMakeLists.txt b/libs/indexer/CMakeLists.txt index feccdb2c9..cd533a334 100644 --- a/libs/indexer/CMakeLists.txt +++ b/libs/indexer/CMakeLists.txt @@ -5,8 +5,6 @@ set(SRC altitude_loader.hpp brands_holder.cpp brands_holder.hpp - caching_rank_table_loader.cpp - caching_rank_table_loader.hpp categories_holder.cpp categories_holder.hpp categories_holder_loader.cpp @@ -153,7 +151,6 @@ file(COPY ${OTHER_FILES} DESTINATION ${CMAKE_BINARY_DIR}) omim_add_library(${PROJECT_NAME} ${SRC}) target_link_libraries(${PROJECT_NAME} - search # search::DummyRankTable in CachingRankTableLoader platform geometry protobuf diff --git a/libs/indexer/caching_rank_table_loader.cpp b/libs/indexer/caching_rank_table_loader.cpp deleted file mode 100644 index b03fab31b..000000000 --- a/libs/indexer/caching_rank_table_loader.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "indexer/caching_rank_table_loader.hpp" - -#include "search/dummy_rank_table.hpp" - -#include "indexer/data_source.hpp" - -CachingRankTableLoader::CachingRankTableLoader(DataSource const & dataSource, std::string const & sectionName) - : m_dataSource(dataSource) - , m_sectionName(sectionName) -{} - -uint8_t CachingRankTableLoader::Get(FeatureID const & featureId) const -{ - auto const handle = m_dataSource.GetMwmHandleById(featureId.m_mwmId); - - if (!handle.IsAlive()) - return search::RankTable::kNoRank; - - auto it = m_deserializers.find(featureId.m_mwmId); - - if (it == m_deserializers.end()) - { - auto rankTable = search::RankTable::Load(handle.GetValue()->m_cont, m_sectionName); - - if (!rankTable) - rankTable = std::make_unique(); - - auto const result = m_deserializers.emplace(featureId.m_mwmId, std::move(rankTable)); - it = result.first; - } - - return it->second->Get(featureId.m_index); -} - -void CachingRankTableLoader::OnMwmDeregistered(platform::LocalCountryFile const & localFile) -{ - for (auto it = m_deserializers.begin(); it != m_deserializers.end(); ++it) - { - if (it->first.IsDeregistered(localFile)) - { - m_deserializers.erase(it); - return; - } - } -} diff --git a/libs/indexer/caching_rank_table_loader.hpp b/libs/indexer/caching_rank_table_loader.hpp deleted file mode 100644 index c8dc5d5b4..000000000 --- a/libs/indexer/caching_rank_table_loader.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "indexer/feature_decl.hpp" -#include "indexer/mwm_set.hpp" -#include "indexer/rank_table.hpp" - -#include "base/macros.hpp" - -#include -#include -#include - -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> m_deserializers; - - DISALLOW_COPY(CachingRankTableLoader); -}; diff --git a/libs/map/framework.cpp b/libs/map/framework.cpp index ad2044548..d01c3f654 100644 --- a/libs/map/framework.cpp +++ b/libs/map/framework.cpp @@ -284,7 +284,6 @@ Framework::Framework(FrameworkParams const & params, bool loadMaps) , m_trafficManager(bind(&Framework::GetMwmsByRect, this, _1, false /* rough */), kMaxTrafficCacheSizeBytes, m_routingManager.RoutingSession()) , m_lastReportedCountry(kInvalidCountryId) - , m_popularityLoader(m_featuresFetcher.GetDataSource(), POPULARITY_RANKS_FILE_TAG) , m_descriptionsLoader(std::make_unique(m_featuresFetcher.GetDataSource())) { // Editor should be initialized from the main thread to set its ThreadChecker. @@ -453,7 +452,6 @@ void Framework::OnMapDeregistered(platform::LocalCountryFile const & localFile) m_transitManager.OnMwmDeregistered(localFile); m_isolinesManager.OnMwmDeregistered(localFile); m_trafficManager.OnMwmDeregistered(localFile); - m_popularityLoader.OnMwmDeregistered(localFile); m_storage.DeleteCustomCountryVersion(localFile); }; diff --git a/libs/map/framework.hpp b/libs/map/framework.hpp index 71d78aa14..25a1770b8 100644 --- a/libs/map/framework.hpp +++ b/libs/map/framework.hpp @@ -32,7 +32,6 @@ #include "editor/new_feature_categories.hpp" #include "editor/osm_editor.hpp" -#include "indexer/caching_rank_table_loader.hpp" #include "indexer/data_source.hpp" #include "indexer/data_source_helpers.hpp" #include "indexer/map_object.hpp" @@ -485,8 +484,6 @@ private: TrackRecordingUpdateHandler m_trackRecordingUpdateHandler; - CachingRankTableLoader m_popularityLoader; - std::unique_ptr m_descriptionsLoader; public: diff --git a/xcode/indexer/indexer.xcodeproj/project.pbxproj b/xcode/indexer/indexer.xcodeproj/project.pbxproj index 56e4114f2..e44a58054 100644 --- a/xcode/indexer/indexer.xcodeproj/project.pbxproj +++ b/xcode/indexer/indexer.xcodeproj/project.pbxproj @@ -43,8 +43,6 @@ 394E1E0B22BBB5EB00E4BC75 /* utils.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 394E1E0922BBB5EB00E4BC75 /* utils.hpp */; }; 39F376C0207D32450058E8E0 /* cities_boundaries_serdes_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39F376BE207D32410058E8E0 /* cities_boundaries_serdes_tests.cpp */; }; 39F376C3207D32510058E8E0 /* scale_index_reading_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39F376C1207D324E0058E8E0 /* scale_index_reading_tests.cpp */; }; - 3D12E3D72111B4BE0015A9A9 /* caching_rank_table_loader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D12E3D52111B4BD0015A9A9 /* caching_rank_table_loader.cpp */; }; - 3D12E3D82111B4BE0015A9A9 /* caching_rank_table_loader.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3D12E3D62111B4BD0015A9A9 /* caching_rank_table_loader.hpp */; }; 3D489BC61D3D220F0052AA38 /* editable_map_object_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D489BA71D3D1F8A0052AA38 /* editable_map_object_test.cpp */; }; 3D489BC71D3D22150052AA38 /* features_vector_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D489BA81D3D1F8A0052AA38 /* features_vector_test.cpp */; }; 3D489BC81D3D22190052AA38 /* string_slice_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D489BA91D3D1F8A0052AA38 /* string_slice_tests.cpp */; }; @@ -265,8 +263,6 @@ 394E1E0922BBB5EB00E4BC75 /* utils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = utils.hpp; sourceTree = ""; }; 39F376BE207D32410058E8E0 /* cities_boundaries_serdes_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cities_boundaries_serdes_tests.cpp; sourceTree = ""; }; 39F376C1207D324E0058E8E0 /* scale_index_reading_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scale_index_reading_tests.cpp; sourceTree = ""; }; - 3D12E3D52111B4BD0015A9A9 /* caching_rank_table_loader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = caching_rank_table_loader.cpp; sourceTree = ""; }; - 3D12E3D62111B4BD0015A9A9 /* caching_rank_table_loader.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = caching_rank_table_loader.hpp; sourceTree = ""; }; 3D452AF71EE6D9F5009EAB9B /* wheelchair_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wheelchair_tests.cpp; sourceTree = ""; }; 3D452AF81EE6D9F5009EAB9B /* feature_names_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = feature_names_test.cpp; sourceTree = ""; }; 3D452AF91EE6D9F5009EAB9B /* centers_table_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = centers_table_test.cpp; sourceTree = ""; }; @@ -602,8 +598,6 @@ 34664CEF1D49FEC1003D7096 /* altitude_loader.hpp */, 4088CE1F21AE993F00E2702A /* brands_holder.cpp */, 4088CE1E21AE993F00E2702A /* brands_holder.hpp */, - 3D12E3D52111B4BD0015A9A9 /* caching_rank_table_loader.cpp */, - 3D12E3D62111B4BD0015A9A9 /* caching_rank_table_loader.hpp */, 56C74C121C749E4700B71B9F /* categories_holder_loader.cpp */, 56C74C131C749E4700B71B9F /* categories_holder.cpp */, 56C74C141C749E4700B71B9F /* categories_holder.hpp */, @@ -778,7 +772,6 @@ 347F337D1C454242009758CC /* succinct_trie_builder.hpp in Headers */, 675341381A3F540F00A0A8C3 /* mwm_set.hpp in Headers */, 456E1B181F90E5B7009C32E1 /* cities_boundaries_serdes.hpp in Headers */, - 3D12E3D82111B4BE0015A9A9 /* caching_rank_table_loader.hpp in Headers */, 670EE56D1B60033A001E8064 /* unique_index.hpp in Headers */, 675340FF1A3F540F00A0A8C3 /* cell_coverer.hpp in Headers */, 56C74C251C749E4700B71B9F /* search_string_utils.hpp in Headers */, @@ -990,7 +983,6 @@ 6753410D1A3F540F00A0A8C3 /* drawing_rules.cpp in Sources */, 675341301A3F540F00A0A8C3 /* data_source.cpp in Sources */, 34664CF61D49FEC1003D7096 /* centers_table.cpp in Sources */, - 3D12E3D72111B4BE0015A9A9 /* caching_rank_table_loader.cpp in Sources */, 6753414D1A3F540F00A0A8C3 /* types_mapping.cpp in Sources */, 34583BC71C88552100F94664 /* cuisines.cpp in Sources */, 675341121A3F540F00A0A8C3 /* feature_algo.cpp in Sources */,