summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-06-10 18:08:48 -0400
committerAndrew Morrow <acm@mongodb.com>2015-06-10 22:37:49 -0400
commitd7d1fdb75966c684e9a42150e6e9b69c4a10ee08 (patch)
treed28b0767cbd8c1a09535f1676152e7ac57e829ce /src/mongo/dbtests
parenta9b6612f5322f916298c19a6728817a1034c6aab (diff)
downloadmongo-d7d1fdb75966c684e9a42150e6e9b69c4a10ee08.tar.gz
SERVER-17308 Replace boost::scoped_ptr<T> with std::unique_ptr<T>
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/basictests.cpp3
-rw-r--r--src/mongo/dbtests/config_server_fixture.cpp5
-rw-r--r--src/mongo/dbtests/indexupdatetests.cpp5
-rw-r--r--src/mongo/dbtests/jstests.cpp17
-rw-r--r--src/mongo/dbtests/mock/mock_conn_registry.cpp2
-rw-r--r--src/mongo/dbtests/mock/mock_conn_registry.h3
-rw-r--r--src/mongo/dbtests/mock/mock_dbclient_cursor.h3
-rw-r--r--src/mongo/dbtests/mock_dbclient_conn_test.cpp1
-rw-r--r--src/mongo/dbtests/oplogstarttests.cpp9
-rw-r--r--src/mongo/dbtests/plan_ranking.cpp43
-rw-r--r--src/mongo/dbtests/query_multi_plan_runner.cpp11
-rw-r--r--src/mongo/dbtests/query_plan_executor.cpp13
-rw-r--r--src/mongo/dbtests/query_stage_and.cpp43
-rw-r--r--src/mongo/dbtests/query_stage_collscan.cpp15
-rw-r--r--src/mongo/dbtests/query_stage_count.cpp5
-rw-r--r--src/mongo/dbtests/query_stage_delete.cpp5
-rw-r--r--src/mongo/dbtests/query_stage_ixscan.cpp8
-rw-r--r--src/mongo/dbtests/query_stage_limit_skip.cpp7
-rw-r--r--src/mongo/dbtests/query_stage_merge_sort.cpp12
-rw-r--r--src/mongo/dbtests/query_stage_sort.cpp4
-rw-r--r--src/mongo/dbtests/query_stage_subplan.cpp8
-rw-r--r--src/mongo/dbtests/query_stage_tests.cpp2
-rw-r--r--src/mongo/dbtests/query_stage_update.cpp19
-rw-r--r--src/mongo/dbtests/replica_set_monitor_test.cpp7
-rw-r--r--src/mongo/dbtests/rollbacktests.cpp3
25 files changed, 117 insertions, 136 deletions
diff --git a/src/mongo/dbtests/basictests.cpp b/src/mongo/dbtests/basictests.cpp
index 93ac8d0a1c3..907389d3403 100644
--- a/src/mongo/dbtests/basictests.cpp
+++ b/src/mongo/dbtests/basictests.cpp
@@ -31,7 +31,6 @@
#include "mongo/platform/basic.h"
-#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <iostream>
@@ -48,7 +47,7 @@
namespace BasicTests {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using boost::shared_ptr;
using std::cout;
using std::dec;
diff --git a/src/mongo/dbtests/config_server_fixture.cpp b/src/mongo/dbtests/config_server_fixture.cpp
index ad3dc3b9e7b..a0e382c266f 100644
--- a/src/mongo/dbtests/config_server_fixture.cpp
+++ b/src/mongo/dbtests/config_server_fixture.cpp
@@ -32,7 +32,6 @@
#include "mongo/dbtests/config_server_fixture.h"
-#include <boost/scoped_ptr.hpp>
#include <list>
#include "mongo/dbtests/dbtests.h"
@@ -45,7 +44,7 @@
namespace mongo {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::endl;
using std::list;
using std::string;
@@ -100,7 +99,7 @@ namespace mongo {
{
const string& collection = *it;
- scoped_ptr<DBClientCursor> cursor(_client.query(collection, BSONObj()).release());
+ unique_ptr<DBClientCursor> cursor(_client.query(collection, BSONObj()).release());
ASSERT(cursor.get() != NULL);
log() << "Dumping collection " << collection << endl;
diff --git a/src/mongo/dbtests/indexupdatetests.cpp b/src/mongo/dbtests/indexupdatetests.cpp
index 1141009a5ea..77d7b7edf59 100644
--- a/src/mongo/dbtests/indexupdatetests.cpp
+++ b/src/mongo/dbtests/indexupdatetests.cpp
@@ -28,7 +28,6 @@
* then also delete it in the license file.
*/
-#include <boost/scoped_ptr.hpp>
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/index_catalog.h"
@@ -45,7 +44,7 @@
namespace IndexUpdateTests {
- using boost::scoped_ptr;
+ using std::unique_ptr;
static const char* const _ns = "unittests.indexupdate";
@@ -248,7 +247,7 @@ namespace IndexUpdateTests {
// The index's root is set after the build is complete.
ASSERT( !id->getHead().isNull() );
// Create a cursor over the index.
- scoped_ptr<BtreeCursor> cursor(
+ unique_ptr<BtreeCursor> cursor(
BtreeCursor::make( nsdetails( _ns ),
id->getOnDisk(),
BSON( "" << -1 ), // startKey below minimum key.
diff --git a/src/mongo/dbtests/jstests.cpp b/src/mongo/dbtests/jstests.cpp
index fcd271bd3fc..c715db5e76d 100644
--- a/src/mongo/dbtests/jstests.cpp
+++ b/src/mongo/dbtests/jstests.cpp
@@ -33,7 +33,6 @@
#include "mongo/platform/basic.h"
-#include <boost/scoped_ptr.hpp>
#include <iostream>
#include <limits>
@@ -47,7 +46,7 @@
#include "mongo/util/log.h"
#include "mongo/util/timer.h"
-using boost::scoped_ptr;
+using std::unique_ptr;
using std::unique_ptr;
using std::cout;
using std::endl;
@@ -68,7 +67,7 @@ namespace JSTests {
class BasicScope {
public:
void run() {
- scoped_ptr<Scope> s;
+ unique_ptr<Scope> s;
s.reset( globalScriptEngine->newScope() );
s->setNumber( "x" , 5 );
@@ -108,7 +107,7 @@ namespace JSTests {
public:
void run() {
// Test falsy javascript values
- scoped_ptr<Scope> s;
+ unique_ptr<Scope> s;
s.reset( globalScriptEngine->newScope() );
ASSERT( ! s->getBoolean( "notSet" ) );
@@ -838,7 +837,7 @@ namespace JSTests {
class ExecTimeout {
public:
void run() {
- scoped_ptr<Scope> scope(globalScriptEngine->newScope());
+ unique_ptr<Scope> scope(globalScriptEngine->newScope());
// assert timeout occurred
ASSERT(!scope->exec("var a = 1; while (true) { ; }",
@@ -852,7 +851,7 @@ namespace JSTests {
class ExecNoTimeout {
public:
void run() {
- scoped_ptr<Scope> scope(globalScriptEngine->newScope());
+ unique_ptr<Scope> scope(globalScriptEngine->newScope());
// assert no timeout occurred
ASSERT(scope->exec("var a = function() { return 1; }",
@@ -866,7 +865,7 @@ namespace JSTests {
class InvokeTimeout {
public:
void run() {
- scoped_ptr<Scope> scope(globalScriptEngine->newScope());
+ unique_ptr<Scope> scope(globalScriptEngine->newScope());
// scope timeout after 500ms
bool caught = false;
@@ -888,7 +887,7 @@ namespace JSTests {
class InvokeNoTimeout {
public:
void run() {
- scoped_ptr<Scope> scope(globalScriptEngine->newScope());
+ unique_ptr<Scope> scope(globalScriptEngine->newScope());
// invoke completes before timeout
scope->invokeSafe("function() { "
@@ -2004,7 +2003,7 @@ namespace JSTests {
DBDirectClient client(&txn);
client.update( "test.system.js" , query.obj() , update.obj() , true /* upsert */ );
- scoped_ptr<Scope> s( globalScriptEngine->newScope() );
+ unique_ptr<Scope> s( globalScriptEngine->newScope() );
client.eval( "test" , "invalidstoredjs1()" );
BSONObj info;
diff --git a/src/mongo/dbtests/mock/mock_conn_registry.cpp b/src/mongo/dbtests/mock/mock_conn_registry.cpp
index 92f1382c542..67b27cb2316 100644
--- a/src/mongo/dbtests/mock/mock_conn_registry.cpp
+++ b/src/mongo/dbtests/mock/mock_conn_registry.cpp
@@ -35,7 +35,7 @@ namespace mongo {
using std::string;
- boost::scoped_ptr<MockConnRegistry> MockConnRegistry::_instance;
+ std::unique_ptr<MockConnRegistry> MockConnRegistry::_instance;
MONGO_INITIALIZER(MockConnRegistry)(InitializerContext* context) {
return MockConnRegistry::init();
diff --git a/src/mongo/dbtests/mock/mock_conn_registry.h b/src/mongo/dbtests/mock/mock_conn_registry.h
index f87196748ab..a4177ae5592 100644
--- a/src/mongo/dbtests/mock/mock_conn_registry.h
+++ b/src/mongo/dbtests/mock/mock_conn_registry.h
@@ -28,7 +28,6 @@
#pragma once
-#include <boost/scoped_ptr.hpp>
#include "mongo/base/status.h"
#include "mongo/client/dbclientinterface.h"
@@ -111,7 +110,7 @@ namespace mongo {
MockConnRegistry();
- static boost::scoped_ptr<MockConnRegistry> _instance;
+ static std::unique_ptr<MockConnRegistry> _instance;
MockConnHook _mockConnStrHook;
diff --git a/src/mongo/dbtests/mock/mock_dbclient_cursor.h b/src/mongo/dbtests/mock/mock_dbclient_cursor.h
index c8aa3a38bcf..22fec61898b 100644
--- a/src/mongo/dbtests/mock/mock_dbclient_cursor.h
+++ b/src/mongo/dbtests/mock/mock_dbclient_cursor.h
@@ -29,7 +29,6 @@
#pragma once
-#include <boost/scoped_ptr.hpp>
#include "mongo/client/dbclientcursor.h"
#include "mongo/client/dbclientmockcursor.h"
@@ -54,7 +53,7 @@ namespace mongo {
mongo::BSONObj next();
private:
- boost::scoped_ptr<mongo::DBClientMockCursor> _cursor;
+ std::unique_ptr<mongo::DBClientMockCursor> _cursor;
mongo::BSONObj _resultSet;
};
}
diff --git a/src/mongo/dbtests/mock_dbclient_conn_test.cpp b/src/mongo/dbtests/mock_dbclient_conn_test.cpp
index e88bf1f5054..c69fb80134a 100644
--- a/src/mongo/dbtests/mock_dbclient_conn_test.cpp
+++ b/src/mongo/dbtests/mock_dbclient_conn_test.cpp
@@ -35,7 +35,6 @@
#include "mongo/unittest/unittest.h"
#include "mongo/util/timer.h"
-#include <boost/scoped_ptr.hpp>
#include <ctime>
#include <string>
#include <vector>
diff --git a/src/mongo/dbtests/oplogstarttests.cpp b/src/mongo/dbtests/oplogstarttests.cpp
index 9cf68150fb5..9c3efe42afe 100644
--- a/src/mongo/dbtests/oplogstarttests.cpp
+++ b/src/mongo/dbtests/oplogstarttests.cpp
@@ -22,7 +22,6 @@
#include "mongo/dbtests/dbtests.h"
-#include <boost/scoped_ptr.hpp>
#include "mongo/db/catalog/collection.h"
#include "mongo/db/db.h"
@@ -37,7 +36,7 @@
namespace OplogStartTests {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::string;
class Base {
@@ -98,9 +97,9 @@ namespace OplogStartTests {
ASSERT_EQUALS(idEl.numberInt(), expectedId);
}
- scoped_ptr<CanonicalQuery> _cq;
- scoped_ptr<WorkingSet> _oplogws;
- scoped_ptr<OplogStart> _stage;
+ unique_ptr<CanonicalQuery> _cq;
+ unique_ptr<WorkingSet> _oplogws;
+ unique_ptr<OplogStart> _stage;
private:
// The order of these is important in order to ensure order of destruction
diff --git a/src/mongo/dbtests/plan_ranking.cpp b/src/mongo/dbtests/plan_ranking.cpp
index f5a0320d3d6..db937935c83 100644
--- a/src/mongo/dbtests/plan_ranking.cpp
+++ b/src/mongo/dbtests/plan_ranking.cpp
@@ -30,7 +30,6 @@
* This file tests db/query/plan_ranker.cpp and db/query/multi_plan_runner.cpp.
*/
-#include <boost/scoped_ptr.hpp>
#include <iostream>
#include "mongo/client/dbclientcursor.h"
@@ -61,7 +60,7 @@ namespace mongo {
namespace PlanRankingTests {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::vector;
static const char* ns = "unittests.PlanRankingTests";
@@ -119,7 +118,7 @@ namespace PlanRankingTests {
// Fill out the MPR.
_mps.reset(new MultiPlanStage(&_txn, collection, cq));
- boost::scoped_ptr<WorkingSet> ws(new WorkingSet());
+ std::unique_ptr<WorkingSet> ws(new WorkingSet());
// Put each solution from the planner into the MPR.
for (size_t i = 0; i < solutions.size(); ++i) {
PlanStage* root;
@@ -164,7 +163,7 @@ namespace PlanRankingTests {
// of the test.
bool _enableHashIntersection;
- scoped_ptr<MultiPlanStage> _mps;
+ unique_ptr<MultiPlanStage> _mps;
DBDirectClient _client;
};
@@ -191,7 +190,7 @@ namespace PlanRankingTests {
CanonicalQuery* cq;
verify(CanonicalQuery::canonicalize(ns, BSON("a" << 100 << "b" << 1), &cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// {a:100} is super selective so choose that.
// Takes ownership of cq.
@@ -206,7 +205,7 @@ namespace PlanRankingTests {
// And run the same query again.
ASSERT(CanonicalQuery::canonicalize(ns, BSON("a" << 100 << "b" << 1), &cq).isOK());
- boost::scoped_ptr<CanonicalQuery> killCq2(cq);
+ std::unique_ptr<CanonicalQuery> killCq2(cq);
// With the "ranking picks ixisect always" option we pick an intersection plan that uses
// both the {a:1} and {b:1} indices even though it performs poorly.
@@ -241,7 +240,7 @@ namespace PlanRankingTests {
verify(CanonicalQuery::canonicalize(ns, BSON("a" << 1 << "b" << BSON("$gt" << 1)),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Turn on the "force intersect" option.
// This will be reverted by PlanRankingTestBase's destructor when the test completes.
@@ -284,7 +283,7 @@ namespace PlanRankingTests {
BSON("_id" << 0 << "a" << 1 << "b" << 1),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Takes ownership of cq.
QuerySolution* soln = pickBestPlan(cq);
@@ -318,7 +317,7 @@ namespace PlanRankingTests {
BSONObj queryObj = BSON("a" << 1 << "b" << 1 << "c" << 99);
ASSERT(CanonicalQuery::canonicalize(ns, queryObj, &cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Takes ownership of cq.
QuerySolution* soln = pickBestPlan(cq);
@@ -361,7 +360,7 @@ namespace PlanRankingTests {
BSON("_id" << 0 << "a" << 1 << "b" << 1),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Takes ownership of cq.
QuerySolution* soln = pickBestPlan(cq);
@@ -393,7 +392,7 @@ namespace PlanRankingTests {
CanonicalQuery* cq;
verify(CanonicalQuery::canonicalize(ns, BSON("a" << N + 1 << "b" << 1), &cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// {a: 100} is super selective so choose that.
// Takes ownership of cq.
@@ -430,7 +429,7 @@ namespace PlanRankingTests {
verify(CanonicalQuery::canonicalize(ns, BSON("a" << BSON("$gte" << N + 1)
<< "b" << 1), &cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// {a: 100} is super selective so choose that.
// Takes ownership of cq.
@@ -465,7 +464,7 @@ namespace PlanRankingTests {
sortObj,
projObj,
&cq).isOK());
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Takes ownership of cq.
QuerySolution* soln = pickBestPlan(cq);
@@ -494,7 +493,7 @@ namespace PlanRankingTests {
CanonicalQuery* cq;
verify(CanonicalQuery::canonicalize(ns, BSON("foo" << 2001), &cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Takes ownership of cq.
QuerySolution* soln = pickBestPlan(cq);
@@ -531,7 +530,7 @@ namespace PlanRankingTests {
BSON("_id" << 0 << "a" << 1 << "b" << 1),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// We should choose an ixisect plan because it requires fewer fetches.
// Takes ownership of cq.
@@ -568,7 +567,7 @@ namespace PlanRankingTests {
BSON("a" << 1 << "b" << 1),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// The intersection is large, and ixisect does not make the
// query covered. We should NOT choose an intersection plan.
@@ -620,7 +619,7 @@ namespace PlanRankingTests {
fromjson("{a: 1, b: 1}"),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
QuerySolution* soln = pickBestPlan(cq);
ASSERT(QueryPlannerTestLib::solutionMatches(
@@ -661,7 +660,7 @@ namespace PlanRankingTests {
fromjson("{a: 1, b: 1}"),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Choose the index intersection plan.
QuerySolution* soln = pickBestPlan(cq);
@@ -704,7 +703,7 @@ namespace PlanRankingTests {
fromjson("{a: 1, b: 1, c: 1}"),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Intersection between 'b' and 'c' should hit EOF while the
// other plans are busy fetching documents.
@@ -742,7 +741,7 @@ namespace PlanRankingTests {
BSONObj(), // projection
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// No results will be returned during the trial period,
// so we expect to choose {d: 1, e: 1}, as it allows us
@@ -779,7 +778,7 @@ namespace PlanRankingTests {
fromjson("{a: 1, b: 1, c: {$gte: 5000}}"),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Use index on 'b'.
QuerySolution* soln = pickBestPlan(cq);
@@ -812,7 +811,7 @@ namespace PlanRankingTests {
fromjson("{a: 9, b: {$ne: 10}, c: 9}"),
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Expect to use index {a: 1, b: 1}.
QuerySolution* soln = pickBestPlan(cq);
diff --git a/src/mongo/dbtests/query_multi_plan_runner.cpp b/src/mongo/dbtests/query_multi_plan_runner.cpp
index c43b5ab111b..6e033631f02 100644
--- a/src/mongo/dbtests/query_multi_plan_runner.cpp
+++ b/src/mongo/dbtests/query_multi_plan_runner.cpp
@@ -26,7 +26,6 @@
* then also delete it in the license file.
*/
-#include <boost/scoped_ptr.hpp>
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/database.h"
@@ -57,7 +56,7 @@ namespace mongo {
namespace QueryMultiPlanRunner {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::unique_ptr;
using std::vector;
@@ -170,7 +169,7 @@ namespace QueryMultiPlanRunner {
Status status = PlanExecutor::make(&_txn, sharedWs.release(), mps, cq, coll,
PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
// Get all our results out.
int results = 0;
@@ -207,7 +206,7 @@ namespace QueryMultiPlanRunner {
BSONObj(), // proj
&cq).isOK());
ASSERT(NULL != cq);
- boost::scoped_ptr<CanonicalQuery> killCq(cq);
+ std::unique_ptr<CanonicalQuery> killCq(cq);
// Force index intersection.
bool forceIxisectOldValue = internalQueryForceIntersectionPlans;
@@ -229,8 +228,8 @@ namespace QueryMultiPlanRunner {
ASSERT_EQUALS(solutions.size(), 3U);
// Fill out the MultiPlanStage.
- scoped_ptr<MultiPlanStage> mps(new MultiPlanStage(&_txn, collection, cq));
- scoped_ptr<WorkingSet> ws(new WorkingSet());
+ unique_ptr<MultiPlanStage> mps(new MultiPlanStage(&_txn, collection, cq));
+ unique_ptr<WorkingSet> ws(new WorkingSet());
// Put each solution from the planner into the MPR.
for (size_t i = 0; i < solutions.size(); ++i) {
PlanStage* root;
diff --git a/src/mongo/dbtests/query_plan_executor.cpp b/src/mongo/dbtests/query_plan_executor.cpp
index e79c9980898..137ee3b9984 100644
--- a/src/mongo/dbtests/query_plan_executor.cpp
+++ b/src/mongo/dbtests/query_plan_executor.cpp
@@ -26,7 +26,6 @@
* then also delete it in the license file.
*/
-#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include "mongo/db/catalog/collection.h"
@@ -51,7 +50,7 @@
namespace QueryPlanExecutor {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using boost::shared_ptr;
using std::unique_ptr;
using std::string;
@@ -210,7 +209,7 @@ namespace QueryPlanExecutor {
BSONObj filterObj = fromjson("{_id: {$gt: 0}}");
Collection* coll = ctx.getCollection();
- scoped_ptr<PlanExecutor> exec(makeCollScanExec(coll, filterObj));
+ unique_ptr<PlanExecutor> exec(makeCollScanExec(coll, filterObj));
registerExec(exec.get());
BSONObj objOut;
@@ -239,7 +238,7 @@ namespace QueryPlanExecutor {
BSONObj indexSpec = BSON("a" << 1);
addIndex(indexSpec);
- scoped_ptr<PlanExecutor> exec(makeIndexScanExec(ctx.db(), indexSpec, 7, 10));
+ unique_ptr<PlanExecutor> exec(makeIndexScanExec(ctx.db(), indexSpec, 7, 10));
registerExec(exec.get());
BSONObj objOut;
@@ -293,7 +292,7 @@ namespace QueryPlanExecutor {
Status status = PlanExecutor::make(&_txn, ws.release(), proxy.release(), collection,
PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> outerExec(rawExec);
+ std::unique_ptr<PlanExecutor> outerExec(rawExec);
// Only the outer executor gets registered.
registerExec(outerExec.get());
@@ -363,7 +362,7 @@ namespace QueryPlanExecutor {
BSONObj filterObj = fromjson("{a: {$gte: 2}}");
Collection* coll = ctx.getCollection();
- scoped_ptr<PlanExecutor> exec(makeCollScanExec(coll, filterObj));
+ unique_ptr<PlanExecutor> exec(makeCollScanExec(coll, filterObj));
BSONObj objOut;
ASSERT_EQUALS(PlanExecutor::ADVANCED, exec->getNext(&objOut, NULL));
@@ -390,7 +389,7 @@ namespace QueryPlanExecutor {
addIndex(indexSpec);
BSONObj filterObj = fromjson("{a: {$gte: 2}}");
- scoped_ptr<PlanExecutor> exec(makeIndexScanExec(ctx.db(), indexSpec, 2, 5));
+ unique_ptr<PlanExecutor> exec(makeIndexScanExec(ctx.db(), indexSpec, 2, 5));
BSONObj objOut;
ASSERT_EQUALS(PlanExecutor::ADVANCED, exec->getNext(&objOut, NULL));
diff --git a/src/mongo/dbtests/query_stage_and.cpp b/src/mongo/dbtests/query_stage_and.cpp
index 8b59cc7304b..5b421b5807a 100644
--- a/src/mongo/dbtests/query_stage_and.cpp
+++ b/src/mongo/dbtests/query_stage_and.cpp
@@ -31,7 +31,6 @@
* so we cannot test it outside of a dbtest.
*/
-#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include "mongo/client/dbclientcursor.h"
@@ -54,7 +53,7 @@
namespace QueryStageAnd {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using boost::shared_ptr;
using std::unique_ptr;
using std::set;
@@ -179,7 +178,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
// Foo <= 20
IndexScanParams params;
@@ -283,7 +282,7 @@ namespace QueryStageAnd {
addIndex(BSON("baz" << 1));
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
// Foo <= 20 (descending)
IndexScanParams params;
@@ -370,7 +369,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
// Foo <= 20
IndexScanParams params;
@@ -425,7 +424,7 @@ namespace QueryStageAnd {
// before hashed AND is done reading the first child (stage has to
// hold 21 keys in buffer for Foo <= 20).
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll, 20 * big.size()));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll, 20 * big.size()));
// Foo <= 20
IndexScanParams params;
@@ -478,7 +477,7 @@ namespace QueryStageAnd {
// keys in last child's index are not buffered. There are 6 keys
// that satisfy the criteria Foo <= 20 and Bar >= 10 and 5 <= baz <= 15.
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll, 5 * big.size()));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll, 5 * big.size()));
// Foo <= 20
IndexScanParams params;
@@ -526,7 +525,7 @@ namespace QueryStageAnd {
addIndex(BSON("baz" << 1));
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
// Foo <= 20
IndexScanParams params;
@@ -593,7 +592,7 @@ namespace QueryStageAnd {
// before hashed AND is done reading the second child (stage has to
// hold 11 keys in buffer for Foo <= 20 and Bar >= 10).
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll, 10 * big.size()));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll, 10 * big.size()));
// Foo <= 20
IndexScanParams params;
@@ -647,7 +646,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
// Foo <= 20
IndexScanParams params;
@@ -708,7 +707,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
// Foo >= 100
IndexScanParams params;
@@ -760,7 +759,7 @@ namespace QueryStageAnd {
StatusWithMatchExpression swme = MatchExpressionParser::parse(filter);
verify(swme.isOK());
unique_ptr<MatchExpression> filterExpr(swme.getValue());
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, filterExpr.get(), coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, filterExpr.get(), coll));
// Foo <= 20
IndexScanParams params;
@@ -809,7 +808,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
// Foo <= 20
IndexScanParams params;
@@ -868,7 +867,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
// Foo <= 20
IndexScanParams params;
@@ -1069,7 +1068,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndSortedStage> ah(new AndSortedStage(&ws, NULL, coll));
+ unique_ptr<AndSortedStage> ah(new AndSortedStage(&ws, NULL, coll));
// Scan over foo == 1
IndexScanParams params;
@@ -1196,7 +1195,7 @@ namespace QueryStageAnd {
addIndex(BSON("baz" << 1));
WorkingSet ws;
- scoped_ptr<AndSortedStage> ah(new AndSortedStage(&ws, NULL, coll));
+ unique_ptr<AndSortedStage> ah(new AndSortedStage(&ws, NULL, coll));
// Scan over foo == 1
IndexScanParams params;
@@ -1241,7 +1240,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndSortedStage> ah(new AndSortedStage(&ws, NULL, coll));
+ unique_ptr<AndSortedStage> ah(new AndSortedStage(&ws, NULL, coll));
// Foo == 7. Should be EOF.
IndexScanParams params;
@@ -1290,7 +1289,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndSortedStage> ah(new AndSortedStage(&ws, NULL, coll));
+ unique_ptr<AndSortedStage> ah(new AndSortedStage(&ws, NULL, coll));
// foo == 7.
IndexScanParams params;
@@ -1339,7 +1338,7 @@ namespace QueryStageAnd {
StatusWithMatchExpression swme = MatchExpressionParser::parse(filterObj);
verify(swme.isOK());
unique_ptr<MatchExpression> filterExpr(swme.getValue());
- scoped_ptr<AndSortedStage> ah(new AndSortedStage(&ws, filterExpr.get(), coll));
+ unique_ptr<AndSortedStage> ah(new AndSortedStage(&ws, filterExpr.get(), coll));
// Scan over foo == 1
IndexScanParams params;
@@ -1381,7 +1380,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
+ unique_ptr<AndHashStage> ah(new AndHashStage(&ws, NULL, coll));
// Scan over foo == 1
IndexScanParams params;
@@ -1445,7 +1444,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndSortedStage> as(new AndSortedStage(&ws, NULL, coll));
+ unique_ptr<AndSortedStage> as(new AndSortedStage(&ws, NULL, coll));
// Scan over foo == 1
IndexScanParams params;
@@ -1499,7 +1498,7 @@ namespace QueryStageAnd {
addIndex(BSON("bar" << 1));
WorkingSet ws;
- scoped_ptr<AndSortedStage> as(new AndSortedStage(&ws, NULL, coll));
+ unique_ptr<AndSortedStage> as(new AndSortedStage(&ws, NULL, coll));
// Scan over foo == 1
IndexScanParams params;
diff --git a/src/mongo/dbtests/query_stage_collscan.cpp b/src/mongo/dbtests/query_stage_collscan.cpp
index ffb204c2623..b190e852df8 100644
--- a/src/mongo/dbtests/query_stage_collscan.cpp
+++ b/src/mongo/dbtests/query_stage_collscan.cpp
@@ -30,7 +30,6 @@
* This file tests db/exec/collection_scan.cpp.
*/
-#include <boost/scoped_ptr.hpp>
#include "mongo/client/dbclientcursor.h"
#include "mongo/db/catalog/collection.h"
@@ -49,7 +48,7 @@
namespace QueryStageCollectionScan {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::unique_ptr;
using std::vector;
@@ -100,7 +99,7 @@ namespace QueryStageCollectionScan {
Status status = PlanExecutor::make(&_txn, ws, ps, params.collection,
PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
// Use the runner to count the number of objects scanned.
int count = 0;
@@ -118,7 +117,7 @@ namespace QueryStageCollectionScan {
params.direction = direction;
params.tailable = false;
- scoped_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
+ unique_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
while (!scan->isEOF()) {
WorkingSetID id = WorkingSet::INVALID_ID;
PlanStage::StageState state = scan->work(&id);
@@ -210,7 +209,7 @@ namespace QueryStageCollectionScan {
Status status = PlanExecutor::make(&_txn, ws, ps, params.collection,
PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
int count = 0;
for (BSONObj obj; PlanExecutor::ADVANCED == exec->getNext(&obj, NULL); ) {
@@ -244,7 +243,7 @@ namespace QueryStageCollectionScan {
Status status = PlanExecutor::make(&_txn, ws, ps, params.collection,
PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
int count = 0;
for (BSONObj obj; PlanExecutor::ADVANCED == exec->getNext(&obj, NULL); ) {
@@ -279,7 +278,7 @@ namespace QueryStageCollectionScan {
params.tailable = false;
WorkingSet ws;
- scoped_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
+ unique_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
int count = 0;
while (count < 10) {
@@ -340,7 +339,7 @@ namespace QueryStageCollectionScan {
params.tailable = false;
WorkingSet ws;
- scoped_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
+ unique_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
int count = 0;
while (count < 10) {
diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp
index 7adc5b6996f..09f64990bda 100644
--- a/src/mongo/dbtests/query_stage_count.cpp
+++ b/src/mongo/dbtests/query_stage_count.cpp
@@ -26,7 +26,6 @@
* it in the license file.
*/
-#include <boost/scoped_ptr.hpp>
#include <memory>
#include "mongo/db/db_raii.h"
@@ -43,7 +42,7 @@
namespace QueryStageCount {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::unique_ptr;
using std::vector;
@@ -97,7 +96,7 @@ namespace QueryStageCount {
params.direction = CollectionScanParams::FORWARD;
params.tailable = false;
- scoped_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
+ unique_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
while (!scan->isEOF()) {
WorkingSetID id = WorkingSet::INVALID_ID;
PlanStage::StageState state = scan->work(&id);
diff --git a/src/mongo/dbtests/query_stage_delete.cpp b/src/mongo/dbtests/query_stage_delete.cpp
index f5c8ec18913..624be2a75f4 100644
--- a/src/mongo/dbtests/query_stage_delete.cpp
+++ b/src/mongo/dbtests/query_stage_delete.cpp
@@ -30,7 +30,6 @@
* This file tests db/exec/delete.cpp.
*/
-#include <boost/scoped_ptr.hpp>
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/database.h"
@@ -47,7 +46,7 @@
namespace QueryStageDelete {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::vector;
//
@@ -86,7 +85,7 @@ namespace QueryStageDelete {
params.direction = direction;
params.tailable = false;
- scoped_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
+ unique_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
while (!scan->isEOF()) {
WorkingSetID id = WorkingSet::INVALID_ID;
PlanStage::StageState state = scan->work(&id);
diff --git a/src/mongo/dbtests/query_stage_ixscan.cpp b/src/mongo/dbtests/query_stage_ixscan.cpp
index e56ba1128f4..e6e78f8b824 100644
--- a/src/mongo/dbtests/query_stage_ixscan.cpp
+++ b/src/mongo/dbtests/query_stage_ixscan.cpp
@@ -181,7 +181,7 @@ namespace QueryStageIxscan {
insert(fromjson("{_id: 2, x: 6}"));
insert(fromjson("{_id: 3, x: 12}"));
- boost::scoped_ptr<IndexScan> ixscan(createIndexScan(BSON("x" << 5),
+ std::unique_ptr<IndexScan> ixscan(createIndexScan(BSON("x" << 5),
BSON("x" << 10),
true,
true));
@@ -220,7 +220,7 @@ namespace QueryStageIxscan {
insert(fromjson("{_id: 2, x: 6}"));
insert(fromjson("{_id: 3, x: 10}"));
- boost::scoped_ptr<IndexScan> ixscan(createIndexScan(BSON("x" << 5),
+ std::unique_ptr<IndexScan> ixscan(createIndexScan(BSON("x" << 5),
BSON("x" << 10),
false,
false));
@@ -255,7 +255,7 @@ namespace QueryStageIxscan {
insert(fromjson("{_id: 2, x: 6}"));
insert(fromjson("{_id: 3, x: 12}"));
- boost::scoped_ptr<IndexScan> ixscan(createIndexScan(BSON("x" << 5),
+ std::unique_ptr<IndexScan> ixscan(createIndexScan(BSON("x" << 5),
BSON("x" << 10),
false,
false));
@@ -287,7 +287,7 @@ namespace QueryStageIxscan {
insert(fromjson("{_id: 2, x: 8}"));
insert(fromjson("{_id: 3, x: 3}"));
- boost::scoped_ptr<IndexScan> ixscan(createIndexScan(BSON("x" << 10),
+ std::unique_ptr<IndexScan> ixscan(createIndexScan(BSON("x" << 10),
BSON("x" << 5),
true,
true,
diff --git a/src/mongo/dbtests/query_stage_limit_skip.cpp b/src/mongo/dbtests/query_stage_limit_skip.cpp
index afb4436e4b9..b7561d12f8b 100644
--- a/src/mongo/dbtests/query_stage_limit_skip.cpp
+++ b/src/mongo/dbtests/query_stage_limit_skip.cpp
@@ -30,7 +30,6 @@
* This file tests db/exec/limit.cpp and db/exec/skip.cpp.
*/
-#include <boost/scoped_ptr.hpp>
#include "mongo/client/dbclientcursor.h"
#include "mongo/db/exec/limit.h"
@@ -45,7 +44,7 @@ using namespace mongo;
namespace {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::unique_ptr;
using std::max;
using std::min;
@@ -89,10 +88,10 @@ namespace {
for (int i = 0; i < 2 * N; ++i) {
WorkingSet ws;
- scoped_ptr<PlanStage> skip(new SkipStage(i, &ws, getMS(&ws)));
+ unique_ptr<PlanStage> skip(new SkipStage(i, &ws, getMS(&ws)));
ASSERT_EQUALS(max(0, N - i), countResults(skip.get()));
- scoped_ptr<PlanStage> limit(new LimitStage(i, &ws, getMS(&ws)));
+ unique_ptr<PlanStage> limit(new LimitStage(i, &ws, getMS(&ws)));
ASSERT_EQUALS(min(N, i), countResults(limit.get()));
}
}
diff --git a/src/mongo/dbtests/query_stage_merge_sort.cpp b/src/mongo/dbtests/query_stage_merge_sort.cpp
index f4fa4ea9bd7..b05799b8588 100644
--- a/src/mongo/dbtests/query_stage_merge_sort.cpp
+++ b/src/mongo/dbtests/query_stage_merge_sort.cpp
@@ -159,7 +159,7 @@ namespace QueryStageMergeSortTests {
Status status = PlanExecutor::make(&_txn, ws, new FetchStage(&_txn, ws, ms, NULL, coll),
coll, PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
for (int i = 0; i < N; ++i) {
BSONObj first, second;
@@ -227,7 +227,7 @@ namespace QueryStageMergeSortTests {
Status status = PlanExecutor::make(&_txn, ws, new FetchStage(&_txn, ws, ms, NULL, coll),
coll, PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
for (int i = 0; i < N; ++i) {
BSONObj first, second;
@@ -295,7 +295,7 @@ namespace QueryStageMergeSortTests {
Status status = PlanExecutor::make(&_txn, ws, new FetchStage(&_txn, ws, ms, NULL, coll),
coll, PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
for (int i = 0; i < N; ++i) {
BSONObj first, second;
@@ -366,7 +366,7 @@ namespace QueryStageMergeSortTests {
Status status = PlanExecutor::make(&_txn, ws, new FetchStage(&_txn, ws, ms, NULL, coll),
coll, PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
for (int i = 0; i < N; ++i) {
BSONObj first, second;
@@ -436,7 +436,7 @@ namespace QueryStageMergeSortTests {
Status status = PlanExecutor::make(&_txn, ws, new FetchStage(&_txn, ws, ms, NULL, coll),
coll, PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
// Only getting results from the a:1 index scan.
for (int i = 0; i < N; ++i) {
@@ -494,7 +494,7 @@ namespace QueryStageMergeSortTests {
Status status = PlanExecutor::make(&_txn, ws, new FetchStage(&_txn, ws, ms, NULL, coll),
coll, PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
for (int i = 0; i < numIndices; ++i) {
BSONObj obj;
diff --git a/src/mongo/dbtests/query_stage_sort.cpp b/src/mongo/dbtests/query_stage_sort.cpp
index b9b34bda21f..eac35313223 100644
--- a/src/mongo/dbtests/query_stage_sort.cpp
+++ b/src/mongo/dbtests/query_stage_sort.cpp
@@ -161,7 +161,7 @@ namespace QueryStageSortTests {
new SortStage(params, ws, ms), NULL, coll),
coll, PlanExecutor::YIELD_MANUAL, &rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
// Look at pairs of objects to make sure that the sort order is pairwise (and therefore
// totally) correct.
@@ -533,7 +533,7 @@ namespace QueryStageSortTests {
ws,
new SortStage(params, ws, ms), NULL, coll),
coll, PlanExecutor::YIELD_MANUAL, &rawExec);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
PlanExecutor::ExecState runnerState = exec->getNext(NULL, NULL);
ASSERT_EQUALS(PlanExecutor::FAILURE, runnerState);
diff --git a/src/mongo/dbtests/query_stage_subplan.cpp b/src/mongo/dbtests/query_stage_subplan.cpp
index f7cd4e8ba51..d5afbbabc7b 100644
--- a/src/mongo/dbtests/query_stage_subplan.cpp
+++ b/src/mongo/dbtests/query_stage_subplan.cpp
@@ -85,7 +85,7 @@ namespace QueryStageSubplan {
CanonicalQuery* rawCq;
ASSERT_OK(CanonicalQuery::canonicalize(ns(), query, &rawCq));
- boost::scoped_ptr<CanonicalQuery> cq(rawCq);
+ std::unique_ptr<CanonicalQuery> cq(rawCq);
Collection* collection = ctx.getCollection();
@@ -94,7 +94,7 @@ namespace QueryStageSubplan {
fillOutPlannerParams(&_txn, collection, cq.get(), &plannerParams);
WorkingSet ws;
- boost::scoped_ptr<SubplanStage> subplan(new SubplanStage(&_txn, collection, &ws,
+ std::unique_ptr<SubplanStage> subplan(new SubplanStage(&_txn, collection, &ws,
plannerParams, cq.get()));
// Plan selection should succeed due to falling back on regular planning.
@@ -128,14 +128,14 @@ namespace QueryStageSubplan {
CanonicalQuery* rawCq;
ASSERT_OK(CanonicalQuery::canonicalize(ns(), query, &rawCq));
- boost::scoped_ptr<CanonicalQuery> cq(rawCq);
+ std::unique_ptr<CanonicalQuery> cq(rawCq);
// Get planner params.
QueryPlannerParams plannerParams;
fillOutPlannerParams(&_txn, collection, cq.get(), &plannerParams);
WorkingSet ws;
- boost::scoped_ptr<SubplanStage> subplan(new SubplanStage(&_txn, collection, &ws,
+ std::unique_ptr<SubplanStage> subplan(new SubplanStage(&_txn, collection, &ws,
plannerParams, cq.get()));
PlanYieldPolicy yieldPolicy(NULL, PlanExecutor::YIELD_MANUAL);
diff --git a/src/mongo/dbtests/query_stage_tests.cpp b/src/mongo/dbtests/query_stage_tests.cpp
index c5365d140ae..4bf744f705d 100644
--- a/src/mongo/dbtests/query_stage_tests.cpp
+++ b/src/mongo/dbtests/query_stage_tests.cpp
@@ -90,7 +90,7 @@ namespace QueryStageTests {
PlanExecutor::YIELD_MANUAL,
&rawExec);
ASSERT_OK(status);
- boost::scoped_ptr<PlanExecutor> exec(rawExec);
+ std::unique_ptr<PlanExecutor> exec(rawExec);
int count = 0;
for (RecordId dl; PlanExecutor::ADVANCED == exec->getNext(NULL, &dl); ) {
diff --git a/src/mongo/dbtests/query_stage_update.cpp b/src/mongo/dbtests/query_stage_update.cpp
index 92f95f5fdb6..edc3c952fca 100644
--- a/src/mongo/dbtests/query_stage_update.cpp
+++ b/src/mongo/dbtests/query_stage_update.cpp
@@ -30,7 +30,6 @@
* This file tests db/exec/update.cpp (UpdateStage).
*/
-#include <boost/scoped_ptr.hpp>
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/database.h"
@@ -54,7 +53,7 @@
namespace QueryStageUpdate {
- using boost::scoped_ptr;
+ using std::unique_ptr;
using std::unique_ptr;
using std::vector;
@@ -120,7 +119,7 @@ namespace QueryStageUpdate {
params.direction = CollectionScanParams::FORWARD;
params.tailable = false;
- scoped_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
+ unique_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
while (!scan->isEOF()) {
WorkingSetID id = WorkingSet::INVALID_ID;
PlanStage::StageState state = scan->work(&id);
@@ -142,7 +141,7 @@ namespace QueryStageUpdate {
params.direction = direction;
params.tailable = false;
- scoped_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
+ unique_ptr<CollectionScan> scan(new CollectionScan(&_txn, params, &ws, NULL));
while (!scan->isEOF()) {
WorkingSetID id = WorkingSet::INVALID_ID;
PlanStage::StageState state = scan->work(&id);
@@ -215,13 +214,13 @@ namespace QueryStageUpdate {
// Setup update params.
UpdateStageParams params(&request, &driver, opDebug);
- scoped_ptr<CanonicalQuery> cq(canonicalize(query));
+ unique_ptr<CanonicalQuery> cq(canonicalize(query));
params.canonicalQuery = cq.get();
- scoped_ptr<WorkingSet> ws(new WorkingSet());
+ unique_ptr<WorkingSet> ws(new WorkingSet());
unique_ptr<EOFStage> eofStage(new EOFStage());
- scoped_ptr<UpdateStage> updateStage(
+ unique_ptr<UpdateStage> updateStage(
new UpdateStage(&_txn, params, ws.get(), collection, eofStage.release()));
runUpdate(updateStage.get());
@@ -292,14 +291,14 @@ namespace QueryStageUpdate {
// Configure the update.
UpdateStageParams updateParams(&request, &driver, opDebug);
- scoped_ptr<CanonicalQuery> cq(canonicalize(query));
+ unique_ptr<CanonicalQuery> cq(canonicalize(query));
updateParams.canonicalQuery = cq.get();
- scoped_ptr<WorkingSet> ws(new WorkingSet());
+ unique_ptr<WorkingSet> ws(new WorkingSet());
unique_ptr<CollectionScan> cs(
new CollectionScan(&_txn, collScanParams, ws.get(), cq->root()));
- scoped_ptr<UpdateStage> updateStage(
+ unique_ptr<UpdateStage> updateStage(
new UpdateStage(&_txn, updateParams, ws.get(), coll, cs.release()));
const UpdateStats* stats =
diff --git a/src/mongo/dbtests/replica_set_monitor_test.cpp b/src/mongo/dbtests/replica_set_monitor_test.cpp
index 33d489b2973..12b814f4ad2 100644
--- a/src/mongo/dbtests/replica_set_monitor_test.cpp
+++ b/src/mongo/dbtests/replica_set_monitor_test.cpp
@@ -35,7 +35,6 @@
#include "mongo/dbtests/mock/mock_replica_set.h"
#include "mongo/unittest/unittest.h"
-#include <boost/scoped_ptr.hpp>
#include <set>
#include <vector>
@@ -47,7 +46,7 @@ namespace {
using std::vector;
using std::set;
using std::string;
- using boost::scoped_ptr;
+ using std::unique_ptr;
// TODO: Port these existing tests here: replmonitor_bad_seed.js, repl_monitor_refresh.js
@@ -77,7 +76,7 @@ namespace {
private:
ConnectionString::ConnectionHook* _originalConnectionHook;
- boost::scoped_ptr<MockReplicaSet> _replSet;
+ std::unique_ptr<MockReplicaSet> _replSet;
};
TEST_F(ReplicaSetMonitorTest, SeedWithPriOnlySecDown) {
@@ -245,7 +244,7 @@ namespace {
private:
ConnectionString::ConnectionHook* _originalConnectionHook;
- boost::scoped_ptr<MockReplicaSet> _replSet;
+ std::unique_ptr<MockReplicaSet> _replSet;
};
// Tests the case where the connection to secondary went bad and the replica set
diff --git a/src/mongo/dbtests/rollbacktests.cpp b/src/mongo/dbtests/rollbacktests.cpp
index 74078abf1b1..cd832d9dba8 100644
--- a/src/mongo/dbtests/rollbacktests.cpp
+++ b/src/mongo/dbtests/rollbacktests.cpp
@@ -28,7 +28,6 @@
* then also delete it in the license file.
*/
-#include <boost/scoped_ptr.hpp>
#include "mongo/bson/bsonobj.h"
#include "mongo/db/catalog/collection.h"
@@ -42,7 +41,7 @@
#include "mongo/dbtests/dbtests.h"
#include "mongo/unittest/unittest.h"
-using boost::scoped_ptr;
+using std::unique_ptr;
using std::list;
using std::string;