MCPcopy Create free account
hub / github.com/comaps/comaps / EmitWithMetadata

Method EmitWithMetadata

libs/search/processor.cpp:462–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462void Processor::EmitWithMetadata(feature::Metadata::EType type)
463{
464 std::vector<std::shared_ptr<MwmInfo>> infos;
465 m_dataSource.GetMwmsInfo(infos);
466 // less<MwmInfo*>
467 std::sort(infos.begin(), infos.end());
468
469 std::vector<FeatureID> ids;
470 m_dataSource.ForEachFeatureIDInRect([&ids](FeatureID id) { ids.push_back(std::move(id)); }, m_viewport,
471 scales::GetUpperScale());
472
473 // The same, first criteria is less<MwmId> -> less<MwmInfo*>
474 std::sort(ids.begin(), ids.end());
475
476 size_t idx = 0;
477 EmitResultsFromMwms(infos, [type, &idx, &ids](FeaturesLoaderGuard & guard, auto const & fn)
478 {
479 for (; idx < ids.size() && ids[idx].m_mwmId == guard.GetId(); ++idx)
480 {
481 auto ft = guard.GetFeatureByIndex(ids[idx].m_index);
482 if (ft)
483 {
484 if (ft->HasMetadata(type))
485 fn(std::move(ft));
486 }
487 }
488 });
489}
490
491Locales Processor::GetCategoryLocales() const
492{

Callers

nothing calls this directly

Calls 10

GetUpperScaleFunction · 0.85
GetMwmsInfoMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
GetIdMethod · 0.45
GetFeatureByIndexMethod · 0.45
HasMetadataMethod · 0.45

Tested by

no test coverage detected