diff options
author | Henning Baldersheim <balder@oath.com> | 2018-07-25 12:51:35 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-07-25 12:51:35 +0200 |
commit | 5bf7c17054cab0f8953e72615b0c1ef3cb734ff8 (patch) | |
tree | 4daccffee35d2b6092ec475490e0d9d16a6b218b /searchcommon | |
parent | e3af3d215feb1e416b27b92bbf421dde281f3a09 (diff) |
Nested namespaces
Diffstat (limited to 'searchcommon')
14 files changed, 38 insertions, 105 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: }; } -} - |