| 1088 | } |
| 1089 | |
| 1090 | void Geocoder::LimitedSearch(BaseContext & ctx, FeaturesFilter const & filter, CentersFilter const & centers) |
| 1091 | { |
| 1092 | m_filter = &filter; |
| 1093 | SCOPE_GUARD(resetFilter, [&]() { m_filter = nullptr; }); |
| 1094 | |
| 1095 | if (!ctx.m_streets) |
| 1096 | ctx.m_streets = m_streetsCache.Get(*m_context); |
| 1097 | |
| 1098 | if (!ctx.m_suburbs) |
| 1099 | ctx.m_suburbs = m_suburbsCache.Get(*m_context); |
| 1100 | |
| 1101 | MatchUnclassified(ctx, 0 /* curToken */); |
| 1102 | |
| 1103 | auto const search = [this, &ctx, ¢ers]() |
| 1104 | { |
| 1105 | GreedilyMatchStreets(ctx, centers); |
| 1106 | MatchPOIsAndBuildings(ctx, 0 /* curToken */, CBV::GetFull()); |
| 1107 | }; |
| 1108 | |
| 1109 | WithPostcodes(ctx, search); |
| 1110 | search(); |
| 1111 | } |
| 1112 | |
| 1113 | template <typename Fn> |
| 1114 | void Geocoder::WithPostcodes(BaseContext & ctx, Fn && fn) |