summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-06-10 17:43:13 -0400
committerAndrew Morrow <acm@mongodb.com>2015-06-10 22:37:44 -0400
commita9b6612f5322f916298c19a6728817a1034c6aab (patch)
tree0da5b1ce36e6a8e2d85dbdeb49d505ac99bf6e1d /src/mongo/db/exec
parent0ec1e625760eb9c1a20a3dba78200e8f9ff28d9e (diff)
downloadmongo-a9b6612f5322f916298c19a6728817a1034c6aab.tar.gz
SERVER-17309 Replace std::auto_ptr<T> with std::unique_ptr<T>
Diffstat (limited to 'src/mongo/db/exec')
-rw-r--r--src/mongo/db/exec/and_hash.cpp4
-rw-r--r--src/mongo/db/exec/and_sorted.cpp4
-rw-r--r--src/mongo/db/exec/collection_scan.cpp4
-rw-r--r--src/mongo/db/exec/count.cpp4
-rw-r--r--src/mongo/db/exec/count_scan.cpp4
-rw-r--r--src/mongo/db/exec/delete.cpp4
-rw-r--r--src/mongo/db/exec/distinct_scan.cpp4
-rw-r--r--src/mongo/db/exec/fetch.cpp4
-rw-r--r--src/mongo/db/exec/geo_near.cpp8
-rw-r--r--src/mongo/db/exec/group.cpp4
-rw-r--r--src/mongo/db/exec/group.h2
-rw-r--r--src/mongo/db/exec/idhack.cpp4
-rw-r--r--src/mongo/db/exec/keep_mutations.cpp4
-rw-r--r--src/mongo/db/exec/limit.cpp4
-rw-r--r--src/mongo/db/exec/merge_sort.cpp4
-rw-r--r--src/mongo/db/exec/multi_plan.cpp6
-rw-r--r--src/mongo/db/exec/or.cpp4
-rw-r--r--src/mongo/db/exec/projection.cpp4
-rw-r--r--src/mongo/db/exec/projection_exec_test.cpp4
-rw-r--r--src/mongo/db/exec/queued_data_stage.cpp4
-rw-r--r--src/mongo/db/exec/queued_data_stage_test.cpp10
-rw-r--r--src/mongo/db/exec/shard_filter.cpp4
-rw-r--r--src/mongo/db/exec/skip.cpp4
-rw-r--r--src/mongo/db/exec/sort.cpp6
-rw-r--r--src/mongo/db/exec/stagedebug_cmd.cpp12
-rw-r--r--src/mongo/db/exec/subplan.cpp8
-rw-r--r--src/mongo/db/exec/text.cpp4
-rw-r--r--src/mongo/db/exec/update.cpp4
-rw-r--r--src/mongo/db/exec/working_set.h2
29 files changed, 69 insertions, 69 deletions
diff --git a/src/mongo/db/exec/and_hash.cpp b/src/mongo/db/exec/and_hash.cpp
index 8374c9740ca..adc24c42394 100644
--- a/src/mongo/db/exec/and_hash.cpp
+++ b/src/mongo/db/exec/and_hash.cpp
@@ -45,7 +45,7 @@ namespace {
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
const size_t AndHashStage::kLookAheadWorks = 10;
@@ -535,7 +535,7 @@ namespace mongo {
_commonStats.filter = bob.obj();
}
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_AND_HASH));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_AND_HASH));
ret->specific.reset(new AndHashStats(_specificStats));
for (size_t i = 0; i < _children.size(); ++i) {
ret->children.push_back(_children[i]->getStats());
diff --git a/src/mongo/db/exec/and_sorted.cpp b/src/mongo/db/exec/and_sorted.cpp
index 813895fc619..c201a7633aa 100644
--- a/src/mongo/db/exec/and_sorted.cpp
+++ b/src/mongo/db/exec/and_sorted.cpp
@@ -36,7 +36,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::numeric_limits;
using std::vector;
@@ -326,7 +326,7 @@ namespace mongo {
_commonStats.filter = bob.obj();
}
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_AND_SORTED));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_AND_SORTED));
ret->specific.reset(new AndSortedStats(_specificStats));
for (size_t i = 0; i < _children.size(); ++i) {
ret->children.push_back(_children[i]->getStats());
diff --git a/src/mongo/db/exec/collection_scan.cpp b/src/mongo/db/exec/collection_scan.cpp
index fb8bdf4a311..1a0c16c6b55 100644
--- a/src/mongo/db/exec/collection_scan.cpp
+++ b/src/mongo/db/exec/collection_scan.cpp
@@ -46,7 +46,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -250,7 +250,7 @@ namespace mongo {
_commonStats.filter = bob.obj();
}
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_COLLSCAN));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_COLLSCAN));
ret->specific.reset(new CollectionScanStats(_specificStats));
return ret.release();
}
diff --git a/src/mongo/db/exec/count.cpp b/src/mongo/db/exec/count.cpp
index 5b3eb904647..9d747c31aca 100644
--- a/src/mongo/db/exec/count.cpp
+++ b/src/mongo/db/exec/count.cpp
@@ -36,7 +36,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -200,7 +200,7 @@ namespace mongo {
PlanStageStats* CountStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_COUNT));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_COUNT));
CountStats* countStats = new CountStats(_specificStats);
ret->specific.reset(countStats);
if (_child.get()) {
diff --git a/src/mongo/db/exec/count_scan.cpp b/src/mongo/db/exec/count_scan.cpp
index 1a801c82566..668313367d9 100644
--- a/src/mongo/db/exec/count_scan.cpp
+++ b/src/mongo/db/exec/count_scan.cpp
@@ -34,7 +34,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -159,7 +159,7 @@ namespace mongo {
}
PlanStageStats* CountScan::getStats() {
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_COUNT_SCAN));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_COUNT_SCAN));
CountScanStats* countStats = new CountScanStats(_specificStats);
countStats->keyPattern = _specificStats.keyPattern.getOwned();
diff --git a/src/mongo/db/exec/delete.cpp b/src/mongo/db/exec/delete.cpp
index b034df535fc..787f3f244bf 100644
--- a/src/mongo/db/exec/delete.cpp
+++ b/src/mongo/db/exec/delete.cpp
@@ -45,7 +45,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -291,7 +291,7 @@ namespace mongo {
PlanStageStats* DeleteStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_DELETE));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_DELETE));
ret->specific.reset(new DeleteStats(_specificStats));
ret->children.push_back(_child->getStats());
return ret.release();
diff --git a/src/mongo/db/exec/distinct_scan.cpp b/src/mongo/db/exec/distinct_scan.cpp
index 4185877064c..24dcc36019a 100644
--- a/src/mongo/db/exec/distinct_scan.cpp
+++ b/src/mongo/db/exec/distinct_scan.cpp
@@ -37,7 +37,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -149,7 +149,7 @@ namespace mongo {
}
PlanStageStats* DistinctScan::getStats() {
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_DISTINCT_SCAN));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_DISTINCT_SCAN));
ret->specific.reset(new DistinctScanStats(_specificStats));
return ret.release();
}
diff --git a/src/mongo/db/exec/fetch.cpp b/src/mongo/db/exec/fetch.cpp
index 481640cc971..817bc72fc8d 100644
--- a/src/mongo/db/exec/fetch.cpp
+++ b/src/mongo/db/exec/fetch.cpp
@@ -41,7 +41,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -239,7 +239,7 @@ namespace mongo {
_commonStats.filter = bob.obj();
}
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_FETCH));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_FETCH));
ret->specific.reset(new FetchStats(_specificStats));
ret->children.push_back(_child->getStats());
return ret.release();
diff --git a/src/mongo/db/exec/geo_near.cpp b/src/mongo/db/exec/geo_near.cpp
index dd284e71f0b..3755af02bb3 100644
--- a/src/mongo/db/exec/geo_near.cpp
+++ b/src/mongo/db/exec/geo_near.cpp
@@ -54,7 +54,7 @@ namespace mongo {
using boost::scoped_ptr;
using std::abs;
- using std::auto_ptr;
+ using std::unique_ptr;
//
// Shared GeoNear search functionality
@@ -79,7 +79,7 @@ namespace mongo {
if (!element.isABSONObj())
return NULL;
- auto_ptr<StoredGeometry> stored(new StoredGeometry);
+ unique_ptr<StoredGeometry> stored(new StoredGeometry);
if (!stored->geometry.parseFromStorage(element).isOK())
return NULL;
stored->element = element;
@@ -106,7 +106,7 @@ namespace mongo {
for (BSONElementSet::iterator it = geomElements.begin(); it != geomElements.end(); ++it) {
const BSONElement& el = *it;
- auto_ptr<StoredGeometry> stored(StoredGeometry::parseFrom(el));
+ unique_ptr<StoredGeometry> stored(StoredGeometry::parseFrom(el));
if (stored.get()) {
// Valid geometry element
@@ -746,7 +746,7 @@ namespace mongo {
const CRS queryCRS = _nearParams.nearQuery->centroid->crs;
- auto_ptr<R2Region> coverRegion;
+ unique_ptr<R2Region> coverRegion;
if (FLAT == queryCRS) {
diff --git a/src/mongo/db/exec/group.cpp b/src/mongo/db/exec/group.cpp
index d5d3688d4c5..68b21928b62 100644
--- a/src/mongo/db/exec/group.cpp
+++ b/src/mongo/db/exec/group.cpp
@@ -38,7 +38,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
namespace {
@@ -285,7 +285,7 @@ namespace mongo {
PlanStageStats* GroupStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_GROUP));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_GROUP));
GroupStats* groupStats = new GroupStats(_specificStats);
ret->specific.reset(groupStats);
ret->children.push_back(_child->getStats());
diff --git a/src/mongo/db/exec/group.h b/src/mongo/db/exec/group.h
index dcf96570cbe..2b2e5bb3d04 100644
--- a/src/mongo/db/exec/group.h
+++ b/src/mongo/db/exec/group.h
@@ -151,7 +151,7 @@ namespace mongo {
// The Scope object that all script operations for this group stage will use. Initialized
// by initGroupScripting(). Owned here.
- std::auto_ptr<Scope> _scope;
+ std::unique_ptr<Scope> _scope;
// The reduce function for the group operation. Initialized by initGroupScripting(). Owned
// by _scope.
diff --git a/src/mongo/db/exec/idhack.cpp b/src/mongo/db/exec/idhack.cpp
index 149d20e3509..73a950e4dc2 100644
--- a/src/mongo/db/exec/idhack.cpp
+++ b/src/mongo/db/exec/idhack.cpp
@@ -42,7 +42,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -240,7 +240,7 @@ namespace mongo {
PlanStageStats* IDHackStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_IDHACK));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_IDHACK));
ret->specific.reset(new IDHackStats(_specificStats));
return ret.release();
}
diff --git a/src/mongo/db/exec/keep_mutations.cpp b/src/mongo/db/exec/keep_mutations.cpp
index a58c979f02a..7c88a59fde5 100644
--- a/src/mongo/db/exec/keep_mutations.cpp
+++ b/src/mongo/db/exec/keep_mutations.cpp
@@ -33,7 +33,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -142,7 +142,7 @@ namespace mongo {
PlanStageStats* KeepMutationsStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_KEEP_MUTATIONS));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_KEEP_MUTATIONS));
// Takes ownership of the object returned from _child->getStats().
ret->children.push_back(_child->getStats());
return ret.release();
diff --git a/src/mongo/db/exec/limit.cpp b/src/mongo/db/exec/limit.cpp
index 9853cde3e57..c766d07c650 100644
--- a/src/mongo/db/exec/limit.cpp
+++ b/src/mongo/db/exec/limit.cpp
@@ -34,7 +34,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -119,7 +119,7 @@ namespace mongo {
PlanStageStats* LimitStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_LIMIT));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_LIMIT));
ret->specific.reset(new LimitStats(_specificStats));
ret->children.push_back(_child->getStats());
return ret.release();
diff --git a/src/mongo/db/exec/merge_sort.cpp b/src/mongo/db/exec/merge_sort.cpp
index 6d394ba00d6..37c8269a502 100644
--- a/src/mongo/db/exec/merge_sort.cpp
+++ b/src/mongo/db/exec/merge_sort.cpp
@@ -35,7 +35,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::list;
using std::string;
using std::vector;
@@ -270,7 +270,7 @@ namespace mongo {
_specificStats.sortPattern = _pattern;
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SORT_MERGE));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SORT_MERGE));
ret->specific.reset(new MergeSortStats(_specificStats));
for (size_t i = 0; i < _children.size(); ++i) {
ret->children.push_back(_children[i]->getStats());
diff --git a/src/mongo/db/exec/multi_plan.cpp b/src/mongo/db/exec/multi_plan.cpp
index 3258ab719b0..8bc98d109bd 100644
--- a/src/mongo/db/exec/multi_plan.cpp
+++ b/src/mongo/db/exec/multi_plan.cpp
@@ -51,7 +51,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::endl;
using std::list;
using std::vector;
@@ -245,7 +245,7 @@ namespace mongo {
// After picking best plan, ranking will own plan stats from
// candidate solutions (winner and losers).
- std::auto_ptr<PlanRankingDecision> ranking(new PlanRankingDecision);
+ std::unique_ptr<PlanRankingDecision> ranking(new PlanRankingDecision);
_bestPlanIdx = PlanRanker::pickBestPlan(_candidates, ranking.get());
verify(_bestPlanIdx >= 0 && _bestPlanIdx < static_cast<int>(_candidates.size()));
@@ -500,7 +500,7 @@ namespace mongo {
}
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_MULTI_PLAN));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_MULTI_PLAN));
return ret.release();
}
diff --git a/src/mongo/db/exec/or.cpp b/src/mongo/db/exec/or.cpp
index c27c1a1598f..a7d370c41fa 100644
--- a/src/mongo/db/exec/or.cpp
+++ b/src/mongo/db/exec/or.cpp
@@ -35,7 +35,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -185,7 +185,7 @@ namespace mongo {
_commonStats.filter = bob.obj();
}
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_OR));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_OR));
ret->specific.reset(new OrStats(_specificStats));
for (size_t i = 0; i < _children.size(); ++i) {
ret->children.push_back(_children[i]->getStats());
diff --git a/src/mongo/db/exec/projection.cpp b/src/mongo/db/exec/projection.cpp
index 7e4f513e4b7..15d06963b31 100644
--- a/src/mongo/db/exec/projection.cpp
+++ b/src/mongo/db/exec/projection.cpp
@@ -41,7 +41,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::endl;
using std::vector;
@@ -275,7 +275,7 @@ namespace mongo {
PlanStageStats* ProjectionStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_PROJECTION));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_PROJECTION));
ProjectionStats* projStats = new ProjectionStats(_specificStats);
projStats->projObj = _projObj;
diff --git a/src/mongo/db/exec/projection_exec_test.cpp b/src/mongo/db/exec/projection_exec_test.cpp
index 2ad9fd3b4e0..56d9cbc5be2 100644
--- a/src/mongo/db/exec/projection_exec_test.cpp
+++ b/src/mongo/db/exec/projection_exec_test.cpp
@@ -42,7 +42,7 @@ using namespace mongo;
namespace {
- using std::auto_ptr;
+ using std::unique_ptr;
/**
* Utility function to create MatchExpression
@@ -77,7 +77,7 @@ namespace {
// Create projection exec object.
BSONObj spec = fromjson(specStr);
BSONObj query = fromjson(queryStr);
- auto_ptr<MatchExpression> queryExpression(parseMatchExpression(query));
+ unique_ptr<MatchExpression> queryExpression(parseMatchExpression(query));
ProjectionExec exec(spec, queryExpression.get());
// Create working set member.
diff --git a/src/mongo/db/exec/queued_data_stage.cpp b/src/mongo/db/exec/queued_data_stage.cpp
index b353cb6026d..740f3084740 100644
--- a/src/mongo/db/exec/queued_data_stage.cpp
+++ b/src/mongo/db/exec/queued_data_stage.cpp
@@ -33,7 +33,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
const char* QueuedDataStage::kStageType = "QUEUED_DATA";
@@ -84,7 +84,7 @@ namespace mongo {
PlanStageStats* QueuedDataStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_QUEUED_DATA));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_QUEUED_DATA));
ret->specific.reset(new MockStats(_specificStats));
return ret.release();
}
diff --git a/src/mongo/db/exec/queued_data_stage_test.cpp b/src/mongo/db/exec/queued_data_stage_test.cpp
index 26bc5962a8a..ef823c04cfb 100644
--- a/src/mongo/db/exec/queued_data_stage_test.cpp
+++ b/src/mongo/db/exec/queued_data_stage_test.cpp
@@ -38,19 +38,19 @@ using namespace mongo;
namespace {
- using std::auto_ptr;
+ using std::unique_ptr;
//
// Basic test that we get out valid stats objects.
//
TEST(QueuedDataStageTest, getValidStats) {
WorkingSet ws;
- auto_ptr<QueuedDataStage> mock(new QueuedDataStage(&ws));
+ unique_ptr<QueuedDataStage> mock(new QueuedDataStage(&ws));
const CommonStats* commonStats = mock->getCommonStats();
ASSERT_EQUALS(commonStats->works, static_cast<size_t>(0));
const SpecificStats* specificStats = mock->getSpecificStats();
ASSERT(specificStats);
- auto_ptr<PlanStageStats> allStats(mock->getStats());
+ unique_ptr<PlanStageStats> allStats(mock->getStats());
ASSERT_EQUALS(allStats->stageType, mock->stageType());
}
@@ -60,7 +60,7 @@ namespace {
TEST(QueuedDataStageTest, validateStats) {
WorkingSet ws;
WorkingSetID wsID;
- auto_ptr<QueuedDataStage> mock(new QueuedDataStage(&ws));
+ unique_ptr<QueuedDataStage> mock(new QueuedDataStage(&ws));
// make sure that we're at all zero
const CommonStats* stats = mock->getCommonStats();
@@ -101,7 +101,7 @@ namespace {
// and now we are d1U, but must trigger EOF with getStats()
ASSERT_FALSE(stats->isEOF);
- auto_ptr<PlanStageStats> allStats(mock->getStats());
+ unique_ptr<PlanStageStats> allStats(mock->getStats());
ASSERT_TRUE(stats->isEOF);
}
}
diff --git a/src/mongo/db/exec/shard_filter.cpp b/src/mongo/db/exec/shard_filter.cpp
index 26f546ec836..2727b1c99f8 100644
--- a/src/mongo/db/exec/shard_filter.cpp
+++ b/src/mongo/db/exec/shard_filter.cpp
@@ -38,7 +38,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -150,7 +150,7 @@ namespace mongo {
PlanStageStats* ShardFilterStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SHARDING_FILTER));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SHARDING_FILTER));
ret->children.push_back(_child->getStats());
ret->specific.reset(new ShardingFilterStats(_specificStats));
return ret.release();
diff --git a/src/mongo/db/exec/skip.cpp b/src/mongo/db/exec/skip.cpp
index be2284bca0c..979e952b1d7 100644
--- a/src/mongo/db/exec/skip.cpp
+++ b/src/mongo/db/exec/skip.cpp
@@ -33,7 +33,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::vector;
// static
@@ -118,7 +118,7 @@ namespace mongo {
PlanStageStats* SkipStage::getStats() {
_commonStats.isEOF = isEOF();
_specificStats.skip = _toSkip;
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SKIP));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SKIP));
ret->specific.reset(new SkipStats(_specificStats));
ret->children.push_back(_child->getStats());
return ret.release();
diff --git a/src/mongo/db/exec/sort.cpp b/src/mongo/db/exec/sort.cpp
index 3f2e8be89ad..61dd09e1dbc 100644
--- a/src/mongo/db/exec/sort.cpp
+++ b/src/mongo/db/exec/sort.cpp
@@ -45,7 +45,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::endl;
using std::vector;
@@ -238,7 +238,7 @@ namespace mongo {
CanonicalQuery* rawQueryForSort;
verify(CanonicalQuery::canonicalize(
"fake_ns", queryObj, &rawQueryForSort, WhereCallbackNoop()).isOK());
- auto_ptr<CanonicalQuery> queryForSort(rawQueryForSort);
+ unique_ptr<CanonicalQuery> queryForSort(rawQueryForSort);
vector<QuerySolution*> solns;
LOG(5) << "Sort stage: Planning to obtain bounds for sort." << endl;
@@ -477,7 +477,7 @@ namespace mongo {
_specificStats.limit = _limit;
_specificStats.sortPattern = _pattern.getOwned();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SORT));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SORT));
ret->specific.reset(new SortStats(_specificStats));
ret->children.push_back(_child->getStats());
return ret.release();
diff --git a/src/mongo/db/exec/stagedebug_cmd.cpp b/src/mongo/db/exec/stagedebug_cmd.cpp
index bd5c771e1a2..c3b59a84de2 100644
--- a/src/mongo/db/exec/stagedebug_cmd.cpp
+++ b/src/mongo/db/exec/stagedebug_cmd.cpp
@@ -59,7 +59,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::string;
using std::vector;
@@ -153,7 +153,7 @@ namespace mongo {
// Parse the plan into these.
OwnedPointerVector<MatchExpression> exprs;
- auto_ptr<WorkingSet> ws(new WorkingSet());
+ unique_ptr<WorkingSet> ws(new WorkingSet());
PlanStage* userRoot = parseQuery(txn, collection, planObj, ws.get(), &exprs);
uassert(16911, "Couldn't parse plan from " + cmdObj.toString(), NULL != userRoot);
@@ -260,7 +260,7 @@ namespace mongo {
uassert(16921, "Nodes argument must be provided to AND",
nodeArgs["nodes"].isABSONObj());
- auto_ptr<AndHashStage> andStage(new AndHashStage(workingSet, matcher, collection));
+ unique_ptr<AndHashStage> andStage(new AndHashStage(workingSet, matcher, collection));
int nodesAdded = 0;
BSONObjIterator it(nodeArgs["nodes"].Obj());
@@ -285,7 +285,7 @@ namespace mongo {
uassert(16924, "Nodes argument must be provided to AND",
nodeArgs["nodes"].isABSONObj());
- auto_ptr<AndSortedStage> andStage(new AndSortedStage(workingSet, matcher,
+ unique_ptr<AndSortedStage> andStage(new AndSortedStage(workingSet, matcher,
collection));
int nodesAdded = 0;
@@ -313,7 +313,7 @@ namespace mongo {
uassert(16935, "Dedup argument must be provided to OR",
!nodeArgs["dedup"].eoo());
BSONObjIterator it(nodeArgs["nodes"].Obj());
- auto_ptr<OrStage> orStage(new OrStage(workingSet, nodeArgs["dedup"].Bool(),
+ unique_ptr<OrStage> orStage(new OrStage(workingSet, nodeArgs["dedup"].Bool(),
matcher));
while (it.more()) {
BSONElement e = it.next();
@@ -404,7 +404,7 @@ namespace mongo {
params.pattern = nodeArgs["pattern"].Obj();
// Dedup is true by default.
- auto_ptr<MergeSortStage> mergeStage(new MergeSortStage(params, workingSet,
+ unique_ptr<MergeSortStage> mergeStage(new MergeSortStage(params, workingSet,
collection));
BSONObjIterator it(nodeArgs["nodes"].Obj());
diff --git a/src/mongo/db/exec/subplan.cpp b/src/mongo/db/exec/subplan.cpp
index 364c429429d..386d72eb539 100644
--- a/src/mongo/db/exec/subplan.cpp
+++ b/src/mongo/db/exec/subplan.cpp
@@ -45,7 +45,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::endl;
using std::vector;
@@ -238,11 +238,11 @@ namespace mongo {
Status SubplanStage::choosePlanForSubqueries(PlanYieldPolicy* yieldPolicy) {
// This is what we annotate with the index selections and then turn into a solution.
- auto_ptr<OrMatchExpression> orExpr(
+ unique_ptr<OrMatchExpression> orExpr(
static_cast<OrMatchExpression*>(_query->root()->shallowClone()));
// This is the skeleton of index selections that is inserted into the cache.
- auto_ptr<PlanCacheIndexTree> cacheData(new PlanCacheIndexTree());
+ unique_ptr<PlanCacheIndexTree> cacheData(new PlanCacheIndexTree());
for (size_t i = 0; i < orExpr->numChildren(); ++i) {
MatchExpression* orChild = orExpr->getChild(i);
@@ -537,7 +537,7 @@ namespace mongo {
PlanStageStats* SubplanStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SUBPLAN));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_SUBPLAN));
ret->children.push_back(_child->getStats());
return ret.release();
}
diff --git a/src/mongo/db/exec/text.cpp b/src/mongo/db/exec/text.cpp
index 5a62fc9937d..f9db2e94be3 100644
--- a/src/mongo/db/exec/text.cpp
+++ b/src/mongo/db/exec/text.cpp
@@ -41,7 +41,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::string;
using std::vector;
@@ -184,7 +184,7 @@ namespace mongo {
_commonStats.filter = bob.obj();
}
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_TEXT));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_TEXT));
ret->specific.reset(new TextStats(_specificStats));
return ret.release();
}
diff --git a/src/mongo/db/exec/update.cpp b/src/mongo/db/exec/update.cpp
index cf26b1ff794..8ba566cd7e0 100644
--- a/src/mongo/db/exec/update.cpp
+++ b/src/mongo/db/exec/update.cpp
@@ -46,7 +46,7 @@
namespace mongo {
- using std::auto_ptr;
+ using std::unique_ptr;
using std::string;
using std::vector;
@@ -1060,7 +1060,7 @@ namespace mongo {
PlanStageStats* UpdateStage::getStats() {
_commonStats.isEOF = isEOF();
- auto_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_UPDATE));
+ unique_ptr<PlanStageStats> ret(new PlanStageStats(_commonStats, STAGE_UPDATE));
ret->specific.reset(new UpdateStats(_specificStats));
ret->children.push_back(_child->getStats());
return ret.release();
diff --git a/src/mongo/db/exec/working_set.h b/src/mongo/db/exec/working_set.h
index 07fee7fb659..d251f95d5c4 100644
--- a/src/mongo/db/exec/working_set.h
+++ b/src/mongo/db/exec/working_set.h
@@ -340,7 +340,7 @@ namespace mongo {
private:
boost::scoped_ptr<WorkingSetComputedData> _computed[WSM_COMPUTED_NUM_TYPES];
- std::auto_ptr<RecordFetcher> _fetcher;
+ std::unique_ptr<RecordFetcher> _fetcher;
};
} // namespace mongo