Welcome to mirror list, hosted at ThFree Co, Russian Federation.

geocoder_context.hpp « search - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 216c32398749d7127c8f0ad937ab5399c5776148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once

#include "search/cbv.hpp"
#include "search/hotels_filter.hpp"

#include "std/unique_ptr.hpp"
#include "std/vector.hpp"

namespace search
{
class FeaturesFilter;

struct BaseContext
{
  // Advances |curToken| to the nearest unused token, or to the end of
  // |m_usedTokens| if there are no unused tokens.
  size_t SkipUsedTokens(size_t curToken) const;

  // Returns true iff all tokens are used.
  bool AllTokensUsed() const;

  // Returns true if there exists at least one used token in [from,
  // to).
  bool HasUsedTokensInRange(size_t from, size_t to) const;

  // Counts number of groups of consecutive unused tokens.
  size_t NumUnusedTokenGroups() const;

  // List of bit-vectors of features, where i-th element of the list
  // corresponds to the i-th token in the search query.
  vector<CBV> m_features;
  CBV m_villages;
  CBV m_streets;

  // This vector is used to indicate what tokens were already matched
  // and can't be re-used during the geocoding process.
  vector<bool> m_usedTokens;

  // Number of tokens in the query.
  size_t m_numTokens = 0;

  unique_ptr<hotels_filter::HotelsFilter::ScopedFilter> m_hotelsFilter;
};
}  // namespace search