diff options
author | James Wahlin <james.wahlin@10gen.com> | 2017-05-01 15:18:17 -0400 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2017-05-03 11:31:32 -0400 |
commit | fff7292a4dec1eb30b36dfb79f6d933fbb1df6b7 (patch) | |
tree | f2693e48a453e42b90d8c5dc01373086a4d92c98 /src/mongo/db/pipeline/expression.h | |
parent | 435d43b66f04fc12fdb4f1e115d1fe9558571334 (diff) | |
download | mongo-fff7292a4dec1eb30b36dfb79f6d933fbb1df6b7.tar.gz |
SERVER-28651 Pass agg Variables root doc via Expression::evaluate()
Diffstat (limited to 'src/mongo/db/pipeline/expression.h')
-rw-r--r-- | src/mongo/db/pipeline/expression.h | 172 |
1 files changed, 76 insertions, 96 deletions
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h index 0bb366223a3..d698fd127f7 100644 --- a/src/mongo/db/pipeline/expression.h +++ b/src/mongo/db/pipeline/expression.h @@ -104,20 +104,8 @@ public: /** * Evaluate expression with respect to the Document given by 'root', and return the result. - * - * This method should only be used for testing. - */ - Value evaluate(const Document& root) const { - getExpressionContext()->variables.setRoot(root); - return evaluate(); - } - - /** - * Evaluate expression and return the result. */ - Value evaluate() const { - return evaluateInternal(); - } + virtual Value evaluate(Document root) const = 0; /** * Parses a BSON Object that could represent an object literal or a functional expression like @@ -165,14 +153,6 @@ public: static std::string removeFieldPrefix(const std::string& prefixedField); /** - * Evaluate the subclass Expression and return result. - * - * Should only be called by subclasses, but can't be protected because they need to call - * this function on each other. - */ - virtual Value evaluateInternal() const = 0; - - /** * Registers an Parser so it can be called from parseExpression. * * DO NOT call this method directly. Instead, use the REGISTER_EXPRESSION macro defined in this @@ -320,13 +300,13 @@ public: explicit ExpressionFromAccumulator(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionFromAccumulator<Accumulator>>(expCtx) {} - Value evaluateInternal() const final { + Value evaluate(Document root) const final { Accumulator accum(this->getExpressionContext()); const size_t n = this->vpOperand.size(); // If a single array arg is given, loop through it passing each member to the accumulator. // If a single, non-array arg is given, pass it directly to the accumulator. if (n == 1) { - Value singleVal = this->vpOperand[0]->evaluateInternal(); + Value singleVal = this->vpOperand[0]->evaluate(root); if (singleVal.getType() == Array) { for (const Value& val : singleVal.getArray()) { accum.process(val, false); @@ -337,7 +317,7 @@ public: } else { // If multiple arguments are given, pass all arguments to the accumulator. for (auto&& argument : this->vpOperand) { - accum.process(argument->evaluateInternal(), false); + accum.process(argument->evaluate(root), false); } } return accum.getValue(false); @@ -372,8 +352,8 @@ public: virtual ~ExpressionSingleNumericArg() {} - Value evaluateInternal() const final { - Value arg = this->vpOperand[0]->evaluateInternal(); + Value evaluate(Document root) const final { + Value arg = this->vpOperand[0]->evaluate(root); if (arg.nullish()) return Value(BSONNULL); @@ -404,7 +384,7 @@ public: explicit ExpressionAdd(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionAdd>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -422,7 +402,7 @@ public: explicit ExpressionAllElementsTrue(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionAllElementsTrue, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -433,7 +413,7 @@ public: : ExpressionVariadic<ExpressionAnd>(expCtx) {} boost::intrusive_ptr<Expression> optimize() final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -451,7 +431,7 @@ public: explicit ExpressionAnyElementTrue(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionAnyElementTrue, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -461,7 +441,7 @@ public: explicit ExpressionArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionArray>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; Value serialize(bool explain) const final; const char* getOpName() const final; }; @@ -472,7 +452,7 @@ public: explicit ExpressionArrayElemAt(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionArrayElemAt, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -481,7 +461,7 @@ public: explicit ExpressionObjectToArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionObjectToArray, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -490,7 +470,7 @@ public: explicit ExpressionArrayToObject(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionArrayToObject, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -508,7 +488,7 @@ class ExpressionCoerceToBool final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; void addDependencies(DepsTracker* deps) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; Value serialize(bool explain) const final; static boost::intrusive_ptr<ExpressionCoerceToBool> create( @@ -542,7 +522,7 @@ public: ExpressionCompare(const boost::intrusive_ptr<ExpressionContext>& expCtx, CmpOp cmpOp) : ExpressionFixedArity<ExpressionCompare, 2>(expCtx), cmpOp(cmpOp) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static boost::intrusive_ptr<Expression> parse( @@ -567,7 +547,7 @@ public: explicit ExpressionConcat(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionConcat>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -581,7 +561,7 @@ public: explicit ExpressionConcatArrays(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionConcatArrays>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -594,7 +574,7 @@ class ExpressionCond final : public ExpressionFixedArity<ExpressionCond, 3> { public: explicit ExpressionCond(const boost::intrusive_ptr<ExpressionContext>& expCtx) : Base(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static boost::intrusive_ptr<Expression> parse( @@ -611,7 +591,7 @@ class ExpressionConstant final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; void addDependencies(DepsTracker* deps) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; Value serialize(bool explain) const final; const char* getOpName() const; @@ -643,7 +623,7 @@ class ExpressionDateToString final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; Value serialize(bool explain) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -674,7 +654,7 @@ public: explicit ExpressionDayOfMonth(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionDayOfMonth, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static inline int extract(const tm& tm) { @@ -688,7 +668,7 @@ public: explicit ExpressionDayOfWeek(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionDayOfWeek, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; // MySQL uses 1-7, tm uses 0-6 @@ -703,7 +683,7 @@ public: explicit ExpressionDayOfYear(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionDayOfYear, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; // MySQL uses 1-366, tm uses 0-365 @@ -718,7 +698,7 @@ public: explicit ExpressionDivide(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionDivide, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -737,7 +717,7 @@ class ExpressionFieldPath final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; void addDependencies(DepsTracker* deps) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; Value serialize(bool explain) const final; /* @@ -776,7 +756,7 @@ private: Variables::Id variable); /* - Internal implementation of evaluateInternal(), used recursively. + Internal implementation of evaluate(), used recursively. The internal implementation doesn't just use a loop because of the possibility that we need to skip over an array. If the path @@ -802,7 +782,7 @@ class ExpressionFilter final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; Value serialize(bool explain) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -843,7 +823,7 @@ public: explicit ExpressionHour(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionHour, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static inline int extract(const tm& tm) { @@ -857,7 +837,7 @@ public: explicit ExpressionIfNull(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIfNull, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -867,7 +847,7 @@ public: explicit ExpressionIn(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIn, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -877,7 +857,7 @@ public: explicit ExpressionIndexOfArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionIndexOfArray, 2, 4>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -887,7 +867,7 @@ public: explicit ExpressionIndexOfBytes(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionIndexOfBytes, 2, 4>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -900,7 +880,7 @@ public: explicit ExpressionIndexOfCP(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionIndexOfCP, 2, 4>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -909,7 +889,7 @@ class ExpressionLet final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; Value serialize(bool explain) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -951,7 +931,7 @@ public: explicit ExpressionLog(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionLog, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -968,7 +948,7 @@ class ExpressionMap final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; Value serialize(bool explain) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -993,7 +973,7 @@ private: class ExpressionMeta final : public Expression { public: Value serialize(bool explain) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; void addDependencies(DepsTracker* deps) const final; static boost::intrusive_ptr<Expression> parse( @@ -1017,7 +997,7 @@ public: explicit ExpressionMillisecond(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionMillisecond, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static int extract(const long long date); @@ -1029,7 +1009,7 @@ public: explicit ExpressionMinute(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionMinute, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static int extract(const tm& tm) { @@ -1043,7 +1023,7 @@ public: explicit ExpressionMod(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionMod, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1053,7 +1033,7 @@ public: explicit ExpressionMultiply(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionMultiply>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -1071,7 +1051,7 @@ public: explicit ExpressionMonth(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionMonth, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; // MySQL uses 1-12, tm uses 0-11 @@ -1086,7 +1066,7 @@ public: explicit ExpressionNot(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionNot, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1103,7 +1083,7 @@ class ExpressionObject final : public Expression { public: boost::intrusive_ptr<Expression> optimize() final; void addDependencies(DepsTracker* deps) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; Value serialize(bool explain) const final; static boost::intrusive_ptr<ExpressionObject> create( @@ -1143,7 +1123,7 @@ public: : ExpressionVariadic<ExpressionOr>(expCtx) {} boost::intrusive_ptr<Expression> optimize() final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -1164,7 +1144,7 @@ public: const boost::intrusive_ptr<ExpressionContext>& expCtx, Value base, Value exp); private: - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1174,7 +1154,7 @@ public: explicit ExpressionRange(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionRange, 2, 3>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1185,7 +1165,7 @@ public: : Expression(expCtx) {} void addDependencies(DepsTracker* deps) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; boost::intrusive_ptr<Expression> optimize() final; static boost::intrusive_ptr<Expression> parse( const boost::intrusive_ptr<ExpressionContext>& expCtx, @@ -1208,7 +1188,7 @@ public: explicit ExpressionSecond(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSecond, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static inline int extract(const tm& tm) { @@ -1222,7 +1202,7 @@ public: explicit ExpressionSetDifference(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSetDifference, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1232,7 +1212,7 @@ public: explicit ExpressionSetEquals(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionSetEquals>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; void validateArguments(const ExpressionVector& args) const final; }; @@ -1243,7 +1223,7 @@ public: explicit ExpressionSetIntersection(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionSetIntersection>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -1263,7 +1243,7 @@ public: : ExpressionFixedArity<ExpressionSetIsSubset, 2>(expCtx) {} boost::intrusive_ptr<Expression> optimize() override; - Value evaluateInternal() const override; + Value evaluate(Document root) const override; const char* getOpName() const final; private: @@ -1276,7 +1256,7 @@ public: explicit ExpressionSetUnion(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionVariadic<ExpressionSetUnion>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; bool isAssociative() const final { @@ -1294,7 +1274,7 @@ public: explicit ExpressionSize(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSize, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1304,7 +1284,7 @@ public: explicit ExpressionReverseArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionReverseArray, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1314,7 +1294,7 @@ public: explicit ExpressionSlice(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionRangedArity<ExpressionSlice, 2, 3>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1324,7 +1304,7 @@ public: explicit ExpressionIsArray(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIsArray, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1334,7 +1314,7 @@ public: explicit ExpressionSplit(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSplit, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1354,7 +1334,7 @@ public: explicit ExpressionStrcasecmp(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionStrcasecmp, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1364,7 +1344,7 @@ public: explicit ExpressionSubstrBytes(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSubstrBytes, 3>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const; }; @@ -1374,7 +1354,7 @@ public: explicit ExpressionSubstrCP(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSubstrCP, 3>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1384,7 +1364,7 @@ public: explicit ExpressionStrLenBytes(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionStrLenBytes, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1394,7 +1374,7 @@ public: explicit ExpressionStrLenCP(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionStrLenCP, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1404,7 +1384,7 @@ public: explicit ExpressionSubtract(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionSubtract, 2>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1415,7 +1395,7 @@ public: : Expression(expCtx) {} void addDependencies(DepsTracker* deps) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; boost::intrusive_ptr<Expression> optimize() final; static boost::intrusive_ptr<Expression> parse( const boost::intrusive_ptr<ExpressionContext>& expCtx, @@ -1437,7 +1417,7 @@ public: explicit ExpressionToLower(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionToLower, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1447,7 +1427,7 @@ public: explicit ExpressionToUpper(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionToUpper, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1467,7 +1447,7 @@ public: explicit ExpressionType(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionType, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; }; @@ -1477,7 +1457,7 @@ public: explicit ExpressionWeek(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionWeek, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static int extract(const tm& tm); @@ -1489,7 +1469,7 @@ public: explicit ExpressionIsoWeekYear(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIsoWeekYear, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static int extract(const tm& tm); @@ -1501,7 +1481,7 @@ public: explicit ExpressionIsoDayOfWeek(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIsoDayOfWeek, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static int extract(const tm& tm); @@ -1513,7 +1493,7 @@ public: explicit ExpressionIsoWeek(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionIsoWeek, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; static int extract(const tm& tm); @@ -1525,7 +1505,7 @@ public: explicit ExpressionYear(const boost::intrusive_ptr<ExpressionContext>& expCtx) : ExpressionFixedArity<ExpressionYear, 1>(expCtx) {} - Value evaluateInternal() const final; + Value evaluate(Document root) const final; const char* getOpName() const final; // tm_year is years since 1990 @@ -1541,7 +1521,7 @@ public: : Expression(expCtx) {} void addDependencies(DepsTracker* deps) const final; - Value evaluateInternal() const final; + Value evaluate(Document root) const final; boost::intrusive_ptr<Expression> optimize() final; static boost::intrusive_ptr<Expression> parse( const boost::intrusive_ptr<ExpressionContext>& expCtx, |