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

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

#include "partners_api/booking_availability_params.hpp"

#include "map/booking_filter.hpp"
#include "map/booking_filter_cache.hpp"
#include "map/booking_filter_params.hpp"

#include <memory>

namespace search
{
class Results;
}

namespace booking
{
namespace filter
{
class AvailabilityFilter : public FilterBase
{
public:
  explicit AvailabilityFilter(Delegate const & d);
  void ApplyFilter(search::Results const & results, ParamsInternal const & filterParams) override;
  void ApplyFilter(std::vector<FeatureID> const & featureIds,
                   ParamsRawInternal const & params) override;

  void GetFeaturesFromCache(search::Results const & results, std::vector<FeatureID> & sortedResults,
                            std::vector<Extras> & extras,
                            std::vector<FeatureID> & filteredOut) override;
  void UpdateParams(ParamsBase const & apiParams) override;

private:
  template <typename SourceValue, typename Source, typename Parameters>
  void ApplyFilterInternal(Source const & results, Parameters const & filterParams);

  using CachePtr = std::shared_ptr<availability::Cache>;
  CachePtr m_cache = std::make_shared<availability::Cache>();

  AvailabilityParams m_apiParams;
};
}  // namespace filter
}  // namespace booking