From a7f289541ff64edfeea11d4db4310c5245f1f823 Mon Sep 17 00:00:00 2001 From: Arne H Juul Date: Tue, 19 Oct 2021 11:08:39 +0000 Subject: use custom types for true/false (NodeTypes::True, ProtonTrue, etc) --- .../unpacking_iterators_optimizer_test.cpp | 4 ++-- searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp | 5 ++--- searchcore/src/vespa/searchcore/proton/matching/querynodes.h | 5 ++++- .../src/vespa/searchcore/proton/matching/same_element_builder.cpp | 4 ++-- searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp | 4 ++-- .../searchcore/proton/matching/unpacking_iterators_optimizer.cpp | 4 ++-- 6 files changed, 14 insertions(+), 12 deletions(-) (limited to 'searchcore') diff --git a/searchcore/src/tests/proton/matching/unpacking_iterators_optimizer/unpacking_iterators_optimizer_test.cpp b/searchcore/src/tests/proton/matching/unpacking_iterators_optimizer/unpacking_iterators_optimizer_test.cpp index 68960e0f919..ffd08b3bbef 100644 --- a/searchcore/src/tests/proton/matching/unpacking_iterators_optimizer/unpacking_iterators_optimizer_test.cpp +++ b/searchcore/src/tests/proton/matching/unpacking_iterators_optimizer/unpacking_iterators_optimizer_test.cpp @@ -67,8 +67,8 @@ struct DumpQuery : QueryVisitor { void visit(PredicateQuery &) override {} void visit(RegExpTerm &) override {} void visit(NearestNeighborTerm &) override {} - void visit(search::query::TrueQueryNode &) override {} - void visit(search::query::FalseQueryNode &) override {} + void visit(TrueQueryNode &) override {} + void visit(FalseQueryNode &) override {} }; std::string dump_query(Node &root) { diff --git a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp index a12d556ff5f..9be5920c0ed 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/blueprintbuilder.cpp @@ -159,11 +159,10 @@ protected: void visit(ProtonPredicateQuery &n) override { buildTerm(n); } void visit(ProtonRegExpTerm &n) override { buildTerm(n); } void visit(ProtonNearestNeighborTerm &n) override { buildTerm(n); } - - void visit(search::query::TrueQueryNode &) override { + void visit(ProtonTrue &) override { _result = std::make_unique(); } - void visit(search::query::FalseQueryNode &) override { + void visit(ProtonFalse &) override { _result = std::make_unique(); } diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h index 2ebd52d7fa7..084c533fa55 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h +++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h @@ -114,7 +114,8 @@ typedef search::query::SimpleOr ProtonOr; typedef search::query::SimpleRank ProtonRank; typedef search::query::SimpleWeakAnd ProtonWeakAnd; typedef search::query::SimpleSameElement ProtonSameElement; - +typedef search::query::SimpleTrue ProtonTrue; +typedef search::query::SimpleFalse ProtonFalse; struct ProtonEquiv final : public ProtonTermBase { search::fef::MatchDataLayout children_mdl; @@ -161,6 +162,8 @@ struct ProtonNodeTypes { typedef ProtonPredicateQuery PredicateQuery; typedef ProtonRegExpTerm RegExpTerm; typedef ProtonNearestNeighborTerm NearestNeighborTerm; + typedef ProtonTrue True; + typedef ProtonFalse False; }; } diff --git a/searchcore/src/vespa/searchcore/proton/matching/same_element_builder.cpp b/searchcore/src/vespa/searchcore/proton/matching/same_element_builder.cpp index 9e415ed699f..34cb5369c1e 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/same_element_builder.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/same_element_builder.cpp @@ -67,8 +67,8 @@ public: void visit(ProtonPredicateQuery &) override {} void visit(ProtonRegExpTerm &n) override { visitTerm(n); } void visit(ProtonNearestNeighborTerm &) override {} - void visit(search::query::TrueQueryNode &) override {} - void visit(search::query::FalseQueryNode &) override {} + void visit(ProtonTrue &) override {} + void visit(ProtonFalse &) override {} }; } // namespace proton::matching:: diff --git a/searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp b/searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp index c752ed76909..c2abeaa36ee 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/termdatafromnode.cpp @@ -26,8 +26,8 @@ struct TermDataFromTermVisitor void visit(ProtonRank &) override {} void visit(ProtonWeakAnd &) override {} void visit(ProtonSameElement &) override { } - void visit(search::query::TrueQueryNode &) override {} - void visit(search::query::FalseQueryNode &) override {} + void visit(ProtonTrue &) override {} + void visit(ProtonFalse &) override {} void visit(ProtonWeightedSetTerm &n) override { visitTerm(n); } void visit(ProtonDotProduct &n) override { visitTerm(n); } diff --git a/searchcore/src/vespa/searchcore/proton/matching/unpacking_iterators_optimizer.cpp b/searchcore/src/vespa/searchcore/proton/matching/unpacking_iterators_optimizer.cpp index bcb482a58ab..d60bc53aa57 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/unpacking_iterators_optimizer.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/unpacking_iterators_optimizer.cpp @@ -57,8 +57,8 @@ struct TermExpander : QueryVisitor { void visit(PredicateQuery &) override {} void visit(RegExpTerm &) override {} void visit(NearestNeighborTerm &) override {} - void visit(search::query::TrueQueryNode &) override {} - void visit(search::query::FalseQueryNode &) override {} + void visit(TrueQueryNode &) override {} + void visit(FalseQueryNode &) override {} void flush(Intermediate &parent) { for (Node::UP &term: terms) { -- cgit v1.2.3