From ee026cbcbebdd46419fda51fd90e0ad4d43ed21d Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Thu, 16 Jun 2016 11:56:32 +0000 Subject: override final, or final override --- .../vespa/searchcore/proton/matching/querynodes.cpp | 1 - .../vespa/searchcore/proton/matching/querynodes.h | 21 +++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'searchcore') diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp b/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp index b7c5467d8cf..c9d90f1815b 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.cpp @@ -24,7 +24,6 @@ using search::fef::FieldType; using search::fef::IIndexEnvironment; using search::fef::MatchData; using search::fef::MatchDataLayout; -using search::fef::SimpleTermData; using search::fef::TermFieldHandle; using search::query::Node; using search::query::TemplateTermVisitor; diff --git a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h index 13bf3e30c29..7ae07d20cac 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/querynodes.h +++ b/searchcore/src/vespa/searchcore/proton/matching/querynodes.h @@ -76,8 +76,8 @@ uint32_t numTerms(const search::query::Phrase &n) { } // namespace proton::matching:: template -struct ProtonTerm : public Base, - public ProtonTermData +struct ProtonTermNonFinal : public Base, + public ProtonTermData { using Base::Base; @@ -89,10 +89,15 @@ struct ProtonTerm : public Base, } // ITermData interface - virtual uint32_t getPhraseLength() const { return numTerms(*this); } - virtual uint32_t getTermIndex() const { return -1; } - virtual search::query::Weight getWeight() const { return Base::getWeight(); } - virtual uint32_t getUniqueId() const { return Base::getId(); } + uint32_t getPhraseLength() const override final { return numTerms(*this); } + uint32_t getTermIndex() const override final { return -1; } + search::query::Weight getWeight() const override final { return Base::getWeight(); } + uint32_t getUniqueId() const override final { return Base::getId(); } +}; + +template +struct ProtonTerm : public ProtonTermNonFinal { + using ProtonTermNonFinal::ProtonTermNonFinal; }; typedef search::query::SimpleAnd ProtonAnd; @@ -103,10 +108,10 @@ typedef search::query::SimpleOr ProtonOr; typedef search::query::SimpleRank ProtonRank; typedef search::query::SimpleWeakAnd ProtonWeakAnd; -struct ProtonEquiv : public ProtonTerm +struct ProtonEquiv final : public ProtonTermNonFinal { search::fef::MatchDataLayout children_mdl; - using ProtonTerm::ProtonTerm; + using ProtonTermNonFinal::ProtonTermNonFinal; }; typedef ProtonTerm ProtonLocationTerm; -- cgit v1.2.3