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

Method SetParams

libs/search/geocoder.cpp:357–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355Geocoder::~Geocoder() {}
356
357void Geocoder::SetParams(Params const & params)
358{
359 if (params.IsCategorialRequest())
360 {
361 SetParamsForCategorialSearch(params);
362 return;
363 }
364
365 m_params = params;
366
367 auto const MakeRequest = [this](size_t i, auto & request)
368 {
369 FillRequestFromToken(m_params.GetToken(i), request);
370 for (auto const & index : m_params.GetTypeIndices(i))
371 request.m_categories.emplace_back(FeatureTypeToString(index));
372 request.SetLangs(m_params.GetLangs());
373 };
374
375 m_tokenRequests.clear();
376 m_prefixTokenRequest.Clear();
377 for (size_t i = 0; i < m_params.GetNumTokens(); ++i)
378 {
379 if (!m_params.IsPrefixToken(i))
380 {
381 m_tokenRequests.emplace_back();
382 MakeRequest(i, m_tokenRequests.back());
383 }
384 else
385 {
386 MakeRequest(i, m_prefixTokenRequest);
387 }
388 }
389
390 m_resultTracer.Clear();
391
392 LOG(LDEBUG, (static_cast<QueryParams const &>(m_params)));
393}
394
395void Geocoder::GoEverywhere()
396{

Callers 3

InitGeocoderMethod · 0.45
RankerResultMethod · 0.45
MakeFeatureMethod · 0.45

Calls 10

FillRequestFromTokenFunction · 0.85
FeatureTypeToStringFunction · 0.85
IsCategorialRequestMethod · 0.80
SetLangsMethod · 0.80
IsPrefixTokenMethod · 0.80
backMethod · 0.80
emplace_backMethod · 0.45
clearMethod · 0.45
ClearMethod · 0.45
GetNumTokensMethod · 0.45

Tested by 1

MakeFeatureMethod · 0.36