summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/expression_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/expression_context.h')
-rw-r--r--src/mongo/db/pipeline/expression_context.h47
1 files changed, 22 insertions, 25 deletions
diff --git a/src/mongo/db/pipeline/expression_context.h b/src/mongo/db/pipeline/expression_context.h
index 96cce9e4b4f..d4e18dcc582 100644
--- a/src/mongo/db/pipeline/expression_context.h
+++ b/src/mongo/db/pipeline/expression_context.h
@@ -36,34 +36,31 @@
namespace mongo {
- struct ExpressionContext : public IntrusiveCounterUnsigned {
- public:
- ExpressionContext(OperationContext* opCtx, const NamespaceString& ns)
- : ns(ns)
- , opCtx(opCtx)
- {}
+struct ExpressionContext : public IntrusiveCounterUnsigned {
+public:
+ ExpressionContext(OperationContext* opCtx, const NamespaceString& ns) : ns(ns), opCtx(opCtx) {}
- /** Used by a pipeline to check for interrupts so that killOp() works.
- * @throws if the operation has been interrupted
- */
- void checkForInterrupt() {
- if (opCtx && --interruptCounter == 0) { // XXX SERVER-13931 for opCtx check
- // The checkForInterrupt could be expensive, at least in relative terms.
- opCtx->checkForInterrupt();
- interruptCounter = kInterruptCheckPeriod;
- }
+ /** Used by a pipeline to check for interrupts so that killOp() works.
+ * @throws if the operation has been interrupted
+ */
+ void checkForInterrupt() {
+ if (opCtx && --interruptCounter == 0) { // XXX SERVER-13931 for opCtx check
+ // The checkForInterrupt could be expensive, at least in relative terms.
+ opCtx->checkForInterrupt();
+ interruptCounter = kInterruptCheckPeriod;
}
+ }
- bool inShard = false;
- bool inRouter = false;
- bool extSortAllowed = false;
- bool bypassDocumentValidation = false;
+ bool inShard = false;
+ bool inRouter = false;
+ bool extSortAllowed = false;
+ bool bypassDocumentValidation = false;
- NamespaceString ns;
- std::string tempDir; // Defaults to empty to prevent external sorting in mongos.
+ NamespaceString ns;
+ std::string tempDir; // Defaults to empty to prevent external sorting in mongos.
- OperationContext* opCtx;
- static const int kInterruptCheckPeriod = 128;
- int interruptCounter = kInterruptCheckPeriod; // when 0, check interruptStatus
- };
+ OperationContext* opCtx;
+ static const int kInterruptCheckPeriod = 128;
+ int interruptCounter = kInterruptCheckPeriod; // when 0, check interruptStatus
+};
}