summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/projection_ast.h
diff options
context:
space:
mode:
authorAnton Korshunov <anton.korshunov@mongodb.com>2019-10-11 20:13:48 +0000
committerevergreen <evergreen@mongodb.com>2019-10-11 20:13:48 +0000
commit70383ed065e8798aafc4394af7c6d2ac92927f41 (patch)
tree6f7f64aea51387ed436efd36fdc24e6932489be1 /src/mongo/db/query/projection_ast.h
parent34719559a9ec4bd494a59d269d227d06b086affb (diff)
downloadmongo-70383ed065e8798aafc4394af7c6d2ac92927f41.tar.gz
SERVER-42423 Use ProjectionExecutor in ProjectionStageDefault
Diffstat (limited to 'src/mongo/db/query/projection_ast.h')
-rw-r--r--src/mongo/db/query/projection_ast.h45
1 files changed, 37 insertions, 8 deletions
diff --git a/src/mongo/db/query/projection_ast.h b/src/mongo/db/query/projection_ast.h
index 2c136ba0a00..8a279fbbf8c 100644
--- a/src/mongo/db/query/projection_ast.h
+++ b/src/mongo/db/query/projection_ast.h
@@ -67,7 +67,8 @@ public:
virtual std::unique_ptr<ASTNode> clone() const = 0;
- virtual void acceptVisitor(ProjectionASTVisitor* visitor) = 0;
+ virtual void acceptVisitor(ProjectionASTMutableVisitor* visitor) = 0;
+ virtual void acceptVisitor(ProjectionASTConstVisitor* visitor) const = 0;
const ASTNodeVector& children() const {
return _children;
@@ -103,7 +104,11 @@ public:
return std::make_unique<MatchExpressionASTNode>(*this);
}
- void acceptVisitor(ProjectionASTVisitor* visitor) override {
+ void acceptVisitor(ProjectionASTMutableVisitor* visitor) override {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(ProjectionASTConstVisitor* visitor) const override {
visitor->visit(this);
}
@@ -124,7 +129,11 @@ public:
invariant(_children.size() == _fieldNames.size());
}
- void acceptVisitor(ProjectionASTVisitor* visitor) override {
+ void acceptVisitor(ProjectionASTMutableVisitor* visitor) override {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(ProjectionASTConstVisitor* visitor) const override {
visitor->visit(this);
}
@@ -163,7 +172,11 @@ public:
addChildToInternalVector(std::move(child));
}
- void acceptVisitor(ProjectionASTVisitor* visitor) override {
+ void acceptVisitor(ProjectionASTMutableVisitor* visitor) override {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(ProjectionASTConstVisitor* visitor) const override {
visitor->visit(this);
}
@@ -176,7 +189,11 @@ class ProjectionSliceASTNode final : public ASTNode {
public:
ProjectionSliceASTNode(boost::optional<int> skip, int limit) : _skip(skip), _limit(limit) {}
- void acceptVisitor(ProjectionASTVisitor* visitor) override {
+ void acceptVisitor(ProjectionASTMutableVisitor* visitor) override {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(ProjectionASTConstVisitor* visitor) const override {
visitor->visit(this);
}
@@ -204,7 +221,11 @@ public:
addChildToInternalVector(std::move(child));
}
- void acceptVisitor(ProjectionASTVisitor* visitor) override {
+ void acceptVisitor(ProjectionASTMutableVisitor* visitor) override {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(ProjectionASTConstVisitor* visitor) const override {
visitor->visit(this);
}
@@ -228,7 +249,11 @@ public:
_expr = clonedExpr;
}
- void acceptVisitor(ProjectionASTVisitor* visitor) override {
+ void acceptVisitor(ProjectionASTMutableVisitor* visitor) override {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(ProjectionASTConstVisitor* visitor) const override {
visitor->visit(this);
}
@@ -252,7 +277,11 @@ class BooleanConstantASTNode final : public ASTNode {
public:
BooleanConstantASTNode(bool val) : _val(val) {}
- void acceptVisitor(ProjectionASTVisitor* visitor) override {
+ void acceptVisitor(ProjectionASTMutableVisitor* visitor) override {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(ProjectionASTConstVisitor* visitor) const override {
visitor->visit(this);
}