diff options
38 files changed, 101 insertions, 243 deletions
diff --git a/searchcommon/src/vespa/searchcommon/attribute/attributecontent.h b/searchcommon/src/vespa/searchcommon/attribute/attributecontent.h index 6c48b02f357..508a2d04c27 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/attributecontent.h +++ b/searchcommon/src/vespa/searchcommon/attribute/attributecontent.h @@ -3,10 +3,9 @@ #pragma once #include "iattributevector.h" -#include <stdint.h> +#include <cstdint> -namespace search { -namespace attribute { +namespace search::attribute { /** @@ -154,7 +153,6 @@ public: } }; - typedef AttributeContent<double> FloatContent; typedef AttributeContent<const char *> ConstCharContent; typedef AttributeContent<IAttributeVector::largeint_t> IntegerContent; @@ -166,7 +164,4 @@ typedef AttributeContent<IAttributeVector::WeightedString> WeightedStringCont typedef AttributeContent<IAttributeVector::WeightedEnum> WeightedEnumContent; typedef IAttributeVector::EnumHandle EnumHandle; - -} // namespace attribute -} // namespace search - +} diff --git a/searchcommon/src/vespa/searchcommon/attribute/basictype.cpp b/searchcommon/src/vespa/searchcommon/attribute/basictype.cpp index c3cf0905b27..67093c686b5 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/basictype.cpp +++ b/searchcommon/src/vespa/searchcommon/attribute/basictype.cpp @@ -3,8 +3,7 @@ #include <vespa/searchcommon/attribute/basictype.h> #include <vespa/vespalib/util/exceptions.h> -namespace search { -namespace attribute { +namespace search::attribute { const BasicType::TypeInfo BasicType::_typeTable[BasicType::MAX_TYPE] = { { BasicType::NONE, 0, "none" }, @@ -31,11 +30,8 @@ BasicType::asType(const vespalib::string &t) return _typeTable[i]._type; } } - throw vespalib::IllegalStateException(t + - " not recognized as " - "valid attribute data type"); + throw vespalib::IllegalStateException(t + " not recognized as valid attribute data type"); return NONE; } } -} diff --git a/searchcommon/src/vespa/searchcommon/attribute/basictype.h b/searchcommon/src/vespa/searchcommon/attribute/basictype.h index d7023aa1c59..3a2a319afd8 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/basictype.h +++ b/searchcommon/src/vespa/searchcommon/attribute/basictype.h @@ -4,8 +4,7 @@ #include <vespa/vespalib/stllike/string.h> -namespace search { -namespace attribute { +namespace search::attribute { class BasicType { @@ -66,5 +65,3 @@ class BasicType }; } -} - diff --git a/searchcommon/src/vespa/searchcommon/attribute/collectiontype.cpp b/searchcommon/src/vespa/searchcommon/attribute/collectiontype.cpp index 1d0dcc5328b..d5d33718183 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/collectiontype.cpp +++ b/searchcommon/src/vespa/searchcommon/attribute/collectiontype.cpp @@ -3,8 +3,7 @@ #include <vespa/searchcommon/attribute/collectiontype.h> #include <vespa/vespalib/util/exceptions.h> -namespace search { -namespace attribute { +namespace search::attribute { const CollectionType::TypeInfo CollectionType::_typeTable[CollectionType::MAX_TYPE] = { { CollectionType::SINGLE, "single" }, @@ -20,11 +19,8 @@ CollectionType::asType(const vespalib::string &t) return _typeTable[i]._type; } } - throw vespalib::IllegalStateException(t + - " not recognized as valid attribute " - "collection type"); + throw vespalib::IllegalStateException(t + " not recognized as valid attribute collection type"); return SINGLE; } } -} diff --git a/searchcommon/src/vespa/searchcommon/attribute/collectiontype.h b/searchcommon/src/vespa/searchcommon/attribute/collectiontype.h index b5b43083307..2cd46ce2bba 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/collectiontype.h +++ b/searchcommon/src/vespa/searchcommon/attribute/collectiontype.h @@ -4,8 +4,7 @@ #include <vespa/vespalib/stllike/string.h> -namespace search { -namespace attribute { +namespace search::attribute { class CollectionType { @@ -74,5 +73,3 @@ class CollectionType }; } -} - diff --git a/searchcommon/src/vespa/searchcommon/attribute/config.cpp b/searchcommon/src/vespa/searchcommon/attribute/config.cpp index 36dd0c94b40..221924a1689 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/config.cpp +++ b/searchcommon/src/vespa/searchcommon/attribute/config.cpp @@ -20,10 +20,7 @@ Config::Config() : { } -Config::Config(BasicType bt, - CollectionType ct, - bool fastSearch_, - bool huge_) +Config::Config(BasicType bt, CollectionType ct, bool fastSearch_, bool huge_) : _basicType(bt), _type(ct), _fastSearch(fastSearch_), @@ -41,6 +38,6 @@ Config::Config(BasicType bt, Config::Config(const Config &) = default; Config & Config::operator = (const Config &) = default; -Config::~Config() {} +Config::~Config() = default; } diff --git a/searchcommon/src/vespa/searchcommon/attribute/config.h b/searchcommon/src/vespa/searchcommon/attribute/config.h index 8092d620f36..683b45b59e5 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/config.h +++ b/searchcommon/src/vespa/searchcommon/attribute/config.h @@ -9,8 +9,7 @@ #include <vespa/searchcommon/common/compaction_strategy.h> #include <vespa/eval/eval/value_type.h> -namespace search { -namespace attribute { +namespace search::attribute { class Config { @@ -120,6 +119,5 @@ private: PredicateParams _predicateParams; vespalib::eval::ValueType _tensorType; }; -} // namespace attribute -} // namespace search +} diff --git a/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h b/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h index 05ccbc7628e..be6b8d213d8 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h +++ b/searchcommon/src/vespa/searchcommon/attribute/i_search_context.h @@ -5,7 +5,6 @@ #include <vespa/searchcommon/common/range.h> #include <vespa/vespalib/stllike/string.h> - namespace search::fef { class TermFieldMatchData; } namespace search::queryeval { class SearchIterator; } namespace search { class QueryTermBase; } diff --git a/searchcommon/src/vespa/searchcommon/attribute/iattributecontext.h b/searchcommon/src/vespa/searchcommon/attribute/iattributecontext.h index 2ba61512338..c283abf3ced 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/iattributecontext.h +++ b/searchcommon/src/vespa/searchcommon/attribute/iattributecontext.h @@ -3,11 +3,8 @@ #pragma once #include "iattributevector.h" -#include <vector> -#include <memory> -namespace search { -namespace attribute { +namespace search::attribute { /** * This is an interface used to access all registered attribute vectors. @@ -53,6 +50,4 @@ public: virtual ~IAttributeContext() {} }; -} // namespace attribute -} // namespace search - +} diff --git a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h index 08bb3153838..0d3e58331c6 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h +++ b/searchcommon/src/vespa/searchcommon/attribute/iattributevector.h @@ -2,22 +2,21 @@ #pragma once -#include <vector> #include "collectiontype.h" #include "basictype.h" #include <vespa/searchcommon/common/iblobconverter.h> -#include <vespa/vespalib/stllike/string.h> +#include <vector> namespace search { + class IDocumentWeightAttribute; + class QueryTermSimple; +} -class IDocumentWeightAttribute; -class QueryTermSimple; - -namespace tensor { -class ITensorAttribute; +namespace search::tensor { + class ITensorAttribute; } -namespace attribute { +namespace search::attribute { class ISearchContext; class SearchContextParams; @@ -438,6 +437,4 @@ private: }; -} // namespace attribute -} // namespace search - +} diff --git a/searchcommon/src/vespa/searchcommon/attribute/predicate_params.h b/searchcommon/src/vespa/searchcommon/attribute/predicate_params.h index 5510da7f54e..6a49bdd4d8e 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/predicate_params.h +++ b/searchcommon/src/vespa/searchcommon/attribute/predicate_params.h @@ -4,8 +4,7 @@ #include "persistent_predicate_params.h" -namespace search { -namespace attribute { +namespace search::attribute { /* * Parameters for predicate attributes. @@ -28,5 +27,4 @@ public: } }; -} // namespace attribute -} // namespace search +} diff --git a/searchcommon/src/vespa/searchcommon/attribute/status.cpp b/searchcommon/src/vespa/searchcommon/attribute/status.cpp index 09b1e00a35e..d6d684a9f56 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/status.cpp +++ b/searchcommon/src/vespa/searchcommon/attribute/status.cpp @@ -1,9 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/searchcommon/attribute/status.h> +#include "status.h" -namespace search { -namespace attribute { +namespace search::attribute { Status::Status(const vespalib::string &) : _numDocs (0), @@ -42,8 +41,7 @@ Status::Status() vespalib::string -Status::createName(const vespalib::stringref &index, - const vespalib::stringref &attr) +Status::createName(vespalib::stringref index, vespalib::stringref attr) { vespalib::string name (index); name += ".attribute."; @@ -53,12 +51,8 @@ Status::createName(const vespalib::stringref &index, void -Status::updateStatistics(uint64_t numValues, - uint64_t numUniqueValue, - uint64_t allocated, - uint64_t used, - uint64_t dead, - uint64_t onHold) +Status::updateStatistics(uint64_t numValues, uint64_t numUniqueValue, uint64_t allocated, + uint64_t used, uint64_t dead, uint64_t onHold) { _numValues = numValues; _numUniqueValues = numUniqueValue; @@ -71,4 +65,3 @@ Status::updateStatistics(uint64_t numValues, } } -} diff --git a/searchcommon/src/vespa/searchcommon/attribute/status.h b/searchcommon/src/vespa/searchcommon/attribute/status.h index 3f6a12cb88e..dc1ccc4d5d3 100644 --- a/searchcommon/src/vespa/searchcommon/attribute/status.h +++ b/searchcommon/src/vespa/searchcommon/attribute/status.h @@ -4,8 +4,7 @@ #include <vespa/vespalib/stllike/string.h> -namespace search { -namespace attribute { +namespace search::attribute { class Status { @@ -14,13 +13,8 @@ public: Status(const vespalib::string &name); Status(); - void - updateStatistics(uint64_t numValues, - uint64_t numUniqueValue, - uint64_t allocated, - uint64_t used, - uint64_t dead, - uint64_t onHold); + void updateStatistics(uint64_t numValues, uint64_t numUniqueValue, uint64_t allocated, + uint64_t used, uint64_t dead, uint64_t onHold); uint64_t getNumDocs() const { return _numDocs; } uint64_t getNumValues() const { return _numValues; } @@ -33,32 +27,18 @@ public: uint64_t getLastSyncToken() const { return _lastSyncToken; } uint64_t getUpdateCount() const { return _updates; } uint64_t getNonIdempotentUpdateCount() const { return _nonIdempotentUpdates; } - uint32_t - getBitVectors() const - { - return _bitVectors; - } + uint32_t getBitVectors() const { return _bitVectors; } void setNumDocs(uint64_t v) { _numDocs = v; } void incNumDocs() { ++_numDocs; } void setLastSyncToken(uint64_t v) { _lastSyncToken = v; } void incUpdates(uint64_t v=1) { _updates += v; } void incNonIdempotentUpdates(uint64_t v = 1) { _nonIdempotentUpdates += v; } - void - incBitVectors() - { - ++_bitVectors; - } - - void - decBitVectors() - { - --_bitVectors; - } + void incBitVectors() { ++_bitVectors; } + void decBitVectors() { --_bitVectors; } static vespalib::string - createName(const vespalib::stringref &index, - const vespalib::stringref & attr); + createName(vespalib::stringref index, vespalib::stringref attr); private: uint64_t _numDocs; uint64_t _numValues; @@ -76,5 +56,3 @@ private: }; } -} - diff --git a/searchcommon/src/vespa/searchcommon/common/iblobconverter.h b/searchcommon/src/vespa/searchcommon/common/iblobconverter.h index f9f326b8c69..428a1d7c296 100644 --- a/searchcommon/src/vespa/searchcommon/common/iblobconverter.h +++ b/searchcommon/src/vespa/searchcommon/common/iblobconverter.h @@ -5,8 +5,7 @@ #include <vespa/vespalib/util/buffer.h> #include <memory> -namespace search { -namespace common { +namespace search::common { class BlobConverter { @@ -21,5 +20,3 @@ private: }; } -} - diff --git a/searchcore/src/vespa/searchcore/proton/matching/i_match_loop_communicator.h b/searchcore/src/vespa/searchcore/proton/matching/i_match_loop_communicator.h index 04440831045..c22232d47db 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/i_match_loop_communicator.h +++ b/searchcore/src/vespa/searchcore/proton/matching/i_match_loop_communicator.h @@ -2,14 +2,12 @@ #pragma once -#include <vespa/searchlib/common/feature.h> #include <vespa/searchlib/queryeval/scores.h> #include <utility> #include <cstddef> #include <vector> -namespace proton { -namespace matching { +namespace proton::matching { struct IMatchLoopCommunicator { typedef search::feature_t feature_t; @@ -31,6 +29,4 @@ struct IMatchLoopCommunicator { virtual ~IMatchLoopCommunicator() {} }; -} // namespace matching -} // namespace proton - +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.cpp index fa41c73838b..c3c3895cfbe 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.cpp @@ -3,15 +3,14 @@ #include "match_loop_communicator.h" #include <vespa/vespalib/util/priority_queue.h> -namespace proton { -namespace matching { +namespace proton:: matching { MatchLoopCommunicator::MatchLoopCommunicator(size_t threads, size_t topN) : _estimate_match_frequency(threads), _selectBest(threads, topN), _rangeCover(threads) {} -MatchLoopCommunicator::~MatchLoopCommunicator() {} +MatchLoopCommunicator::~MatchLoopCommunicator() = default; void MatchLoopCommunicator::EstimateMatchFrequency::mingle() @@ -72,5 +71,4 @@ MatchLoopCommunicator::RangeCover::mingle() } } -} // namespace matching -} // namespace proton +}
\ No newline at end of file diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.h b/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.h index 3b83cb471f7..c1eec37299f 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_loop_communicator.h @@ -5,8 +5,7 @@ #include "i_match_loop_communicator.h" #include <vespa/vespalib/util/rendezvous.h> -namespace proton { -namespace matching { +namespace proton::matching { class MatchLoopCommunicator : public IMatchLoopCommunicator { @@ -14,13 +13,13 @@ private: struct EstimateMatchFrequency : vespalib::Rendezvous<Matches, double> { EstimateMatchFrequency(size_t n) : vespalib::Rendezvous<Matches, double>(n) {} - virtual void mingle() override; + void mingle() override; }; struct SelectBest : vespalib::Rendezvous<std::vector<feature_t>, size_t> { size_t topN; SelectBest(size_t n, size_t topN_in) : vespalib::Rendezvous<std::vector<feature_t>, size_t>(n), topN(topN_in) {} - virtual void mingle() override; + void mingle() override; bool cmp(const uint32_t &a, const uint32_t &b) { return (in(a)[out(a)] > in(b)[out(b)]); } @@ -34,8 +33,7 @@ private: }; struct RangeCover : vespalib::Rendezvous<RangePair, RangePair> { RangeCover(size_t n) - : vespalib::Rendezvous<RangePair, RangePair>(n) {} - virtual void mingle() override; + : vespalib::Rendezvous<RangePair, RangePair>(n) {}void mingle() override; }; EstimateMatchFrequency _estimate_match_frequency; SelectBest _selectBest; @@ -45,17 +43,15 @@ public: MatchLoopCommunicator(size_t threads, size_t topN); ~MatchLoopCommunicator(); - virtual double estimate_match_frequency(const Matches &matches) override { + double estimate_match_frequency(const Matches &matches) override { return _estimate_match_frequency.rendezvous(matches); } - virtual size_t selectBest(const std::vector<feature_t> &sortedScores) override { + size_t selectBest(const std::vector<feature_t> &sortedScores) override { return _selectBest.rendezvous(sortedScores); } - virtual RangePair rangeCover(const RangePair &ranges) override { + RangePair rangeCover(const RangePair &ranges) override { return _rangeCover.rendezvous(ranges); } }; -} // namespace matching -} // namespace proton - +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp index 370c4b930e1..0eb49aec754 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_master.cpp @@ -10,8 +10,7 @@ #include <vespa/log/log.h> LOG_SETUP(".proton.matching.match_master"); -namespace proton { -namespace matching { +namespace proton::matching { using namespace search::fef; using search::queryeval::SearchIterator; @@ -23,15 +22,15 @@ struct TimedMatchLoopCommunicator : IMatchLoopCommunicator { IMatchLoopCommunicator &communicator; fastos::StopWatch rerank_time; TimedMatchLoopCommunicator(IMatchLoopCommunicator &com) : communicator(com) {} - virtual double estimate_match_frequency(const Matches &matches) override { + double estimate_match_frequency(const Matches &matches) override { return communicator.estimate_match_frequency(matches); } - virtual size_t selectBest(const std::vector<feature_t> &sortedScores) override { + size_t selectBest(const std::vector<feature_t> &sortedScores) override { size_t result = communicator.selectBest(sortedScores); rerank_time.start(); return result; } - virtual RangePair rangeCover(const RangePair &ranges) override { + RangePair rangeCover(const RangePair &ranges) override { RangePair result = communicator.rangeCover(ranges); rerank_time.stop(); return result; @@ -131,18 +130,15 @@ MatchMaster::getFeatureSet(const MatchToolsFactory &matchToolsFactory, if (search.seek(docs[i])) { uint32_t docId = search.getDocId(); search.unpack(docId); - search::feature_t * f = fs.getFeaturesByIndex( - fs.addDocId(docId)); + search::feature_t * f = fs.getFeaturesByIndex(fs.addDocId(docId)); for (uint32_t j = 0; j < featureNames.size(); ++j) { f[j] = resolver.resolve(j).as_number(docId); } } else { - LOG(debug, "getFeatureSet: Did not find hit for docid '%u'. " - "Skipping hit", docs[i]); + LOG(debug, "getFeatureSet: Did not find hit for docid '%u'. Skipping hit", docs[i]); } } return retval; } -} // namespace proton::matching -} // namespace proton +} diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_master.h b/searchcore/src/vespa/searchcore/proton/matching/match_master.h index b9980023259..4c6463cf75d 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_master.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_master.h @@ -8,8 +8,7 @@ namespace vespalib { class ThreadBundle; } namespace search { class FeatureSet; } -namespace proton { -namespace matching { +namespace proton::matching { class MatchToolsFactory; class MatchParams; @@ -37,6 +36,4 @@ public: static MatchingStats getStats(MatchMaster && rhs) { return std::move(rhs._stats); } }; -} // namespace proton::matching -} // namespace proton - +} diff --git a/searchlib/src/vespa/searchlib/attribute/diversity.cpp b/searchlib/src/vespa/searchlib/attribute/diversity.cpp index 14e05afa8f0..4c6fe054b12 100644 --- a/searchlib/src/vespa/searchlib/attribute/diversity.cpp +++ b/searchlib/src/vespa/searchlib/attribute/diversity.cpp @@ -2,10 +2,6 @@ #include "diversity.hpp" -namespace search { -namespace attribute { -namespace diversity { +namespace search::attribute::diversity { } -} -} diff --git a/searchlib/src/vespa/searchlib/attribute/diversity.h b/searchlib/src/vespa/searchlib/attribute/diversity.h index dff658d99d7..fe2874a65a1 100644 --- a/searchlib/src/vespa/searchlib/attribute/diversity.h +++ b/searchlib/src/vespa/searchlib/attribute/diversity.h @@ -14,9 +14,7 @@ * diversified results based on a secondary attribute. **/ -namespace search { -namespace attribute { -namespace diversity { +namespace search::attribute::diversity { template <typename ITR> class ForwardRange @@ -227,6 +225,4 @@ void diversify(bool forward, const DictItr &lower, const DictItr &upper, const P } } -} // namespace search::attribute::diversity -} // namespace search::attribute -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/attribute/diversity.hpp b/searchlib/src/vespa/searchlib/attribute/diversity.hpp index 9261bb482f9..698f482dec1 100644 --- a/searchlib/src/vespa/searchlib/attribute/diversity.hpp +++ b/searchlib/src/vespa/searchlib/attribute/diversity.hpp @@ -4,9 +4,7 @@ #include "diversity.h" -namespace search { -namespace attribute { -namespace diversity { +namespace search::attribute::diversity { template <typename ITR> ForwardRange<ITR>::ForwardRange(const ForwardRange &) = default; @@ -18,7 +16,7 @@ ForwardRange<ITR>::ForwardRange(const ITR &lower, const ITR &upper) {} template <typename ITR> -ForwardRange<ITR>::~ForwardRange() { } +ForwardRange<ITR>::~ForwardRange() = default; template <typename ITR> ReverseRange<ITR>::ReverseRange(const ReverseRange &) = default; @@ -31,8 +29,6 @@ ReverseRange<ITR>::ReverseRange(const ITR &lower, const ITR &upper) template <typename ITR> -ReverseRange<ITR>::~ReverseRange() { } +ReverseRange<ITR>::~ReverseRange() = default; } -} -} diff --git a/searchlib/src/vespa/searchlib/features/queryterm.h b/searchlib/src/vespa/searchlib/features/queryterm.h index c162b041f38..75902c33022 100644 --- a/searchlib/src/vespa/searchlib/features/queryterm.h +++ b/searchlib/src/vespa/searchlib/features/queryterm.h @@ -6,8 +6,7 @@ #include <vespa/searchlib/fef/iqueryenvironment.h> #include <vespa/searchlib/fef/itermdata.h> -namespace search { -namespace features { +namespace search::features { /** * This class represents a query term with the relevant data. Now also @@ -58,7 +57,4 @@ public: bool lookupConnectedness = false); }; - -} // namespace features -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/features/random_normal_feature.cpp b/searchlib/src/vespa/searchlib/features/random_normal_feature.cpp index c83ec80f6b5..944e691d710 100644 --- a/searchlib/src/vespa/searchlib/features/random_normal_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/random_normal_feature.cpp @@ -8,8 +8,7 @@ #include <vespa/log/log.h> LOG_SETUP(".features.randomnormalfeature"); -namespace search { -namespace features { +namespace search::features { RandomNormalExecutor::RandomNormalExecutor(uint64_t seed, double mean, double stddev) : search::fef::FeatureExecutor(), @@ -78,6 +77,4 @@ RandomNormalBlueprint::createExecutor(const search::fef::IQueryEnvironment &, ve return stash.create<RandomNormalExecutor>(seed, _mean, _stddev); } - -} // namespace features -} // namespace search +}
\ No newline at end of file diff --git a/searchlib/src/vespa/searchlib/features/random_normal_feature.h b/searchlib/src/vespa/searchlib/features/random_normal_feature.h index 2d2429371d9..adf3d3be63f 100644 --- a/searchlib/src/vespa/searchlib/features/random_normal_feature.h +++ b/searchlib/src/vespa/searchlib/features/random_normal_feature.h @@ -6,8 +6,7 @@ #include <vespa/searchlib/fef/featureexecutor.h> #include <vespa/searchlib/util/random_normal.h> -namespace search { -namespace features { +namespace search::features { /** @@ -60,7 +59,4 @@ public: fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; }; - -} // namespace features -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/features/random_normal_stable_feature.cpp b/searchlib/src/vespa/searchlib/features/random_normal_stable_feature.cpp index 5f3cf7fd063..f760f52ee88 100644 --- a/searchlib/src/vespa/searchlib/features/random_normal_stable_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/random_normal_stable_feature.cpp @@ -8,8 +8,7 @@ #include <vespa/log/log.h> LOG_SETUP(".features.randomnormalstablefeature"); -namespace search { -namespace features { +namespace search::features { RandomNormalStableExecutor::RandomNormalStableExecutor(uint64_t seed, double mean, double stddev) : search::fef::FeatureExecutor(), @@ -78,5 +77,4 @@ RandomNormalStableBlueprint::createExecutor(const search::fef::IQueryEnvironment } -} // namespace features -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/features/random_normal_stable_feature.h b/searchlib/src/vespa/searchlib/features/random_normal_stable_feature.h index 129c929ba3d..ab9a53a2df3 100644 --- a/searchlib/src/vespa/searchlib/features/random_normal_stable_feature.h +++ b/searchlib/src/vespa/searchlib/features/random_normal_stable_feature.h @@ -6,8 +6,7 @@ #include <vespa/searchlib/fef/featureexecutor.h> #include <vespa/searchlib/util/random_normal.h> -namespace search { -namespace features { +namespace search::features { /** * Implements the executor for the random normal feature outputting a @@ -61,7 +60,4 @@ public: fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; }; - -} // namespace features -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/features/randomfeature.cpp b/searchlib/src/vespa/searchlib/features/randomfeature.cpp index 937fdb23800..cdedbcadc5e 100644 --- a/searchlib/src/vespa/searchlib/features/randomfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/randomfeature.cpp @@ -9,8 +9,7 @@ #include <vespa/log/log.h> LOG_SETUP(".features.randomfeature"); -namespace search { -namespace features { +namespace search::features { RandomExecutor::RandomExecutor(uint64_t seed, uint64_t matchSeed) : search::fef::FeatureExecutor(), @@ -81,5 +80,4 @@ RandomBlueprint::createExecutor(const search::fef::IQueryEnvironment &env, vespa } -} // namespace features -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/features/randomfeature.h b/searchlib/src/vespa/searchlib/features/randomfeature.h index f326606009c..8ed0e403836 100644 --- a/searchlib/src/vespa/searchlib/features/randomfeature.h +++ b/searchlib/src/vespa/searchlib/features/randomfeature.h @@ -6,8 +6,7 @@ #include <vespa/searchlib/fef/featureexecutor.h> #include <vespa/searchlib/util/rand48.h> -namespace search { -namespace features { +namespace search::features { /** * Implements the executor for the random feature outputting a number in the interval [0, 1>. @@ -23,7 +22,6 @@ public: void execute(uint32_t docId) override; }; - /** * Implements the blueprint for the random feature. */ @@ -45,6 +43,4 @@ public: search::fef::FeatureExecutor &createExecutor(const search::fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; }; - -} // namespace features -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/features/rankingexpressionfeature.cpp b/searchlib/src/vespa/searchlib/features/rankingexpressionfeature.cpp index c6eeafd772f..72865d042e7 100644 --- a/searchlib/src/vespa/searchlib/features/rankingexpressionfeature.cpp +++ b/searchlib/src/vespa/searchlib/features/rankingexpressionfeature.cpp @@ -180,9 +180,7 @@ RankingExpressionBlueprint::RankingExpressionBlueprint(rankingexpression::Expres { } -RankingExpressionBlueprint::~RankingExpressionBlueprint() -{ -} +RankingExpressionBlueprint::~RankingExpressionBlueprint() = default; void RankingExpressionBlueprint::visitDumpFeatures(const fef::IIndexEnvironment &, diff --git a/searchlib/src/vespa/searchlib/features/rankingexpressionfeature.h b/searchlib/src/vespa/searchlib/features/rankingexpressionfeature.h index 5da6c9eae87..85514a4def7 100644 --- a/searchlib/src/vespa/searchlib/features/rankingexpressionfeature.h +++ b/searchlib/src/vespa/searchlib/features/rankingexpressionfeature.h @@ -8,8 +8,7 @@ #include <vespa/searchlib/features/rankingexpression/expression_replacer.h> #include <vespa/searchlib/features/rankingexpression/intrinsic_expression.h> -namespace search { -namespace features { +namespace search::features { //----------------------------------------------------------------------------- @@ -42,7 +41,4 @@ public: fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; }; -//----------------------------------------------------------------------------- - -} // features -} // search +} diff --git a/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp b/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp index 02e44e781d4..61355581214 100644 --- a/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp +++ b/searchlib/src/vespa/searchlib/features/raw_score_feature.cpp @@ -5,14 +5,14 @@ using namespace search::fef; -namespace search { -namespace features { +namespace search::features { RawScoreExecutor::RawScoreExecutor(const search::fef::IQueryEnvironment &env, uint32_t fieldId) : FeatureExecutor(), _handles(), _md(nullptr) { + _handles.reserve(env.getNumTerms()); for (uint32_t i = 0; i < env.getNumTerms(); ++i) { search::fef::TermFieldHandle handle = util::getTermFieldHandle(env, i, fieldId); if (handle != search::fef::IllegalHandle) { @@ -25,8 +25,8 @@ void RawScoreExecutor::execute(uint32_t docId) { feature_t output = 0.0; - for (uint32_t i = 0; i < _handles.size(); ++i) { - const TermFieldMatchData *tfmd = _md->resolveTermField(_handles[i]); + for (auto handle : _handles) { + const TermFieldMatchData *tfmd = _md->resolveTermField(handle); if (tfmd->getDocId() == docId) { output += tfmd->getRawScore(); } @@ -43,8 +43,7 @@ RawScoreExecutor::handle_bind_match_data(const fef::MatchData &md) //----------------------------------------------------------------------------- bool -RawScoreBlueprint::setup(const IIndexEnvironment &, - const ParameterList ¶ms) +RawScoreBlueprint::setup(const IIndexEnvironment &, const ParameterList ¶ms) { _field = params[0].asField(); describeOutput("out", "accumulated raw score for the given field"); @@ -57,5 +56,4 @@ RawScoreBlueprint::createExecutor(const IQueryEnvironment &queryEnv, vespalib::S return stash.create<RawScoreExecutor>(queryEnv, _field->id()); } -} // namespace features -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/features/raw_score_feature.h b/searchlib/src/vespa/searchlib/features/raw_score_feature.h index 0eceba16ffe..db237f036c4 100644 --- a/searchlib/src/vespa/searchlib/features/raw_score_feature.h +++ b/searchlib/src/vespa/searchlib/features/raw_score_feature.h @@ -5,8 +5,7 @@ #include <vespa/searchlib/fef/blueprint.h> #include <vespa/searchlib/fef/featureexecutor.h> -namespace search { -namespace features { +namespace search::features { class RawScoreExecutor : public fef::FeatureExecutor { @@ -40,5 +39,4 @@ public: fef::FeatureExecutor &createExecutor(const fef::IQueryEnvironment &env, vespalib::Stash &stash) const override; }; -} // namespace features -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/fef/iqueryenvironment.h b/searchlib/src/vespa/searchlib/fef/iqueryenvironment.h index a6ed0058c66..a7f268e5c6b 100644 --- a/searchlib/src/vespa/searchlib/fef/iqueryenvironment.h +++ b/searchlib/src/vespa/searchlib/fef/iqueryenvironment.h @@ -3,11 +3,10 @@ #pragma once #include "iindexenvironment.h" +#include "objectstore.h" #include <vespa/searchcommon/attribute/iattributecontext.h> -#include <vespa/searchlib/fef/objectstore.h> -namespace search { -namespace fef { +namespace search::fef { class Location; class Properties; @@ -90,5 +89,4 @@ private: ObjectStore _objectStore; }; -} // namespace fef -} // namespace search +} diff --git a/searchlib/src/vespa/searchlib/fef/itermdata.h b/searchlib/src/vespa/searchlib/fef/itermdata.h index 94b4ed80cf0..95095dfaff0 100644 --- a/searchlib/src/vespa/searchlib/fef/itermdata.h +++ b/searchlib/src/vespa/searchlib/fef/itermdata.h @@ -6,8 +6,7 @@ #include <vespa/searchlib/query/weight.h> #include <cstddef> -namespace search { -namespace fef { +namespace search::fef { /** * Interface to static match data for a single unit (term/phrase/etc). @@ -84,6 +83,4 @@ public: void next() { ++_idx; } }; -} // namespace fef -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/fef/itermfielddata.h b/searchlib/src/vespa/searchlib/fef/itermfielddata.h index a85998d8d52..bb4ab9c5285 100644 --- a/searchlib/src/vespa/searchlib/fef/itermfielddata.h +++ b/searchlib/src/vespa/searchlib/fef/itermfielddata.h @@ -4,8 +4,7 @@ #include "handle.h" -namespace search { -namespace fef { +namespace search::fef { /** * Interface to information about a single field that is being @@ -43,6 +42,4 @@ public: virtual TermFieldHandle getHandle() const = 0; }; -} // namespace fef -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/fef/objectstore.h b/searchlib/src/vespa/searchlib/fef/objectstore.h index b85ce527b8f..a62ca66486c 100644 --- a/searchlib/src/vespa/searchlib/fef/objectstore.h +++ b/searchlib/src/vespa/searchlib/fef/objectstore.h @@ -3,8 +3,7 @@ #include <vespa/vespalib/stllike/hash_map.h> -namespace search { -namespace fef { +namespace search::fef { class Anything { @@ -34,4 +33,3 @@ private: }; } -} diff --git a/searchlib/src/vespa/searchlib/queryeval/scores.h b/searchlib/src/vespa/searchlib/queryeval/scores.h index 4fb2de5d6fa..e8dae898909 100644 --- a/searchlib/src/vespa/searchlib/queryeval/scores.h +++ b/searchlib/src/vespa/searchlib/queryeval/scores.h @@ -4,8 +4,7 @@ #include <vespa/searchlib/common/feature.h> -namespace search { -namespace queryeval { +namespace search::queryeval { struct Scores { feature_t low; @@ -16,6 +15,4 @@ struct Scores { bool isValid() const { return low <= high; } }; -} // namespace queryeval -} // namespace search - +} |