summaryrefslogtreecommitdiff
path: root/src/mongo/s/write_ops/batched_update_document.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/write_ops/batched_update_document.h')
-rw-r--r--src/mongo/s/write_ops/batched_update_document.h164
1 files changed, 82 insertions, 82 deletions
diff --git a/src/mongo/s/write_ops/batched_update_document.h b/src/mongo/s/write_ops/batched_update_document.h
index 0830e6c7f3c..ed9b6bc275b 100644
--- a/src/mongo/s/write_ops/batched_update_document.h
+++ b/src/mongo/s/write_ops/batched_update_document.h
@@ -37,85 +37,85 @@
namespace mongo {
- /**
- * This class represents the layout and content of a update document runCommand,
- * in the request side.
- */
- class BatchedUpdateDocument : public BSONSerializable {
- MONGO_DISALLOW_COPYING(BatchedUpdateDocument);
- public:
-
- //
- // schema declarations
- //
-
- static const BSONField<BSONObj> query;
- static const BSONField<BSONObj> updateExpr;
- static const BSONField<bool> multi;
- static const BSONField<bool> upsert;
-
- //
- // construction / destruction
- //
-
- BatchedUpdateDocument();
- virtual ~BatchedUpdateDocument();
-
- /** Copies all the fields present in 'this' to 'other'. */
- void cloneTo(BatchedUpdateDocument* other) const;
-
- //
- // bson serializable interface implementation
- //
-
- virtual bool isValid(std::string* errMsg) const;
- virtual BSONObj toBSON() const;
- virtual bool parseBSON(const BSONObj& source, std::string* errMsg);
- virtual void clear();
- virtual std::string toString() const;
-
- //
- // individual field accessors
- //
-
- void setQuery(const BSONObj& query);
- void unsetQuery();
- bool isQuerySet() const;
- const BSONObj& getQuery() const;
-
- void setUpdateExpr(const BSONObj& updateExpr);
- void unsetUpdateExpr();
- bool isUpdateExprSet() const;
- const BSONObj& getUpdateExpr() const;
-
- void setMulti(bool multi);
- void unsetMulti();
- bool isMultiSet() const;
- bool getMulti() const;
-
- void setUpsert(bool upsert);
- void unsetUpsert();
- bool isUpsertSet() const;
- bool getUpsert() const;
-
- private:
- // Convention: (M)andatory, (O)ptional
-
- // (M) query whose result the update will manipulate
- BSONObj _query;
- bool _isQuerySet;
-
- // (M) the update expression itself
- BSONObj _updateExpr;
- bool _isUpdateExprSet;
-
- // (O) whether multiple documents are to be updated
- bool _multi;
- bool _isMultiSet;
-
- // (O) whether upserts are allowed
- bool _upsert;
- bool _isUpsertSet;
- };
-
-} // namespace mongo
+/**
+ * This class represents the layout and content of a update document runCommand,
+ * in the request side.
+ */
+class BatchedUpdateDocument : public BSONSerializable {
+ MONGO_DISALLOW_COPYING(BatchedUpdateDocument);
+
+public:
+ //
+ // schema declarations
+ //
+
+ static const BSONField<BSONObj> query;
+ static const BSONField<BSONObj> updateExpr;
+ static const BSONField<bool> multi;
+ static const BSONField<bool> upsert;
+
+ //
+ // construction / destruction
+ //
+
+ BatchedUpdateDocument();
+ virtual ~BatchedUpdateDocument();
+
+ /** Copies all the fields present in 'this' to 'other'. */
+ void cloneTo(BatchedUpdateDocument* other) const;
+
+ //
+ // bson serializable interface implementation
+ //
+
+ virtual bool isValid(std::string* errMsg) const;
+ virtual BSONObj toBSON() const;
+ virtual bool parseBSON(const BSONObj& source, std::string* errMsg);
+ virtual void clear();
+ virtual std::string toString() const;
+
+ //
+ // individual field accessors
+ //
+
+ void setQuery(const BSONObj& query);
+ void unsetQuery();
+ bool isQuerySet() const;
+ const BSONObj& getQuery() const;
+
+ void setUpdateExpr(const BSONObj& updateExpr);
+ void unsetUpdateExpr();
+ bool isUpdateExprSet() const;
+ const BSONObj& getUpdateExpr() const;
+
+ void setMulti(bool multi);
+ void unsetMulti();
+ bool isMultiSet() const;
+ bool getMulti() const;
+
+ void setUpsert(bool upsert);
+ void unsetUpsert();
+ bool isUpsertSet() const;
+ bool getUpsert() const;
+
+private:
+ // Convention: (M)andatory, (O)ptional
+
+ // (M) query whose result the update will manipulate
+ BSONObj _query;
+ bool _isQuerySet;
+
+ // (M) the update expression itself
+ BSONObj _updateExpr;
+ bool _isUpdateExprSet;
+
+ // (O) whether multiple documents are to be updated
+ bool _multi;
+ bool _isMultiSet;
+
+ // (O) whether upserts are allowed
+ bool _upsert;
+ bool _isUpsertSet;
+};
+
+} // namespace mongo