diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-15 14:46:42 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-15 14:46:42 +0200 |
commit | 141bb9f1c45016a9f4013e98abb1033745d8ff53 (patch) | |
tree | fe748bba21907a0a17a7fba46413e3dc79ebea91 /searchlib | |
parent | be1234f60d8a2b5858bbee4e1f40f0bfb9a63649 (diff) |
Nested namespace
Diffstat (limited to 'searchlib')
4 files changed, 22 insertions, 29 deletions
diff --git a/searchlib/src/vespa/searchlib/engine/docsumapi.cpp b/searchlib/src/vespa/searchlib/engine/docsumapi.cpp index 6e5c9b20af7..8ba59164831 100644 --- a/searchlib/src/vespa/searchlib/engine/docsumapi.cpp +++ b/searchlib/src/vespa/searchlib/engine/docsumapi.cpp @@ -2,8 +2,7 @@ #include "docsumapi.h" #include <cassert> -namespace search { -namespace engine { +namespace search::engine { DocsumReply::UP DocsumServer::getDocsums(DocsumRequest::UP request) @@ -14,4 +13,3 @@ DocsumServer::getDocsums(DocsumRequest::UP request) } } -} diff --git a/searchlib/src/vespa/searchlib/engine/docsumapi.h b/searchlib/src/vespa/searchlib/engine/docsumapi.h index 0d944d533b2..dc51a7319a9 100644 --- a/searchlib/src/vespa/searchlib/engine/docsumapi.h +++ b/searchlib/src/vespa/searchlib/engine/docsumapi.h @@ -5,8 +5,7 @@ #include "docsumrequest.h" #include "docsumreply.h" -namespace search { -namespace engine { +namespace search::engine { /** * A docsum client is the object being notified of the completion of @@ -69,6 +68,4 @@ public: virtual ~DocsumServer() {} }; -} // namespace engine -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/engine/docsumrequest.h b/searchlib/src/vespa/searchlib/engine/docsumrequest.h index 1ac497961be..a0955aaa473 100644 --- a/searchlib/src/vespa/searchlib/engine/docsumrequest.h +++ b/searchlib/src/vespa/searchlib/engine/docsumrequest.h @@ -8,9 +8,9 @@ #include "request.h" #include "source_description.h" -namespace search { -namespace fs4transport { class FS4Packet_GETDOCSUMSX; } -namespace engine { +namespace search::fs4transport { class FS4Packet_GETDOCSUMSX; } + +namespace search::engine { class DocsumRequest : public Request { @@ -91,6 +91,4 @@ public: bool useRootSlime() const { return _useRootSlime; } }; -} // namespace engine -} // namespace search - +} diff --git a/searchlib/src/vespa/searchlib/engine/propertiesmap.h b/searchlib/src/vespa/searchlib/engine/propertiesmap.h index f96790abbd9..e732553ea52 100644 --- a/searchlib/src/vespa/searchlib/engine/propertiesmap.h +++ b/searchlib/src/vespa/searchlib/engine/propertiesmap.h @@ -5,8 +5,7 @@ #include <vespa/searchlib/fef/properties.h> #include <vespa/searchlib/common/mapnames.h> -namespace search { -namespace engine { +namespace search::engine { /** * A simple wrapper class used to hold multiple named collections of @@ -15,8 +14,8 @@ namespace engine { class PropertiesMap { private: - typedef search::fef::Properties Props; - typedef vespalib::hash_map<vespalib::string, Props> PropsMap; + using Props = search::fef::Properties; + using PropsMap = vespalib::hash_map<vespalib::string, Props>; static Props _emptyProperties; PropsMap _propertiesMap; @@ -29,7 +28,7 @@ private: * @param name name of properties * @return the properties **/ - const search::fef::Properties &lookup(const vespalib::stringref &name) const; + const Props &lookup(const vespalib::stringref &name) const; public: typedef PropsMap::const_iterator ITR; @@ -44,7 +43,7 @@ public: * @param name name of properties * @return the properties **/ - search::fef::Properties &lookupCreate(const vespalib::stringref &name); + Props &lookupCreate(const vespalib::stringref &name); /** * Obtain the number of named collection of properties held by @@ -73,7 +72,7 @@ public: * * @return rank properties **/ - const search::fef::Properties &rankProperties() const { + const Props &rankProperties() const { return lookup(MapNames::RANK); } @@ -83,7 +82,7 @@ public: * * @return feature overrides **/ - const search::fef::Properties &featureOverrides() const { + const Props &featureOverrides() const { return lookup(MapNames::FEATURE); } @@ -93,7 +92,7 @@ public: * * @return highlight terms properties **/ - const search::fef::Properties &highlightTerms() const { + const Props &highlightTerms() const { return lookup(MapNames::HIGHLIGHTTERMS); } @@ -102,7 +101,7 @@ public: * * @return match properties **/ - const search::fef::Properties &matchProperties() const { + const Props &matchProperties() const { return lookup(MapNames::MATCH); } @@ -111,21 +110,22 @@ public: * * @return cache properties **/ - const search::fef::Properties &cacheProperties() const { + const Props &cacheProperties() const { return lookup(MapNames::CACHES); } + Props &cacheProperties() { + return lookupCreate(MapNames::CACHES); + } /** * Obtain model overrides * * @return model properties **/ - const search::fef::Properties &modelOverrides() const { + const Props &modelOverrides() const { return lookup(MapNames::MODEL); } }; -} // namespace engine -} // namespace search - +} |