summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/index_bounds.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/index_bounds.h')
-rw-r--r--src/mongo/db/query/index_bounds.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mongo/db/query/index_bounds.h b/src/mongo/db/query/index_bounds.h
index 2dfcc122b26..4b04f374b16 100644
--- a/src/mongo/db/query/index_bounds.h
+++ b/src/mongo/db/query/index_bounds.h
@@ -74,6 +74,15 @@ struct OrderedIntervalList {
bool operator==(const OrderedIntervalList& other) const;
bool operator!=(const OrderedIntervalList& other) const;
+
+ void reverse();
+
+ /**
+ * Return a clone of this OIL, that is reversed.
+ */
+ OrderedIntervalList reverseClone() const;
+
+ Interval::Direction computeDirection() const;
};
/**
@@ -126,6 +135,11 @@ struct IndexBounds {
static BoundInclusion makeBoundInclusionFromBoundBools(bool startKeyInclusive,
bool endKeyInclusive);
+ /**
+ * Reverse the BoundInclusion.
+ */
+ static BoundInclusion reverseBoundInclusion(BoundInclusion b);
+
/**
* BSON format for explain. The format is an array of strings for each field.
@@ -137,6 +151,12 @@ struct IndexBounds {
*/
BSONObj toBSON() const;
+ /**
+ * Return a copy of the index bounds, but with each of the OILs going in the ascending
+ * direction.
+ */
+ IndexBounds forwardize() const;
+
// TODO: we use this for max/min scan. Consider migrating that.
bool isSimpleRange;
BSONObj startKey;