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

test_search_engine.hpp « search_tests_support « search - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bc51c33bac6c4a6d2e4646d796f4bbda29f7b69d (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
#pragma once

#include "search/engine.hpp"

#include "storage/country_info_getter.hpp"

#include <memory>
#include <string>

class DataSourceBase;

namespace search
{
struct SearchParams;

namespace tests_support
{
class TestSearchEngine
{
public:
  TestSearchEngine(DataSourceBase & dataSource, std::unique_ptr<storage::CountryInfoGetter> infoGetter,
                   Engine::Params const & params);
  TestSearchEngine(DataSourceBase & dataSource, Engine::Params const & params);

  void SetLocale(std::string const & locale) { m_engine.SetLocale(locale); }

  void LoadCitiesBoundaries() { m_engine.LoadCitiesBoundaries(); }

  std::weak_ptr<search::ProcessorHandle> Search(search::SearchParams const & params);

  storage::CountryInfoGetter & GetCountryInfoGetter() { return *m_infoGetter; }

private:
  std::unique_ptr<storage::CountryInfoGetter> m_infoGetter;
  search::Engine m_engine;
};
}  // namespace tests_support
}  // namespace search