summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-05-06 12:19:47 -0400
committerAndrew Morrow <acm@10gen.com>2013-05-06 20:00:54 -0400
commit07a0439411607c5b2095b3379cbbdfb08ee3b318 (patch)
treecb772d3565adb342de29734f86f887f536e64e41 /src/mongo
parent34703211e2b2a9680404d1637f96a112cbe36539 (diff)
downloadmongo-07a0439411607c5b2095b3379cbbdfb08ee3b318.tar.gz
Rename SetModifier to ModifierSet
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/ops/modifier_set.cpp14
-rw-r--r--src/mongo/db/ops/modifier_set.h8
-rw-r--r--src/mongo/db/ops/modifier_set_test.cpp10
3 files changed, 16 insertions, 16 deletions
diff --git a/src/mongo/db/ops/modifier_set.cpp b/src/mongo/db/ops/modifier_set.cpp
index c3cf8d61e04..d74c0326660 100644
--- a/src/mongo/db/ops/modifier_set.cpp
+++ b/src/mongo/db/ops/modifier_set.cpp
@@ -24,7 +24,7 @@
namespace mongo {
- struct SetModifier::PreparedState {
+ struct ModifierSet::PreparedState {
PreparedState(mutablebson::Document* targetDoc)
: doc(*targetDoc)
@@ -55,16 +55,16 @@ namespace mongo {
};
- SetModifier::SetModifier()
+ ModifierSet::ModifierSet()
: _fieldRef()
, _posDollar(0)
, _val() {
}
- SetModifier::~SetModifier() {
+ ModifierSet::~ModifierSet() {
}
- Status SetModifier::init(const BSONElement& modExpr) {
+ Status ModifierSet::init(const BSONElement& modExpr) {
//
// field name analysis
@@ -107,7 +107,7 @@ namespace mongo {
return Status::OK();
}
- Status SetModifier::prepare(mutablebson::Element root,
+ Status ModifierSet::prepare(mutablebson::Element root,
const StringData& matchedField,
ExecInfo* execInfo) {
@@ -173,7 +173,7 @@ namespace mongo {
return Status::OK();
}
- Status SetModifier::apply() const {
+ Status ModifierSet::apply() const {
dassert(!_preparedState->noOp);
// If there's no need to create any further field part, the $set is simply a value
@@ -215,7 +215,7 @@ namespace mongo {
elemToSet);
}
- Status SetModifier::log(mutablebson::Element logRoot) const {
+ Status ModifierSet::log(mutablebson::Element logRoot) const {
// We'd like to create an entry such as {$set: {<fieldname>: <value>}} under 'logRoot'.
// We start by creating the {$set: ...} Element.
diff --git a/src/mongo/db/ops/modifier_set.h b/src/mongo/db/ops/modifier_set.h
index 22ee6ec8215..c09519c3fe9 100644
--- a/src/mongo/db/ops/modifier_set.h
+++ b/src/mongo/db/ops/modifier_set.h
@@ -27,18 +27,18 @@
namespace mongo {
- class SetModifier : public ModifierInterface {
- MONGO_DISALLOW_COPYING(SetModifier);
+ class ModifierSet : public ModifierInterface {
+ MONGO_DISALLOW_COPYING(ModifierSet);
public:
- SetModifier();
+ ModifierSet();
//
// Modifier interface implementation
//
- virtual ~SetModifier();
+ virtual ~ModifierSet();
/**
* A 'modExpr' is a BSONElement {<fieldname>: <value>} coming from a $set mod such as
diff --git a/src/mongo/db/ops/modifier_set_test.cpp b/src/mongo/db/ops/modifier_set_test.cpp
index 6d89c4558b2..969b5c8f55e 100644
--- a/src/mongo/db/ops/modifier_set_test.cpp
+++ b/src/mongo/db/ops/modifier_set_test.cpp
@@ -33,7 +33,7 @@ namespace {
using mongo::fromjson;
using mongo::ModifierInterface;
using mongo::NumberInt;
- using mongo::SetModifier;
+ using mongo::ModifierSet;
using mongo::Status;
using mongo::StringData;
using mongo::mutablebson::checkDoc;
@@ -66,10 +66,10 @@ namespace {
return _mod.log(logRoot);
}
- SetModifier& mod() { return _mod; }
+ ModifierSet& mod() { return _mod; }
private:
- SetModifier _mod;
+ ModifierSet _mod;
BSONObj _modObj;
};
@@ -79,13 +79,13 @@ namespace {
TEST(Init, EmptyOperation) {
BSONObj modObj = fromjson("{$set: {}}");
- SetModifier mod;
+ ModifierSet mod;
ASSERT_NOT_OK(mod.init(modObj["$set"].embeddedObject().firstElement()));
}
TEST(Init, NotOkForStorage) {
BSONObj modObj = fromjson("{$set: {a: {$inc: {b: 1}}}}");
- SetModifier mod;
+ ModifierSet mod;
ASSERT_NOT_OK(mod.init(modObj["$set"].embeddedObject().firstElement()));
}