From 9a032db3d45820f28028bae9e80c92516438ba1f Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 12 Nov 2019 10:31:28 +0000 Subject: Nested namespace --- .../src/vespa/document/select/bodyfielddetector.h | 11 ++- document/src/vespa/document/select/branch.h | 9 +-- .../src/vespa/document/select/cloningvisitor.h | 7 +- document/src/vespa/document/select/compare.h | 7 +- document/src/vespa/document/select/constant.h | 7 +- document/src/vespa/document/select/context.h | 11 ++- document/src/vespa/document/select/doctype.h | 9 +-- document/src/vespa/document/select/gid_filter.h | 6 +- .../src/vespa/document/select/invalidconstant.h | 9 +-- document/src/vespa/document/select/node.h | 9 +-- document/src/vespa/document/select/operator.h | 7 +- document/src/vespa/document/select/parse_utils.h | 6 +- document/src/vespa/document/select/result.h | 4 +- .../src/vespa/document/select/traversingvisitor.h | 5 +- document/src/vespa/document/select/visitor.h | 78 ++++++---------------- 15 files changed, 52 insertions(+), 133 deletions(-) diff --git a/document/src/vespa/document/select/bodyfielddetector.h b/document/src/vespa/document/select/bodyfielddetector.h index 8e9fc83b750..028519c8101 100644 --- a/document/src/vespa/document/select/bodyfielddetector.h +++ b/document/src/vespa/document/select/bodyfielddetector.h @@ -4,10 +4,11 @@ #include "traversingvisitor.h" namespace document { -class DocumentTypeRepo; -class DocumentType; + class DocumentTypeRepo; + class DocumentType; +} -namespace select { +namespace document::select { class BodyFieldDetector : public TraversingVisitor { @@ -47,6 +48,4 @@ public: bool needDocument() const { return _needDocument; } }; -} // namespace select -} // namespace document - +} diff --git a/document/src/vespa/document/select/branch.h b/document/src/vespa/document/select/branch.h index a750c2512f9..8637b41de89 100644 --- a/document/src/vespa/document/select/branch.h +++ b/document/src/vespa/document/select/branch.h @@ -6,8 +6,6 @@ * @brief Base class for branch nodes in the document selection tree. * * @author H�kon Humberset - * @date 2005-06-07 - * @version $Id$ */ #pragma once @@ -16,8 +14,7 @@ #include #include "node.h" -namespace document { -namespace select { +namespace document::select { class Branch : public Node { @@ -91,6 +88,4 @@ public: } }; -} // select -} // document - +} diff --git a/document/src/vespa/document/select/cloningvisitor.h b/document/src/vespa/document/select/cloningvisitor.h index 2c5f94c20a4..adc795042a3 100644 --- a/document/src/vespa/document/select/cloningvisitor.h +++ b/document/src/vespa/document/select/cloningvisitor.h @@ -5,9 +5,7 @@ #include "resultset.h" #include -namespace document { - -namespace select { +namespace document::select { class Node; class ValueNode; @@ -83,6 +81,3 @@ public: }; } - -} - diff --git a/document/src/vespa/document/select/compare.h b/document/src/vespa/document/select/compare.h index a4c6a464899..4fa46c2562f 100644 --- a/document/src/vespa/document/select/compare.h +++ b/document/src/vespa/document/select/compare.h @@ -17,8 +17,7 @@ #include "operator.h" #include -namespace document { -namespace select { +namespace document::select { class ValueNode; @@ -52,6 +51,4 @@ public: const BucketIdFactory &getBucketIdFactory(void) const { return _bucketIdFactory; } }; -} // select -} // document - +} diff --git a/document/src/vespa/document/select/constant.h b/document/src/vespa/document/select/constant.h index 46a98ed7eaa..5766f7c9039 100644 --- a/document/src/vespa/document/select/constant.h +++ b/document/src/vespa/document/select/constant.h @@ -13,8 +13,7 @@ #include "node.h" -namespace document { -namespace select { +namespace document::select { class Constant : public Node { @@ -36,6 +35,4 @@ public: }; -} // select -} // document - +} diff --git a/document/src/vespa/document/select/context.h b/document/src/vespa/document/select/context.h index 208a9eb0ee7..d808e8907ae 100644 --- a/document/src/vespa/document/select/context.h +++ b/document/src/vespa/document/select/context.h @@ -5,12 +5,12 @@ #include namespace document { + class Document; + class DocumentId; + class DocumentUpdate; +} -class Document; -class DocumentId; -class DocumentUpdate; - -namespace select { +namespace document::select { class Value; class VariableMap; @@ -34,4 +34,3 @@ private: }; } -} diff --git a/document/src/vespa/document/select/doctype.h b/document/src/vespa/document/select/doctype.h index e72f4c3b56d..749ecedc25f 100644 --- a/document/src/vespa/document/select/doctype.h +++ b/document/src/vespa/document/select/doctype.h @@ -6,16 +6,13 @@ * @brief Class matching whether a document is of given type or not. * * @author H�kon Humberset - * @date 2005-06-07 - * @version $Id$ */ #pragma once #include "node.h" -namespace document { -namespace select { +namespace document::select { class DocType : public Node { @@ -34,6 +31,4 @@ public: }; -} // select -} // document - +} diff --git a/document/src/vespa/document/select/gid_filter.h b/document/src/vespa/document/select/gid_filter.h index cced811d4dc..a6ea7e083cf 100644 --- a/document/src/vespa/document/select/gid_filter.h +++ b/document/src/vespa/document/select/gid_filter.h @@ -3,8 +3,7 @@ #include -namespace document { -namespace select { +namespace document::select { class Node; @@ -87,5 +86,4 @@ public: } }; -} // select -} // document +} diff --git a/document/src/vespa/document/select/invalidconstant.h b/document/src/vespa/document/select/invalidconstant.h index b99d0f5a066..a3f4a4d2c4b 100644 --- a/document/src/vespa/document/select/invalidconstant.h +++ b/document/src/vespa/document/select/invalidconstant.h @@ -6,16 +6,13 @@ * @brief Class describing an invalid constant in the select tree. * * @author H�kon Humberset - * @date 2005-06-07 - * @version $Id$ */ #pragma once #include "node.h" -namespace document { -namespace select { +namespace document::select { class InvalidConstant : public Node { @@ -31,6 +28,4 @@ public: }; -} // select -} // document - +} diff --git a/document/src/vespa/document/select/node.h b/document/src/vespa/document/select/node.h index 1f5c78785d1..48a64ae63f5 100644 --- a/document/src/vespa/document/select/node.h +++ b/document/src/vespa/document/select/node.h @@ -6,7 +6,6 @@ * @brief Base class for all nodes in the document selection tree. * * @author Håkon Humberset - * @date 2005-06-07 */ #pragma once @@ -14,9 +13,7 @@ #include "resultlist.h" #include "context.h" -namespace document { - -namespace select { +namespace document::select { class Visitor; @@ -55,6 +52,4 @@ protected: } }; -} // select -} // document - +} diff --git a/document/src/vespa/document/select/operator.h b/document/src/vespa/document/select/operator.h index 54ef82b01b2..7383b6cf545 100644 --- a/document/src/vespa/document/select/operator.h +++ b/document/src/vespa/document/select/operator.h @@ -15,8 +15,7 @@ #include "value.h" #include -namespace document { -namespace select { +namespace document::select { class Operator : public Printable { private: @@ -101,6 +100,4 @@ private: ResultList traceImpl(const Value&, const Value&, std::ostream& trace) const; }; -} // select -} // document - +} diff --git a/document/src/vespa/document/select/parse_utils.h b/document/src/vespa/document/select/parse_utils.h index 38c36dfe94a..fb8667f0f7c 100644 --- a/document/src/vespa/document/select/parse_utils.h +++ b/document/src/vespa/document/select/parse_utils.h @@ -1,8 +1,8 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include -#include +#include +#include namespace document::select::util { @@ -14,4 +14,4 @@ bool parse_hex_i64(const char* str, size_t len, int64_t& out); bool parse_i64(const char* str, size_t len, int64_t& out); bool parse_double(const char* str, size_t len, double& out); -} \ No newline at end of file +} diff --git a/document/src/vespa/document/select/result.h b/document/src/vespa/document/select/result.h index 4e30cb5a8af..7688503d2de 100644 --- a/document/src/vespa/document/select/result.h +++ b/document/src/vespa/document/select/result.h @@ -13,13 +13,11 @@ * thus used as it has 3 outcomes.. True, false & invalid. * * @author H�kon Humberset - * @date 2007-20-05 - * @version $Id$ */ #pragma once -#include +#include #include #include diff --git a/document/src/vespa/document/select/traversingvisitor.h b/document/src/vespa/document/select/traversingvisitor.h index f8b0377b102..6b9a4317bea 100644 --- a/document/src/vespa/document/select/traversingvisitor.h +++ b/document/src/vespa/document/select/traversingvisitor.h @@ -3,8 +3,7 @@ #include "visitor.h" -namespace document { -namespace select { +namespace document::select { class TraversingVisitor : public Visitor @@ -32,5 +31,3 @@ public: }; } - -} diff --git a/document/src/vespa/document/select/visitor.h b/document/src/vespa/document/select/visitor.h index c0798c8eb6d..28a91f8d0d4 100644 --- a/document/src/vespa/document/select/visitor.h +++ b/document/src/vespa/document/select/visitor.h @@ -12,8 +12,7 @@ #pragma once -namespace document { -namespace select { +namespace document::select { class And; class Compare; @@ -38,61 +37,24 @@ class Visitor { public: virtual ~Visitor() {} - virtual void - visitAndBranch(const And &) = 0; - - virtual void - visitComparison(const Compare &) = 0; - - virtual void - visitConstant(const Constant &) = 0; - - virtual void - visitInvalidConstant(const InvalidConstant &) = 0; - - virtual void - visitDocumentType(const DocType &) = 0; - - virtual void - visitNotBranch(const Not &) = 0; - - virtual void - visitOrBranch(const Or &) = 0; - - virtual void - visitArithmeticValueNode(const ArithmeticValueNode &) = 0; - - virtual void - visitFunctionValueNode(const FunctionValueNode &) = 0; - - virtual void - visitIdValueNode(const IdValueNode &) = 0; - - virtual void - visitFieldValueNode(const FieldValueNode &) = 0; - - virtual void - visitFloatValueNode(const FloatValueNode &) = 0; - - virtual void - visitVariableValueNode(const VariableValueNode &) = 0; - - virtual void - visitIntegerValueNode(const IntegerValueNode &) = 0; - - virtual void - visitCurrentTimeValueNode(const CurrentTimeValueNode &) = 0; - - virtual void - visitStringValueNode(const StringValueNode &) = 0; - - virtual void - visitNullValueNode(const NullValueNode &) = 0; - - virtual void - visitInvalidValueNode(const InvalidValueNode &) = 0; + virtual void visitAndBranch(const And &) = 0; + virtual void visitComparison(const Compare &) = 0; + virtual void visitConstant(const Constant &) = 0; + virtual void visitInvalidConstant(const InvalidConstant &) = 0; + virtual void visitDocumentType(const DocType &) = 0; + virtual void visitNotBranch(const Not &) = 0; + virtual void visitOrBranch(const Or &) = 0; + virtual void visitArithmeticValueNode(const ArithmeticValueNode &) = 0; + virtual void visitFunctionValueNode(const FunctionValueNode &) = 0; + virtual void visitIdValueNode(const IdValueNode &) = 0; + virtual void visitFieldValueNode(const FieldValueNode &) = 0; + virtual void visitFloatValueNode(const FloatValueNode &) = 0; + virtual void visitVariableValueNode(const VariableValueNode &) = 0; + virtual void visitIntegerValueNode(const IntegerValueNode &) = 0; + virtual void visitCurrentTimeValueNode(const CurrentTimeValueNode &) = 0; + virtual void visitStringValueNode(const StringValueNode &) = 0; + virtual void visitNullValueNode(const NullValueNode &) = 0; + virtual void visitInvalidValueNode(const InvalidValueNode &) = 0; }; -} // select -} // document - +} -- cgit v1.2.3