blob: d6f30e2e80109c812b56b6b579a28f4222ce92dd (
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
45
46
47
48
49
50
51
52
53
54
|
#pragma once
#include "map/booking_filter_params.hpp"
#include "base/macros.hpp"
#include <memory>
struct FeatureID;
class DataSource;
namespace search
{
class Results;
}
namespace booking
{
class Api;
namespace filter
{
class FilterBase
{
public:
class Delegate
{
public:
virtual ~Delegate() = default;
virtual DataSource const & GetDataSource() const = 0;
virtual Api const & GetApi() const = 0;
};
explicit FilterBase(Delegate const & d) : m_delegate(d) {}
virtual ~FilterBase() = default;
virtual void ApplyFilter(search::Results const & results,
ParamsInternal const & filterParams) = 0;
virtual void ApplyFilter(std::vector<FeatureID> const & featureIds,
ParamsRawInternal const & params) = 0;
virtual void GetFeaturesFromCache(search::Results const & results,
std::vector<FeatureID> & sortedResults) = 0;
virtual void UpdateParams(ParamsBase const & apiParams) = 0;
Delegate const & GetDelegate() const { return m_delegate; }
private:
Delegate const & m_delegate;
};
using FilterPtr = std::unique_ptr<FilterBase>;
} // namespace filter
} // namespace booking
|