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

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

#include "map/booking_filter_params.hpp"
#include "map/everywhere_search_params.hpp"
#include "map/search_product_info.hpp"

#include "search/result.hpp"

#include <functional>
#include <vector>

namespace search
{
// An on-results-callback that should be used for search over all
// maps.
//
// *NOTE* the class is NOT thread safe.
class EverywhereSearchCallback
{
public:
  class Delegate
  {
  public:
    virtual void FilterResultsForHotelsQuery(booking::filter::Tasks const & filterTasks,
                                             search::Results const & results, bool inViewport) = 0;
  };

  EverywhereSearchCallback(Delegate & hotelsDelegate, ProductInfo::Delegate & productInfoDelegate,
                           booking::filter::Tasks const & bookingFilterTasks,
                           EverywhereSearchParams::OnResults onResults);

  void operator()(Results const & results);

private:
  Delegate & m_hotelsDelegate;
  ProductInfo::Delegate & m_productInfoDelegate;
  EverywhereSearchParams::OnResults m_onResults;
  std::vector<ProductInfo> m_productInfo;
  booking::filter::Tasks m_bookingFilterTasks;
};
}  // namespace search