#pragma once #include "search/result.hpp" #include "indexer/mwm_set.hpp" #include "std/shared_ptr.hpp" #include "std/string.hpp" #include "std/vector.hpp" class FeatureType; class Index; namespace generator { namespace tests_support { class TestFeature; } } namespace search { namespace tests_support { class MatchingRule { public: virtual ~MatchingRule() = default; virtual bool Matches(FeatureType const & feature) const = 0; virtual string ToString() const = 0; }; class ExactMatchingRule : public MatchingRule { public: ExactMatchingRule(MwmSet::MwmId const & mwmId, generator::tests_support::TestFeature const & feature); // MatchingRule overrides: bool Matches(FeatureType const & feature) const override; string ToString() const override; private: MwmSet::MwmId m_mwmId; generator::tests_support::TestFeature const & m_feature; }; class AlternativesMatchingRule : public MatchingRule { public: AlternativesMatchingRule(initializer_list> rules); // MatchingRule overrides: bool Matches(FeatureType const & feature) const override; string ToString() const override; private: vector> m_rules; }; template shared_ptr ExactMatch(TArgs &&... args) { return make_shared(forward(args)...); } template shared_ptr AlternativesMatch(TArgs &&... args) { return make_shared(forward(args)...); } bool MatchResults(Index const & index, vector> rules, vector const & actual); string DebugPrint(MatchingRule const & rule); } // namespace tests_support } // namespace search