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

Function MatchesByType

libs/search/retrieval.cpp:179–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178template <typename DFA>
179pair<bool, bool> MatchesByType(feature::TypesHolder const & types, vector<DFA> const & dfas)
180{
181 if (dfas.empty())
182 return {false, false};
183
184 auto const & c = classif();
185
186 for (auto const & type : types)
187 {
188 UniString const s = FeatureTypeToString(c.GetIndexForType(type));
189
190 for (auto const & dfa : dfas)
191 {
192 auto it = dfa.Begin();
193 DFAMove(it, s);
194 if (it.Accepts())
195 return {true, it.ErrorsMade() == 0};
196 }
197 }
198
199 return {false, false};
200}
201
202template <typename DFA>
203pair<bool, bool> MatchFeatureByNameAndType(EditableMapObject const & emo, SearchTrieRequest<DFA> const & request)

Callers 1

Calls 7

FeatureTypeToStringFunction · 0.85
DFAMoveFunction · 0.85
emptyMethod · 0.45
GetIndexForTypeMethod · 0.45
BeginMethod · 0.45
AcceptsMethod · 0.45
ErrorsMadeMethod · 0.45

Tested by

no test coverage detected