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

Method Load

libs/search/categories_cache.cpp:30–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30CBV CategoriesCache::Load(MwmContext const & context) const
31{
32 auto const & c = classif();
33
34 // Any DFA will do, since we only use requests's m_categories,
35 // but the interface of Retrieval forces us to make a choice.
36 SearchTrieRequest<strings::UniStringDFA> request;
37
38 // m_categories usually has truncated types; add them together with their subtrees.
39 m_categories.ForEach([&request, &c](uint32_t const type)
40 {
41 c.ForEachInSubtree([&](uint32_t descendantType)
42 {
43 if (c.IsTypeValid(descendantType))
44 request.m_categories.emplace_back(FeatureTypeToString(c.GetIndexForType(descendantType)));
45 }, type);
46 });
47
48 Retrieval retrieval(context, m_cancellable);
49 return retrieval.RetrieveAddressFeatures(request).m_features;
50}
51
52// StreetsCache ------------------------------------------------------------------------------------
53StreetsCache::StreetsCache(base::Cancellable const & cancellable)

Callers

nothing calls this directly

Calls 7

FeatureTypeToStringFunction · 0.85
IsTypeValidMethod · 0.80
ForEachMethod · 0.45
ForEachInSubtreeMethod · 0.45
emplace_backMethod · 0.45
GetIndexForTypeMethod · 0.45

Tested by

no test coverage detected