summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/count_request.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 00:22:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 10:56:02 -0400
commit9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch)
tree3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/query/count_request.h
parent01965cf52bce6976637ecb8f4a622aeb05ab256a (diff)
downloadmongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/query/count_request.h')
-rw-r--r--src/mongo/db/query/count_request.h103
1 files changed, 58 insertions, 45 deletions
diff --git a/src/mongo/db/query/count_request.h b/src/mongo/db/query/count_request.h
index 0e9eb25ee30..42b654a7896 100644
--- a/src/mongo/db/query/count_request.h
+++ b/src/mongo/db/query/count_request.h
@@ -36,59 +36,72 @@
namespace mongo {
- template<typename T> class StatusWith;
+template <typename T>
+class StatusWith;
+/**
+ * A description of a request for a count operation. Copyable.
+ */
+class CountRequest {
+public:
/**
- * A description of a request for a count operation. Copyable.
+ * Construct an empty request.
*/
- class CountRequest {
- public:
-
- /**
- * Construct an empty request.
- */
- CountRequest(const std::string& fullNs, BSONObj query);
-
- const std::string& getNs() const { return _fullNs; }
- const BSONObj getQuery() const { return _query; }
-
- long long getLimit() const { return _limit.value_or(0); }
- void setLimit(long long limit) { _limit = limit; }
-
- long long getSkip() const { return _skip.value_or(0); }
- void setSkip(long long skip) { _skip = skip; }
+ CountRequest(const std::string& fullNs, BSONObj query);
+
+ const std::string& getNs() const {
+ return _fullNs;
+ }
+ const BSONObj getQuery() const {
+ return _query;
+ }
+
+ long long getLimit() const {
+ return _limit.value_or(0);
+ }
+ void setLimit(long long limit) {
+ _limit = limit;
+ }
+
+ long long getSkip() const {
+ return _skip.value_or(0);
+ }
+ void setSkip(long long skip) {
+ _skip = skip;
+ }
+
+ const BSONObj getHint() const {
+ return _hint.value_or(BSONObj());
+ }
+ void setHint(BSONObj hint);
- const BSONObj getHint() const { return _hint.value_or(BSONObj()); }
- void setHint(BSONObj hint);
-
- /**
- * Constructs a BSON representation of this request, which can be used for sending it in
- * commands.
- */
- BSONObj toBSON() const;
+ /**
+ * Constructs a BSON representation of this request, which can be used for sending it in
+ * commands.
+ */
+ BSONObj toBSON() const;
- /**
- * Construct a CountRequest from the command specification and db name.
- */
- static StatusWith<CountRequest> parseFromBSON(const std::string& dbname,
- const BSONObj& cmdObj);
+ /**
+ * Construct a CountRequest from the command specification and db name.
+ */
+ static StatusWith<CountRequest> parseFromBSON(const std::string& dbname, const BSONObj& cmdObj);
- private:
- // Namespace to operate on (e.g. "foo.bar").
- const std::string _fullNs;
+private:
+ // Namespace to operate on (e.g. "foo.bar").
+ const std::string _fullNs;
- // A predicate describing the set of documents to count.
- const BSONObj _query;
+ // A predicate describing the set of documents to count.
+ const BSONObj _query;
- // Optional. An integer limiting the number of documents to count.
- boost::optional<long long> _limit;
+ // Optional. An integer limiting the number of documents to count.
+ boost::optional<long long> _limit;
- // Optional. An integer indicating to not include the first n documents in the count.
- boost::optional<long long> _skip;
+ // Optional. An integer indicating to not include the first n documents in the count.
+ boost::optional<long long> _skip;
- // Optional. Indicates to the query planner that it should generate a count plan using a
- // particular index.
- boost::optional<BSONObj> _hint;
- };
+ // Optional. Indicates to the query planner that it should generate a count plan using a
+ // particular index.
+ boost::optional<BSONObj> _hint;
+};
-} // namespace mongo
+} // namespace mongo