| 63 | { |
| 64 | template <class RankGetterT> |
| 65 | void BuildPopularPlacesImpl(std::string const & mwmFile, RankGetterT && getter) |
| 66 | { |
| 67 | bool popularPlaceFound = false; |
| 68 | |
| 69 | auto const & placeChecker = ftypes::IsPlaceChecker::Instance(); |
| 70 | auto const & poiChecker = ftypes::IsPoiChecker::Instance(); |
| 71 | auto const & streetChecker = ftypes::IsWayChecker::Instance(); |
| 72 | |
| 73 | std::vector<PopularityIndex> content; |
| 74 | feature::ForEachFeature(mwmFile, [&](FeatureType & ft, uint32_t featureId) |
| 75 | { |
| 76 | ASSERT_EQUAL(content.size(), featureId, ()); |
| 77 | PopularityIndex rank = 0; |
| 78 | |
| 79 | if (placeChecker(ft) || poiChecker(ft) || streetChecker(ft)) |
| 80 | { |
| 81 | rank = getter(ft, featureId); |
| 82 | if (rank > 0) |
| 83 | popularPlaceFound = true; |
| 84 | } |
| 85 | |
| 86 | content.emplace_back(rank); |
| 87 | }); |
| 88 | |
| 89 | if (popularPlaceFound) |
| 90 | { |
| 91 | FilesContainerW cont(mwmFile, FileWriter::OP_WRITE_EXISTING); |
| 92 | search::RankTableBuilder::Create(content, cont, POPULARITY_RANKS_FILE_TAG); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | PopularityIndex CalcRank(std::string const & str) |
| 97 | { |
no test coverage detected