diff options
Diffstat (limited to 'src/mongo/db/matcher/expression_leaf.h')
-rw-r--r-- | src/mongo/db/matcher/expression_leaf.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/src/mongo/db/matcher/expression_leaf.h b/src/mongo/db/matcher/expression_leaf.h index ebc69b1230a..1cb2b77e545 100644 --- a/src/mongo/db/matcher/expression_leaf.h +++ b/src/mongo/db/matcher/expression_leaf.h @@ -200,6 +200,14 @@ public: e->setCollator(_collator); return std::move(e); } + + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } }; class LTEMatchExpression final : public ComparisonMatchExpression { @@ -222,6 +230,14 @@ public: e->setCollator(_collator); return std::move(e); } + + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } }; class LTMatchExpression final : public ComparisonMatchExpression { @@ -244,6 +260,14 @@ public: e->setCollator(_collator); return std::move(e); } + + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } }; class GTMatchExpression final : public ComparisonMatchExpression { @@ -266,6 +290,14 @@ public: e->setCollator(_collator); return std::move(e); } + + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } }; class GTEMatchExpression final : public ComparisonMatchExpression { @@ -288,12 +320,23 @@ public: e->setCollator(_collator); return std::move(e); } + + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } }; class RegexMatchExpression : public LeafMatchExpression { public: static const std::set<char> kValidRegexFlags; + static std::unique_ptr<pcrecpp::RE> makeRegex(const std::string& regex, + const std::string& flags); + RegexMatchExpression(StringData path, const BSONElement& e); RegexMatchExpression(StringData path, StringData regex, StringData options); @@ -327,6 +370,14 @@ public: return _flags; } + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } + private: ExpressionOptimizerFunc getOptimizer() const final { return [](std::unique_ptr<MatchExpression> expression) { return expression; }; @@ -367,6 +418,14 @@ public: return _remainder; } + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } + private: ExpressionOptimizerFunc getOptimizer() const final { return [](std::unique_ptr<MatchExpression> expression) { return expression; }; @@ -396,6 +455,14 @@ public: virtual bool equivalent(const MatchExpression* other) const; + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } + private: ExpressionOptimizerFunc getOptimizer() const final { return [](std::unique_ptr<MatchExpression> expression) { return expression; }; @@ -450,6 +517,14 @@ public: return _hasEmptyArray; } + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } + private: ExpressionOptimizerFunc getOptimizer() const final; @@ -571,6 +646,14 @@ public: } return std::move(bitTestMatchExpression); } + + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } }; class BitsAllClearMatchExpression : public BitTestMatchExpression { @@ -592,6 +675,14 @@ public: } return std::move(bitTestMatchExpression); } + + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } }; class BitsAnySetMatchExpression : public BitTestMatchExpression { @@ -613,6 +704,14 @@ public: } return std::move(bitTestMatchExpression); } + + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } }; class BitsAnyClearMatchExpression : public BitTestMatchExpression { @@ -634,6 +733,14 @@ public: } return std::move(bitTestMatchExpression); } + + void acceptVisitor(MatchExpressionMutableVisitor* visitor) final { + visitor->visit(this); + } + + void acceptVisitor(MatchExpressionConstVisitor* visitor) const final { + visitor->visit(this); + } }; } // namespace mongo |