summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher/expression_tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/matcher/expression_tree.h')
-rw-r--r--src/mongo/db/matcher/expression_tree.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mongo/db/matcher/expression_tree.h b/src/mongo/db/matcher/expression_tree.h
index ddd372db654..d6d1fec2159 100644
--- a/src/mongo/db/matcher/expression_tree.h
+++ b/src/mongo/db/matcher/expression_tree.h
@@ -131,6 +131,14 @@ public:
virtual void serialize(BSONObjBuilder* out, bool includePath) const;
bool isTriviallyTrue() const final;
+
+ void acceptVisitor(MatchExpressionMutableVisitor* visitor) final {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(MatchExpressionConstVisitor* visitor) const final {
+ visitor->visit(this);
+ }
};
class OrMatchExpression : public ListOfMatchExpression {
@@ -160,6 +168,14 @@ public:
virtual void serialize(BSONObjBuilder* out, bool includePath) const;
bool isTriviallyFalse() const final;
+
+ void acceptVisitor(MatchExpressionMutableVisitor* visitor) final {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(MatchExpressionConstVisitor* visitor) const final {
+ visitor->visit(this);
+ }
};
class NorMatchExpression : public ListOfMatchExpression {
@@ -187,6 +203,14 @@ public:
virtual void debugString(StringBuilder& debug, int indentationLevel = 0) const;
virtual void serialize(BSONObjBuilder* out, bool includePath) const;
+
+ void acceptVisitor(MatchExpressionMutableVisitor* visitor) final {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(MatchExpressionConstVisitor* visitor) const final {
+ visitor->visit(this);
+ }
};
class NotMatchExpression final : public MatchExpression {
@@ -240,6 +264,14 @@ public:
return MatchCategory::kLogical;
}
+ void acceptVisitor(MatchExpressionMutableVisitor* visitor) final {
+ visitor->visit(this);
+ }
+
+ void acceptVisitor(MatchExpressionConstVisitor* visitor) const final {
+ visitor->visit(this);
+ }
+
private:
static void serializeNotExpressionToNor(MatchExpression* exp,
BSONObjBuilder* out,