diff options
author | Andrew Morrow <acm@mongodb.com> | 2015-06-10 19:01:38 -0400 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2015-06-10 22:38:00 -0400 |
commit | 4035cab6b974613af9eb06ac1a92cc39d6ba8e06 (patch) | |
tree | 15c606e4514037d563fad28de9c091de3d9e473e /src/mongo/db | |
parent | 1360f243ee7fa662c0ded25a9bc479aa47388446 (diff) | |
download | mongo-4035cab6b974613af9eb06ac1a92cc39d6ba8e06.tar.gz |
SERVER-17307 Replace boost::shared_ptr and friends with std::shared_ptr
Diffstat (limited to 'src/mongo/db')
48 files changed, 134 insertions, 181 deletions
diff --git a/src/mongo/db/background.cpp b/src/mongo/db/background.cpp index 6c859d5d700..94969dba15d 100644 --- a/src/mongo/db/background.cpp +++ b/src/mongo/db/background.cpp @@ -32,7 +32,6 @@ #include "mongo/db/background.h" -#include <boost/shared_ptr.hpp> #include <boost/thread.hpp> #include <iostream> #include <string> @@ -45,7 +44,7 @@ namespace mongo { - using boost::shared_ptr; + using std::shared_ptr; namespace { @@ -65,7 +64,7 @@ namespace { boost::condition_variable _noOpsInProg; }; - typedef StringMap<boost::shared_ptr<BgInfo> > BgInfoMap; + typedef StringMap<std::shared_ptr<BgInfo> > BgInfoMap; typedef BgInfoMap::const_iterator BgInfoMapIterator; boost::mutex m; @@ -91,7 +90,7 @@ namespace { } void recordBeginAndInsert(BgInfoMap* bgiMap, StringData key) { - boost::shared_ptr<BgInfo>& bgInfo = bgiMap->get(key); + std::shared_ptr<BgInfo>& bgInfo = bgiMap->get(key); if (!bgInfo) bgInfo.reset(new BgInfo); bgInfo->recordBegin(); @@ -110,8 +109,8 @@ namespace { BgInfoMap* bgiMap, StringData key) { - boost::shared_ptr<BgInfo> bgInfo = mapFindWithDefault( - *bgiMap, key, boost::shared_ptr<BgInfo>()); + std::shared_ptr<BgInfo> bgInfo = mapFindWithDefault( + *bgiMap, key, std::shared_ptr<BgInfo>()); if (!bgInfo) return; bgInfo->awaitNoBgOps(lk); diff --git a/src/mongo/db/catalog/index_create.cpp b/src/mongo/db/catalog/index_create.cpp index 84ed9d7e99d..b624c0151f0 100644 --- a/src/mongo/db/catalog/index_create.cpp +++ b/src/mongo/db/catalog/index_create.cpp @@ -34,7 +34,6 @@ #include "mongo/db/catalog/index_create.h" -#include <boost/make_shared.hpp> #include "mongo/base/error_codes.h" #include "mongo/client/dbclientinterface.h" diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index 4551380d44a..fa9d590b2e8 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -72,7 +72,7 @@ namespace mongo { using std::unique_ptr; - using boost::shared_ptr; + using std::shared_ptr; using std::unique_ptr; using std::endl; using std::set; diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index d8e575e1dcf..2c9a8704577 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -28,7 +28,6 @@ #include "mongo/platform/basic.h" -#include <boost/shared_ptr.hpp> #include <vector> #include "mongo/db/auth/action_set.h" @@ -57,7 +56,7 @@ namespace mongo { using boost::intrusive_ptr; using std::unique_ptr; - using boost::shared_ptr; + using std::shared_ptr; using std::unique_ptr; using std::string; using std::stringstream; @@ -232,7 +231,7 @@ namespace mongo { // This does mongod-specific stuff like creating the input PlanExecutor and adding // it to the front of the pipeline if needed. - boost::shared_ptr<PlanExecutor> input = PipelineD::prepareCursorSource(txn, + std::shared_ptr<PlanExecutor> input = PipelineD::prepareCursorSource(txn, collection, pPipeline, pCtx); diff --git a/src/mongo/db/concurrency/lock_state_test.cpp b/src/mongo/db/concurrency/lock_state_test.cpp index fd0042fc12c..cb9aab0172a 100644 --- a/src/mongo/db/concurrency/lock_state_test.cpp +++ b/src/mongo/db/concurrency/lock_state_test.cpp @@ -30,7 +30,6 @@ #include "mongo/platform/basic.h" -#include <boost/shared_ptr.hpp> #include <vector> #include "mongo/config.h" @@ -287,7 +286,7 @@ namespace { TEST(Locker, PerformanceLocker) { for (int numLockers = 1; numLockers <= 64; numLockers = numLockers * 2) { - std::vector<boost::shared_ptr<LockerForTests> > lockers(numLockers); + std::vector<std::shared_ptr<LockerForTests> > lockers(numLockers); for (int i = 0; i < numLockers; i++) { lockers[i].reset(new LockerForTests(MODE_S)); } diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index 66c45f76dff..4cd250f2c15 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -35,7 +35,6 @@ #include <boost/thread/thread.hpp> #include <boost/filesystem/operations.hpp> #include <boost/optional.hpp> -#include <boost/shared_ptr.hpp> #include <fstream> #include <iostream> #include <limits> @@ -415,7 +414,7 @@ namespace mongo { // do not want connections to just hang if recovery takes a very long time. server->setupSockets(); - boost::shared_ptr<DbWebServer> dbWebServer; + std::shared_ptr<DbWebServer> dbWebServer; if (serverGlobalParams.isHttpInterfaceEnabled) { dbWebServer.reset(new DbWebServer(serverGlobalParams.bind_ip, serverGlobalParams.port + 1000, diff --git a/src/mongo/db/dbwebserver.cpp b/src/mongo/db/dbwebserver.cpp index dadf01d432d..73662327766 100644 --- a/src/mongo/db/dbwebserver.cpp +++ b/src/mongo/db/dbwebserver.cpp @@ -604,7 +604,7 @@ namespace { vector<DbWebHandler*> * DbWebHandler::_handlers = 0; - void webServerListenThread(boost::shared_ptr<DbWebServer> dbWebServer) { + void webServerListenThread(std::shared_ptr<DbWebServer> dbWebServer) { Client::initThread("websvr"); dbWebServer->initAndListen(); diff --git a/src/mongo/db/dbwebserver.h b/src/mongo/db/dbwebserver.h index 10ded265989..a7135601221 100644 --- a/src/mongo/db/dbwebserver.h +++ b/src/mongo/db/dbwebserver.h @@ -31,7 +31,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include <string> #include <vector> @@ -132,7 +131,7 @@ namespace mongo { const std::unique_ptr<AdminAccess> _webUsers; }; - void webServerListenThread(boost::shared_ptr<DbWebServer> dbWebServer); + void webServerListenThread(std::shared_ptr<DbWebServer> dbWebServer); std::string prettyHostName(); diff --git a/src/mongo/db/exec/pipeline_proxy.cpp b/src/mongo/db/exec/pipeline_proxy.cpp index 18d551ee8fd..d7082cacdbc 100644 --- a/src/mongo/db/exec/pipeline_proxy.cpp +++ b/src/mongo/db/exec/pipeline_proxy.cpp @@ -30,7 +30,6 @@ #include "mongo/db/exec/pipeline_proxy.h" -#include <boost/shared_ptr.hpp> #include "mongo/db/pipeline/document_source.h" #include "mongo/db/pipeline/expression_context.h" @@ -38,13 +37,13 @@ namespace mongo { using boost::intrusive_ptr; - using boost::shared_ptr; + using std::shared_ptr; using std::vector; const char* PipelineProxyStage::kStageType = "PIPELINE_PROXY"; PipelineProxyStage::PipelineProxyStage(intrusive_ptr<Pipeline> pipeline, - const boost::shared_ptr<PlanExecutor>& child, + const std::shared_ptr<PlanExecutor>& child, WorkingSet* ws) : _pipeline(pipeline) , _includeMetaData(_pipeline->getContext()->inShard) // send metadata to merger @@ -93,7 +92,7 @@ namespace mongo { const RecordId& dl, InvalidationType type) { // propagate to child executor if still in use - if (boost::shared_ptr<PlanExecutor> exec = _childExec.lock()) { + if (std::shared_ptr<PlanExecutor> exec = _childExec.lock()) { exec->invalidate(txn, dl, type); } } diff --git a/src/mongo/db/exec/pipeline_proxy.h b/src/mongo/db/exec/pipeline_proxy.h index 4de2f947a32..68a33c0170e 100644 --- a/src/mongo/db/exec/pipeline_proxy.h +++ b/src/mongo/db/exec/pipeline_proxy.h @@ -30,8 +30,6 @@ #include <boost/optional/optional.hpp> #include <boost/intrusive_ptr.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/weak_ptr.hpp> #include "mongo/db/catalog/collection.h" #include "mongo/db/exec/plan_stage.h" @@ -47,7 +45,7 @@ namespace mongo { class PipelineProxyStage : public PlanStage { public: PipelineProxyStage(boost::intrusive_ptr<Pipeline> pipeline, - const boost::shared_ptr<PlanExecutor>& child, + const std::shared_ptr<PlanExecutor>& child, WorkingSet* ws); virtual PlanStage::StageState work(WorkingSetID* out); @@ -72,7 +70,7 @@ namespace mongo { * Return a shared pointer to the PlanExecutor that feeds the pipeline. The returned * pointer may be NULL. */ - boost::shared_ptr<PlanExecutor> getChildExecutor(); + std::shared_ptr<PlanExecutor> getChildExecutor(); // Returns empty PlanStageStats object virtual PlanStageStats* getStats(); @@ -98,7 +96,7 @@ namespace mongo { const boost::intrusive_ptr<Pipeline> _pipeline; std::vector<BSONObj> _stash; const bool _includeMetaData; - boost::weak_ptr<PlanExecutor> _childExec; + std::weak_ptr<PlanExecutor> _childExec; // Not owned by us. WorkingSet* _ws; diff --git a/src/mongo/db/index/2d_common.h b/src/mongo/db/index/2d_common.h index d237c18a1b2..d30b8cd07df 100644 --- a/src/mongo/db/index/2d_common.h +++ b/src/mongo/db/index/2d_common.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include <string> #include <vector> @@ -39,7 +38,7 @@ namespace mongo { struct TwoDIndexingParams { std::string geo; std::vector<std::pair<std::string, int> > other; - boost::shared_ptr<GeoHashConverter> geoHashConverter; + std::shared_ptr<GeoHashConverter> geoHashConverter; }; } // namespace mongo diff --git a/src/mongo/db/matcher/expression_geo.h b/src/mongo/db/matcher/expression_geo.h index 59cc2a87ac5..01fa07bf08b 100644 --- a/src/mongo/db/matcher/expression_geo.h +++ b/src/mongo/db/matcher/expression_geo.h @@ -31,7 +31,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include "mongo/db/geo/geometry_container.h" #include "mongo/db/matcher/expression.h" @@ -101,7 +100,7 @@ namespace mongo { private: BSONObj _rawObj; // Share ownership of our query with all of our clones - boost::shared_ptr<const GeoExpression> _query; + std::shared_ptr<const GeoExpression> _query; }; @@ -170,7 +169,7 @@ namespace mongo { private: BSONObj _rawObj; // Share ownership of our query with all of our clones - boost::shared_ptr<const GeoNearExpression> _query; + std::shared_ptr<const GeoNearExpression> _query; }; } // namespace mongo diff --git a/src/mongo/db/pipeline/document_source.h b/src/mongo/db/pipeline/document_source.h index befbfad2198..ff8a087a0ed 100644 --- a/src/mongo/db/pipeline/document_source.h +++ b/src/mongo/db/pipeline/document_source.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <boost/intrusive_ptr.hpp> -#include <boost/shared_ptr.hpp> #include <boost/unordered_map.hpp> #include <deque> @@ -240,7 +239,7 @@ namespace mongo { // Add new methods as needed. }; - void injectMongodInterface(boost::shared_ptr<MongodInterface> mongod) { + void injectMongodInterface(std::shared_ptr<MongodInterface> mongod) { _mongod = mongod; } @@ -249,7 +248,7 @@ namespace mongo { virtual ~DocumentSourceNeedsMongod() {} // Gives subclasses access to a MongodInterface implementation - boost::shared_ptr<MongodInterface> _mongod; + std::shared_ptr<MongodInterface> _mongod; }; @@ -369,7 +368,7 @@ namespace mongo { */ static boost::intrusive_ptr<DocumentSourceCursor> create( const std::string& ns, - const boost::shared_ptr<PlanExecutor>& exec, + const std::shared_ptr<PlanExecutor>& exec, const boost::intrusive_ptr<ExpressionContext> &pExpCtx); /* @@ -413,7 +412,7 @@ namespace mongo { private: DocumentSourceCursor( const std::string& ns, - const boost::shared_ptr<PlanExecutor>& exec, + const std::shared_ptr<PlanExecutor>& exec, const boost::intrusive_ptr<ExpressionContext> &pExpCtx); void loadBatch(); @@ -429,7 +428,7 @@ namespace mongo { long long _docsAddedToBatches; // for _limit enforcement const std::string _ns; - boost::shared_ptr<PlanExecutor> _exec; // PipelineProxyStage holds a weak_ptr to this. + std::shared_ptr<PlanExecutor> _exec; // PipelineProxyStage holds a weak_ptr to this. }; @@ -491,7 +490,7 @@ namespace mongo { DocumentSourceGroup(const boost::intrusive_ptr<ExpressionContext> &pExpCtx); /// Spill groups map to disk and returns an iterator to the file. - boost::shared_ptr<Sorter<Value, Value>::Iterator> spill(); + std::shared_ptr<Sorter<Value, Value>::Iterator> spill(); // Only used by spill. Would be function-local if that were legal in C++03. class SpillSTLComparator; @@ -656,7 +655,7 @@ namespace mongo { }; // using list to enable removing arbitrary elements - typedef std::list<boost::shared_ptr<CursorAndConnection> > Cursors; + typedef std::list<std::shared_ptr<CursorAndConnection> > Cursors; DocumentSourceMergeCursors( const CursorIds& cursorIds, diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp index e02498c948c..d862663363d 100644 --- a/src/mongo/db/pipeline/document_source_cursor.cpp +++ b/src/mongo/db/pipeline/document_source_cursor.cpp @@ -30,7 +30,6 @@ #include "mongo/db/pipeline/document_source.h" -#include <boost/shared_ptr.hpp> #include "mongo/db/catalog/database_holder.h" #include "mongo/db/db_raii.h" @@ -45,7 +44,7 @@ namespace mongo { using boost::intrusive_ptr; - using boost::shared_ptr; + using std::shared_ptr; using std::string; DocumentSourceCursor::~DocumentSourceCursor() { @@ -198,7 +197,7 @@ namespace mongo { } DocumentSourceCursor::DocumentSourceCursor(const string& ns, - const boost::shared_ptr<PlanExecutor>& exec, + const std::shared_ptr<PlanExecutor>& exec, const intrusive_ptr<ExpressionContext> &pCtx) : DocumentSource(pCtx) , _docsAddedToBatches(0) @@ -208,7 +207,7 @@ namespace mongo { intrusive_ptr<DocumentSourceCursor> DocumentSourceCursor::create( const string& ns, - const boost::shared_ptr<PlanExecutor>& exec, + const std::shared_ptr<PlanExecutor>& exec, const intrusive_ptr<ExpressionContext> &pExpCtx) { return new DocumentSourceCursor(ns, exec, pExpCtx); } diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp index 8305225a467..aba16b65e17 100644 --- a/src/mongo/db/pipeline/document_source_group.cpp +++ b/src/mongo/db/pipeline/document_source_group.cpp @@ -40,7 +40,7 @@ namespace mongo { using boost::intrusive_ptr; - using boost::shared_ptr; + using std::shared_ptr; using std::pair; using std::vector; diff --git a/src/mongo/db/pipeline/document_source_merge_cursors.cpp b/src/mongo/db/pipeline/document_source_merge_cursors.cpp index ece870358f7..afe924d6a2f 100644 --- a/src/mongo/db/pipeline/document_source_merge_cursors.cpp +++ b/src/mongo/db/pipeline/document_source_merge_cursors.cpp @@ -30,7 +30,6 @@ #include "mongo/db/pipeline/document_source.h" -#include <boost/make_shared.hpp> namespace mongo { @@ -117,7 +116,7 @@ namespace mongo { // open each cursor and send message asking for a batch for (CursorIds::const_iterator it = _cursorIds.begin(); it !=_cursorIds.end(); ++it) { - _cursors.push_back(boost::make_shared<CursorAndConnection>( + _cursors.push_back(std::make_shared<CursorAndConnection>( it->first, pExpCtx->ns, it->second)); verify(_cursors.back()->connection->lazySupported()); _cursors.back()->cursor.initLazy(); // shouldn't block diff --git a/src/mongo/db/pipeline/document_source_sort.cpp b/src/mongo/db/pipeline/document_source_sort.cpp index 77fa0180332..f4e57d5c8ae 100644 --- a/src/mongo/db/pipeline/document_source_sort.cpp +++ b/src/mongo/db/pipeline/document_source_sort.cpp @@ -30,7 +30,6 @@ #include "mongo/db/pipeline/document_source.h" -#include <boost/make_shared.hpp> #include "mongo/db/jsobj.h" #include "mongo/db/pipeline/document.h" @@ -265,9 +264,9 @@ namespace mongo { }; void DocumentSourceSort::populateFromCursors(const vector<DBClientCursor*>& cursors) { - vector<boost::shared_ptr<MySorter::Iterator> > iterators; + vector<std::shared_ptr<MySorter::Iterator> > iterators; for (size_t i = 0; i < cursors.size(); i++) { - iterators.push_back(boost::make_shared<IteratorFromCursor>(this, cursors[i])); + iterators.push_back(std::make_shared<IteratorFromCursor>(this, cursors[i])); } _output.reset(MySorter::Iterator::merge(iterators, makeSortOptions(), Comparator(*this))); @@ -291,9 +290,9 @@ namespace mongo { }; void DocumentSourceSort::populateFromBsonArrays(const vector<BSONArray>& arrays) { - vector<boost::shared_ptr<MySorter::Iterator> > iterators; + vector<std::shared_ptr<MySorter::Iterator> > iterators; for (size_t i = 0; i < arrays.size(); i++) { - iterators.push_back(boost::make_shared<IteratorFromBsonArray>(this, arrays[i])); + iterators.push_back(std::make_shared<IteratorFromBsonArray>(this, arrays[i])); } _output.reset(MySorter::Iterator::merge(iterators, makeSortOptions(), Comparator(*this))); diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index 2709cc7f8d5..b6ddfdd7e12 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -30,8 +30,6 @@ #include "mongo/db/pipeline/pipeline_d.h" -#include <boost/make_shared.hpp> -#include <boost/shared_ptr.hpp> #include "mongo/client/dbclientinterface.h" #include "mongo/db/catalog/collection.h" @@ -48,7 +46,7 @@ namespace mongo { using boost::intrusive_ptr; - using boost::shared_ptr; + using std::shared_ptr; using std::string; namespace { @@ -109,7 +107,7 @@ namespace { dynamic_cast<DocumentSourceNeedsMongod*>(sources[i].get()); if (needsMongod) { needsMongod->injectMongodInterface( - boost::make_shared<MongodImplementation>(pExpCtx)); + std::make_shared<MongodImplementation>(pExpCtx)); } } @@ -121,7 +119,7 @@ namespace { // on secondaries, this is needed. ShardedConnectionInfo::addHook(); } - return boost::shared_ptr<PlanExecutor>(); // don't need a cursor + return std::shared_ptr<PlanExecutor>(); // don't need a cursor } @@ -181,7 +179,7 @@ namespace { | QueryPlannerParams::INCLUDE_SHARD_FILTER | QueryPlannerParams::NO_BLOCKING_SORT ; - boost::shared_ptr<PlanExecutor> exec; + std::shared_ptr<PlanExecutor> exec; bool sortInRunner = false; const WhereCallbackReal whereCallback(pExpCtx->opCtx, pExpCtx->ns.db()); diff --git a/src/mongo/db/pipeline/pipeline_d.h b/src/mongo/db/pipeline/pipeline_d.h index 40c7668d75d..3a818c3ddcd 100644 --- a/src/mongo/db/pipeline/pipeline_d.h +++ b/src/mongo/db/pipeline/pipeline_d.h @@ -29,7 +29,7 @@ #pragma once #include <boost/intrusive_ptr.hpp> -#include <boost/shared_ptr.hpp> +#include <memory> namespace mongo { class Collection; @@ -72,7 +72,7 @@ namespace mongo { * @param pPipeline the logical "this" for this operation * @param pExpCtx the expression context for this pipeline */ - static boost::shared_ptr<PlanExecutor> prepareCursorSource( + static std::shared_ptr<PlanExecutor> prepareCursorSource( OperationContext* txn, Collection* collection, const boost::intrusive_ptr<Pipeline> &pPipeline, diff --git a/src/mongo/db/pipeline/value.h b/src/mongo/db/pipeline/value.h index ecc66719d11..f388b82be7b 100644 --- a/src/mongo/db/pipeline/value.h +++ b/src/mongo/db/pipeline/value.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include "mongo/db/pipeline/value_internal.h" #include "mongo/platform/unordered_set.h" diff --git a/src/mongo/db/query/plan_executor.cpp b/src/mongo/db/query/plan_executor.cpp index 6e56b9b20f0..24b01bb704e 100644 --- a/src/mongo/db/query/plan_executor.cpp +++ b/src/mongo/db/query/plan_executor.cpp @@ -28,7 +28,6 @@ #include "mongo/db/query/plan_executor.h" -#include <boost/shared_ptr.hpp> #include "mongo/db/catalog/collection.h" #include "mongo/db/concurrency/write_conflict_exception.h" @@ -49,7 +48,7 @@ namespace mongo { - using boost::shared_ptr; + using std::shared_ptr; using std::string; using std::vector; diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp index 8bd5ee04cce..f6fd9eea580 100644 --- a/src/mongo/db/repl/master_slave.cpp +++ b/src/mongo/db/repl/master_slave.cpp @@ -43,7 +43,6 @@ #include "mongo/db/repl/master_slave.h" #include <pcrecpp.h> -#include <boost/shared_ptr.hpp> #include <boost/thread/thread.hpp> #include "mongo/db/auth/authorization_manager.h" @@ -250,7 +249,7 @@ namespace repl { } } - v.push_back( boost::shared_ptr< ReplSource >( new ReplSource( s ) ) ); + v.push_back( std::shared_ptr< ReplSource >( new ReplSource( s ) ) ); } /* we reuse our existing objects so that we can keep our existing connection diff --git a/src/mongo/db/repl/master_slave.h b/src/mongo/db/repl/master_slave.h index dd74c508e33..835d5e33dab 100644 --- a/src/mongo/db/repl/master_slave.h +++ b/src/mongo/db/repl/master_slave.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include "mongo/db/repl/oplogreader.h" @@ -77,7 +76,7 @@ namespace repl { not done (always use main for now). */ class ReplSource { - boost::shared_ptr<threadpool::ThreadPool> tp; + std::shared_ptr<threadpool::ThreadPool> tp; void resync(OperationContext* txn, const std::string& dbName); @@ -140,7 +139,7 @@ namespace repl { int nClonedThisPass; - typedef std::vector< boost::shared_ptr< ReplSource > > SourceVector; + typedef std::vector< std::shared_ptr< ReplSource > > SourceVector; static void loadAll(OperationContext* txn, SourceVector&); explicit ReplSource(OperationContext* txn, BSONObj); diff --git a/src/mongo/db/repl/oplogreader.cpp b/src/mongo/db/repl/oplogreader.cpp index f0b0d98d891..d982eae975e 100644 --- a/src/mongo/db/repl/oplogreader.cpp +++ b/src/mongo/db/repl/oplogreader.cpp @@ -32,7 +32,6 @@ #include "mongo/db/repl/oplogreader.h" -#include <boost/shared_ptr.hpp> #include <string> #include "mongo/base/counter.h" @@ -53,7 +52,7 @@ namespace mongo { - using boost::shared_ptr; + using std::shared_ptr; using std::endl; using std::string; diff --git a/src/mongo/db/repl/oplogreader.h b/src/mongo/db/repl/oplogreader.h index 66ac8f9c6c0..63dcaaeaa20 100644 --- a/src/mongo/db/repl/oplogreader.h +++ b/src/mongo/db/repl/oplogreader.h @@ -31,7 +31,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include "mongo/client/constants.h" #include "mongo/client/dbclientcursor.h" @@ -62,8 +61,8 @@ namespace repl { class OplogReader { private: - boost::shared_ptr<DBClientConnection> _conn; - boost::shared_ptr<DBClientCursor> cursor; + std::shared_ptr<DBClientConnection> _conn; + std::shared_ptr<DBClientCursor> cursor; int _tailingQueryOptions; // If _conn was actively connected, _host represents the current HostAndPort of the diff --git a/src/mongo/db/repl/replication_executor.h b/src/mongo/db/repl/replication_executor.h index 8b7dd5255c9..f3bb25c2c4f 100644 --- a/src/mongo/db/repl/replication_executor.h +++ b/src/mongo/db/repl/replication_executor.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include <boost/thread/condition_variable.hpp> #include <boost/thread/mutex.hpp> #include <string> @@ -572,7 +571,7 @@ namespace repl { uint64_t generation; bool isSignaled; WorkQueue waiters; - boost::shared_ptr<boost::condition_variable> isSignaledCondition; + std::shared_ptr<boost::condition_variable> isSignaledCondition; }; } // namespace repl diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp index bbd53eb887c..e5f01a6c8c7 100644 --- a/src/mongo/db/repl/rs_rollback.cpp +++ b/src/mongo/db/repl/rs_rollback.cpp @@ -33,7 +33,6 @@ #include "mongo/db/repl/rs_rollback.h" -#include <boost/shared_ptr.hpp> #include <memory> #include "mongo/db/auth/authorization_manager_global.h" @@ -103,7 +102,7 @@ namespace mongo { - using boost::shared_ptr; + using std::shared_ptr; using std::unique_ptr; using std::endl; using std::list; diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp index adf287fa86d..17444f24d9d 100644 --- a/src/mongo/db/sorter/sorter.cpp +++ b/src/mongo/db/sorter/sorter.cpp @@ -48,8 +48,6 @@ #include "mongo/db/sorter/sorter.h" #include <boost/filesystem/operations.hpp> -#include <boost/make_shared.hpp> -#include <boost/shared_ptr.hpp> #include <snappy.h> #include "mongo/base/string_data.h" @@ -67,7 +65,7 @@ namespace mongo { namespace sorter { - using boost::shared_ptr; + using std::shared_ptr; using namespace mongoutils; // We need to use the "real" errno everywhere, not GetLastError() on Windows @@ -164,7 +162,7 @@ namespace mongo { FileIterator(const std::string& fileName, const Settings& settings, - boost::shared_ptr<FileDeleter> fileDeleter) + std::shared_ptr<FileDeleter> fileDeleter) : _settings(settings) , _done(false) , _fileName(fileName) @@ -260,7 +258,7 @@ namespace mongo { std::unique_ptr<char[]> _buffer; std::unique_ptr<BufReader> _reader; std::string _fileName; - boost::shared_ptr<FileDeleter> _fileDeleter; // Must outlive _file + std::shared_ptr<FileDeleter> _fileDeleter; // Must outlive _file std::ifstream _file; }; @@ -272,7 +270,7 @@ namespace mongo { typedef std::pair<Key, Value> Data; - MergeIterator(const std::vector<boost::shared_ptr<Input> >& iters, + MergeIterator(const std::vector<std::shared_ptr<Input> >& iters, const SortOptions& opts, const Comparator& comp) : _opts(opts) @@ -283,7 +281,7 @@ namespace mongo { for (size_t i = 0; i < iters.size(); i++) { if (iters[i]->more()) { _heap.push_back( - boost::make_shared<Stream>(i, iters[i]->next(), iters[i])); + std::make_shared<Stream>(i, iters[i]->next(), iters[i])); } } @@ -340,7 +338,7 @@ namespace mongo { private: class Stream { // Data + Iterator public: - Stream(size_t fileNum, const Data& first, boost::shared_ptr<Input> rest) + Stream(size_t fileNum, const Data& first, std::shared_ptr<Input> rest) : fileNum(fileNum) , _current(first) , _rest(rest) @@ -359,7 +357,7 @@ namespace mongo { const size_t fileNum; private: Data _current; - boost::shared_ptr<Input> _rest; + std::shared_ptr<Input> _rest; }; class STLComparator { // uses greater rather than less-than to maintain a MinHeap @@ -383,8 +381,8 @@ namespace mongo { SortOptions _opts; unsigned long long _remaining; bool _first; - boost::shared_ptr<Stream> _current; - std::vector<boost::shared_ptr<Stream> > _heap; // MinHeap + std::shared_ptr<Stream> _current; + std::vector<std::shared_ptr<Stream> > _heap; // MinHeap STLComparator _greater; // named so calls make sense }; @@ -474,7 +472,7 @@ namespace mongo { writer.addAlreadySorted(_data.front().first, _data.front().second); } - _iters.push_back(boost::shared_ptr<Iterator>(writer.done())); + _iters.push_back(std::shared_ptr<Iterator>(writer.done())); _memUsed = 0; } @@ -484,7 +482,7 @@ namespace mongo { SortOptions _opts; size_t _memUsed; std::deque<Data> _data; // the "current" data - std::vector<boost::shared_ptr<Iterator> > _iters; // data that has already been spilled + std::vector<std::shared_ptr<Iterator> > _iters; // data that has already been spilled }; template <typename Key, typename Value, typename Comparator> @@ -749,7 +747,7 @@ namespace mongo { // clear _data and release backing array's memory std::vector<Data>().swap(_data); - _iters.push_back(boost::shared_ptr<Iterator>(writer.done())); + _iters.push_back(std::shared_ptr<Iterator>(writer.done())); _memUsed = 0; } @@ -759,7 +757,7 @@ namespace mongo { SortOptions _opts; size_t _memUsed; std::vector<Data> _data; // the "current" data. Organized as max-heap if size == limit. - std::vector<boost::shared_ptr<Iterator> > _iters; // data that has already been spilled + std::vector<std::shared_ptr<Iterator> > _iters; // data that has already been spilled // See updateCutoff() for a full description of how these members are used. bool _haveCutoff; @@ -809,7 +807,7 @@ namespace mongo { << sorter::myErrnoWithDescription(), _file.good()); - _fileDeleter = boost::make_shared<sorter::FileDeleter>(_fileName); + _fileDeleter = std::make_shared<sorter::FileDeleter>(_fileName); // throw on failure _file.exceptions(std::ios::failbit | std::ios::badbit | std::ios::eofbit); @@ -867,7 +865,7 @@ namespace mongo { template <typename Key, typename Value> template <typename Comparator> SortIteratorInterface<Key, Value>* SortIteratorInterface<Key, Value>::merge( - const std::vector<boost::shared_ptr<SortIteratorInterface> >& iters, + const std::vector<std::shared_ptr<SortIteratorInterface> >& iters, const SortOptions& opts, const Comparator& comp) { return new sorter::MergeIterator<Key, Value, Comparator>(iters, opts, comp); diff --git a/src/mongo/db/sorter/sorter.h b/src/mongo/db/sorter/sorter.h index 49840ddd94d..d8a117d83ee 100644 --- a/src/mongo/db/sorter/sorter.h +++ b/src/mongo/db/sorter/sorter.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include <deque> #include <fstream> #include <string> @@ -145,7 +144,7 @@ namespace mongo { /// Returns an iterator that merges the passed in iterators template <typename Comparator> static SortIteratorInterface* merge( - const std::vector<boost::shared_ptr<SortIteratorInterface> >& iters, + const std::vector<std::shared_ptr<SortIteratorInterface> >& iters, const SortOptions& opts, const Comparator& comp); protected: @@ -202,7 +201,7 @@ namespace mongo { const Settings _settings; std::string _fileName; - boost::shared_ptr<sorter::FileDeleter> _fileDeleter; // Must outlive _file + std::shared_ptr<sorter::FileDeleter> _fileDeleter; // Must outlive _file std::ofstream _file; BufBuilder _buffer; }; @@ -227,7 +226,7 @@ namespace mongo { /* factory functions */ \ template ::mongo::SortIteratorInterface<Key, Value>* \ ::mongo::SortIteratorInterface<Key, Value>::merge<Comparator>( \ - const std::vector<boost::shared_ptr<SortIteratorInterface> >& iters, \ + const std::vector<std::shared_ptr<SortIteratorInterface> >& iters, \ const SortOptions& opts, \ const Comparator& comp); \ template ::mongo::Sorter<Key, Value>* \ diff --git a/src/mongo/db/sorter/sorter_test.cpp b/src/mongo/db/sorter/sorter_test.cpp index f053c5de4a7..91f4f7c698d 100644 --- a/src/mongo/db/sorter/sorter_test.cpp +++ b/src/mongo/db/sorter/sorter_test.cpp @@ -31,8 +31,6 @@ #include "mongo/db/sorter/sorter.h" #include <boost/filesystem.hpp> -#include <boost/make_shared.hpp> -#include <boost/shared_ptr.hpp> #include <boost/thread.hpp> #include "mongo/config.h" @@ -45,7 +43,7 @@ namespace mongo { using namespace mongo::sorter; - using boost::make_shared; + using std::make_shared; using std::pair; // Stub to avoid including the server_options library @@ -124,7 +122,7 @@ namespace mongo { class LimitIterator : public IWIterator { public: - LimitIterator(long long limit, boost::shared_ptr<IWIterator> source) + LimitIterator(long long limit, std::shared_ptr<IWIterator> source) : _remaining(limit) , _source(source) { verify(limit > 0); } @@ -138,7 +136,7 @@ namespace mongo { private: long long _remaining; - boost::shared_ptr<IWIterator> _source; + std::shared_ptr<IWIterator> _source; }; template <typename It1, typename It2> @@ -166,21 +164,21 @@ namespace mongo { #define ASSERT_ITERATORS_EQUIVALENT(it1, it2) _assertIteratorsEquivalent(it1, it2, __LINE__) template <int N> - boost::shared_ptr<IWIterator> makeInMemIterator(const int (&array)[N]) { + std::shared_ptr<IWIterator> makeInMemIterator(const int (&array)[N]) { std::vector<IWPair> vec; for (int i=0; i<N; i++) vec.push_back(IWPair(array[i], -array[i])); - return boost::make_shared<sorter::InMemIterator<IntWrapper, IntWrapper> >(vec); + return std::make_shared<sorter::InMemIterator<IntWrapper, IntWrapper> >(vec); } template <typename IteratorPtr, int N> - boost::shared_ptr<IWIterator> mergeIterators(IteratorPtr (&array)[N], + std::shared_ptr<IWIterator> mergeIterators(IteratorPtr (&array)[N], Direction Dir=ASC, const SortOptions& opts=SortOptions()) { - std::vector<boost::shared_ptr<IWIterator> > vec; + std::vector<std::shared_ptr<IWIterator> > vec; for (int i=0; i<N; i++) - vec.push_back(boost::shared_ptr<IWIterator>(array[i])); - return boost::shared_ptr<IWIterator>(IWIterator::merge(vec, opts, IWComparator(Dir))); + vec.push_back(std::shared_ptr<IWIterator>(array[i])); + return std::shared_ptr<IWIterator>(IWIterator::merge(vec, opts, IWComparator(Dir))); } // @@ -233,7 +231,7 @@ namespace mongo { sorter.addAlreadySorted(2,-2); sorter.addAlreadySorted(3,-3); sorter.addAlreadySorted(4,-4); - ASSERT_ITERATORS_EQUIVALENT(boost::shared_ptr<IWIterator>(sorter.done()), + ASSERT_ITERATORS_EQUIVALENT(std::shared_ptr<IWIterator>(sorter.done()), make_shared<IntIterator>(0,5)); } { // big @@ -241,7 +239,7 @@ namespace mongo { for (int i=0; i< 10*1000*1000; i++) sorter.addAlreadySorted(i,-i); - ASSERT_ITERATORS_EQUIVALENT(boost::shared_ptr<IWIterator>(sorter.done()), + ASSERT_ITERATORS_EQUIVALENT(std::shared_ptr<IWIterator>(sorter.done()), make_shared<IntIterator>(0,10*1000*1000)); } @@ -255,15 +253,15 @@ namespace mongo { public: void run() { { // test empty (no inputs) - std::vector<boost::shared_ptr<IWIterator> > vec; - boost::shared_ptr<IWIterator> mergeIter (IWIterator::merge(vec, + std::vector<std::shared_ptr<IWIterator> > vec; + std::shared_ptr<IWIterator> mergeIter (IWIterator::merge(vec, SortOptions(), IWComparator())); ASSERT_ITERATORS_EQUIVALENT(mergeIter, make_shared<EmptyIterator>()); } { // test empty (only empty inputs) - boost::shared_ptr<IWIterator> iterators[] = + std::shared_ptr<IWIterator> iterators[] = { make_shared<EmptyIterator>() , make_shared<EmptyIterator>() , make_shared<EmptyIterator>() @@ -274,7 +272,7 @@ namespace mongo { } { // test ASC - boost::shared_ptr<IWIterator> iterators[] = + std::shared_ptr<IWIterator> iterators[] = { make_shared<IntIterator>(1, 20, 2) // 1, 3, ... 19 , make_shared<IntIterator>(0, 20, 2) // 0, 2, ... 18 }; @@ -284,7 +282,7 @@ namespace mongo { } { // test DESC with an empty source - boost::shared_ptr<IWIterator> iterators[] = + std::shared_ptr<IWIterator> iterators[] = { make_shared<IntIterator>(30, 0, -3) // 30, 27, ... 3 , make_shared<IntIterator>(29, 0, -3) // 29, 26, ... 2 , make_shared<IntIterator>(28, 0, -3) // 28, 25, ... 1 @@ -295,7 +293,7 @@ namespace mongo { make_shared<IntIterator>(30,0,-1)); } { // test Limit - boost::shared_ptr<IWIterator> iterators[] = + std::shared_ptr<IWIterator> iterators[] = { make_shared<IntIterator>(1, 20, 2) // 1, 3, ... 19 , make_shared<IntIterator>(0, 20, 2) // 0, 2, ... 18 }; @@ -330,12 +328,12 @@ namespace mongo { } { // test all data ASC - boost::shared_ptr<IWSorter> sorter = makeSorter(opts, IWComparator(ASC)); + std::shared_ptr<IWSorter> sorter = makeSorter(opts, IWComparator(ASC)); addData(sorter); ASSERT_ITERATORS_EQUIVALENT(done(sorter), correct()); } { // test all data DESC - boost::shared_ptr<IWSorter> sorter = makeSorter(opts, IWComparator(DESC)); + std::shared_ptr<IWSorter> sorter = makeSorter(opts, IWComparator(DESC)); addData(sorter); ASSERT_ITERATORS_EQUIVALENT(done(sorter), correctReverse()); } @@ -344,7 +342,7 @@ namespace mongo { // Among other things, MSVC++ makes all heap functions O(N) not O(logN). #if !defined(MONGO_CONFIG_DEBUG_BUILD) { // merge all data ASC - boost::shared_ptr<IWSorter> sorters[] = { + std::shared_ptr<IWSorter> sorters[] = { makeSorter(opts, IWComparator(ASC)), makeSorter(opts, IWComparator(ASC)) }; @@ -352,13 +350,13 @@ namespace mongo { addData(sorters[0]); addData(sorters[1]); - boost::shared_ptr<IWIterator> iters1[] = {done(sorters[0]), done(sorters[1])}; - boost::shared_ptr<IWIterator> iters2[] = {correct(), correct()}; + std::shared_ptr<IWIterator> iters1[] = {done(sorters[0]), done(sorters[1])}; + std::shared_ptr<IWIterator> iters2[] = {correct(), correct()}; ASSERT_ITERATORS_EQUIVALENT(mergeIterators(iters1, ASC), mergeIterators(iters2, ASC)); } { // merge all data DESC and use multiple threads to insert - boost::shared_ptr<IWSorter> sorters[] = { + std::shared_ptr<IWSorter> sorters[] = { makeSorter(opts, IWComparator(DESC)), makeSorter(opts, IWComparator(DESC)) }; @@ -367,8 +365,8 @@ namespace mongo { addData(sorters[1]); inBackground.join(); - boost::shared_ptr<IWIterator> iters1[] = {done(sorters[0]), done(sorters[1])}; - boost::shared_ptr<IWIterator> iters2[] = {correctReverse(), correctReverse()}; + std::shared_ptr<IWIterator> iters1[] = {done(sorters[0]), done(sorters[1])}; + std::shared_ptr<IWIterator> iters2[] = {correctReverse(), correctReverse()}; ASSERT_ITERATORS_EQUIVALENT(mergeIterators(iters1, DESC), mergeIterators(iters2, DESC)); } @@ -386,12 +384,12 @@ namespace mongo { } // returns an iterator with the correct results - virtual boost::shared_ptr<IWIterator> correct() { + virtual std::shared_ptr<IWIterator> correct() { return make_shared<IntIterator>(0,5); // 0, 1, ... 4 } // like correct but with opposite sort direction - virtual boost::shared_ptr<IWIterator> correctReverse() { + virtual std::shared_ptr<IWIterator> correctReverse() { return make_shared<IntIterator>(4,-1,-1); // 4, 3, ... 0 } @@ -403,13 +401,13 @@ namespace mongo { private: // Make a new sorter with desired opts and comp. Opts may be ignored but not comp - boost::shared_ptr<IWSorter> makeSorter(SortOptions opts, + std::shared_ptr<IWSorter> makeSorter(SortOptions opts, IWComparator comp=IWComparator(ASC)) { - return boost::shared_ptr<IWSorter>(IWSorter::make(adjustSortOptions(opts), comp)); + return std::shared_ptr<IWSorter>(IWSorter::make(adjustSortOptions(opts), comp)); } - boost::shared_ptr<IWIterator> done(unowned_ptr<IWSorter> sorter) { - return boost::shared_ptr<IWIterator>(sorter->done()); + std::shared_ptr<IWIterator> done(unowned_ptr<IWSorter> sorter) { + return std::shared_ptr<IWIterator>(sorter->done()); } }; @@ -425,10 +423,10 @@ namespace mongo { sorter->add(1,-1); sorter->add(-1,1); } - virtual boost::shared_ptr<IWIterator> correct() { + virtual std::shared_ptr<IWIterator> correct() { return make_shared<IntIterator>(-1,4); } - virtual boost::shared_ptr<IWIterator> correctReverse() { + virtual std::shared_ptr<IWIterator> correctReverse() { return make_shared<IntIterator>(4,-1,-1); } }; @@ -446,11 +444,11 @@ namespace mongo { sorter->add(2,-2); sorter->add(3,-3); } - virtual boost::shared_ptr<IWIterator> correct() { + virtual std::shared_ptr<IWIterator> correct() { const int array[] = {-1,-1,-1, 0, 1,1,1, 2,2, 3}; return makeInMemIterator(array); } - virtual boost::shared_ptr<IWIterator> correctReverse() { + virtual std::shared_ptr<IWIterator> correctReverse() { const int array[] = {3, 2,2, 1,1,1, 0, -1,-1,-1}; return makeInMemIterator(array); } @@ -486,10 +484,10 @@ namespace mongo { } } - virtual boost::shared_ptr<IWIterator> correct() { + virtual std::shared_ptr<IWIterator> correct() { return make_shared<IntIterator>(0, NUM_ITEMS); } - virtual boost::shared_ptr<IWIterator> correctReverse() { + virtual std::shared_ptr<IWIterator> correctReverse() { return make_shared<IntIterator>(NUM_ITEMS-1, -1, -1); } @@ -516,10 +514,10 @@ namespace mongo { return opts.MaxMemoryUsageBytes(MEM_LIMIT).ExtSortAllowed().Limit(Limit); } - virtual boost::shared_ptr<IWIterator> correct() { + virtual std::shared_ptr<IWIterator> correct() { return make_shared<LimitIterator>(Limit, Parent::correct()); } - virtual boost::shared_ptr<IWIterator> correctReverse() { + virtual std::shared_ptr<IWIterator> correctReverse() { return make_shared<LimitIterator>(Limit, Parent::correctReverse()); } enum { MEM_LIMIT = 32*1024 }; diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.h b/src/mongo/db/storage/devnull/devnull_kv_engine.h index 126544b6108..b6d14c52399 100644 --- a/src/mongo/db/storage/devnull/devnull_kv_engine.h +++ b/src/mongo/db/storage/devnull/devnull_kv_engine.h @@ -30,7 +30,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include "mongo/db/storage/kv/kv_engine.h" #include "mongo/db/storage/recovery_unit_noop.h" @@ -105,6 +104,6 @@ namespace mongo { virtual void cleanShutdown() {}; private: - boost::shared_ptr<void> _catalogInfo; + std::shared_ptr<void> _catalogInfo; }; } diff --git a/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp b/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp index 1b937118bb3..40da9035fbd 100644 --- a/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp +++ b/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp @@ -32,8 +32,6 @@ #include "mongo/db/storage/in_memory/in_memory_btree_impl.h" -#include <boost/make_shared.hpp> -#include <boost/shared_ptr.hpp> #include <set> #include "mongo/db/catalog/index_catalog_entry.h" @@ -44,7 +42,7 @@ namespace mongo { - using boost::shared_ptr; + using std::shared_ptr; using std::string; using std::vector; @@ -480,10 +478,10 @@ namespace { // IndexCatalogEntry argument taken by non-const pointer for consistency with other Btree // factories. We don't actually modify it. SortedDataInterface* getInMemoryBtreeImpl(const Ordering& ordering, - boost::shared_ptr<void>* dataInOut) { + std::shared_ptr<void>* dataInOut) { invariant(dataInOut); if (!*dataInOut) { - *dataInOut = boost::make_shared<IndexSet>(IndexEntryComparison(ordering)); + *dataInOut = std::make_shared<IndexSet>(IndexEntryComparison(ordering)); } return new InMemoryBtreeImpl(static_cast<IndexSet*>(dataInOut->get())); } diff --git a/src/mongo/db/storage/in_memory/in_memory_btree_impl.h b/src/mongo/db/storage/in_memory/in_memory_btree_impl.h index 3297b599b1e..ee318312c78 100644 --- a/src/mongo/db/storage/in_memory/in_memory_btree_impl.h +++ b/src/mongo/db/storage/in_memory/in_memory_btree_impl.h @@ -28,7 +28,6 @@ * it in the license file. */ -#include <boost/shared_ptr.hpp> #include "mongo/db/storage/sorted_data_interface.h" @@ -43,6 +42,6 @@ namespace mongo { * All permanent data will be stored and fetch from dataInOut. */ SortedDataInterface* getInMemoryBtreeImpl(const Ordering& ordering, - boost::shared_ptr<void>* dataInOut); + std::shared_ptr<void>* dataInOut); } // namespace mongo diff --git a/src/mongo/db/storage/in_memory/in_memory_btree_impl_test.cpp b/src/mongo/db/storage/in_memory/in_memory_btree_impl_test.cpp index 560b2bb3e0b..867a093b3e0 100644 --- a/src/mongo/db/storage/in_memory/in_memory_btree_impl_test.cpp +++ b/src/mongo/db/storage/in_memory/in_memory_btree_impl_test.cpp @@ -30,7 +30,6 @@ #include "mongo/db/storage/in_memory/in_memory_btree_impl.h" -#include <boost/shared_ptr.hpp> #include "mongo/db/storage/in_memory/in_memory_recovery_unit.h" #include "mongo/db/storage/sorted_data_interface_test_harness.h" @@ -54,7 +53,7 @@ namespace mongo { } private: - boost::shared_ptr<void> _data; // used by InMemoryBtreeImpl + std::shared_ptr<void> _data; // used by InMemoryBtreeImpl Ordering _order; }; diff --git a/src/mongo/db/storage/in_memory/in_memory_engine.h b/src/mongo/db/storage/in_memory/in_memory_engine.h index 65e180da458..687104254d3 100644 --- a/src/mongo/db/storage/in_memory/in_memory_engine.h +++ b/src/mongo/db/storage/in_memory/in_memory_engine.h @@ -30,7 +30,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include <boost/thread/mutex.hpp> #include "mongo/db/storage/kv/kv_engine.h" @@ -88,7 +87,7 @@ namespace mongo { std::vector<std::string> getAllIdents( OperationContext* opCtx ) const; private: - typedef StringMap<boost::shared_ptr<void> > DataMap; + typedef StringMap<std::shared_ptr<void> > DataMap; mutable boost::mutex _mutex; DataMap _dataMap; // All actual data is owned in here diff --git a/src/mongo/db/storage/in_memory/in_memory_record_store.cpp b/src/mongo/db/storage/in_memory/in_memory_record_store.cpp index 92deaf82810..b0c583954f6 100644 --- a/src/mongo/db/storage/in_memory/in_memory_record_store.cpp +++ b/src/mongo/db/storage/in_memory/in_memory_record_store.cpp @@ -33,7 +33,6 @@ #include "mongo/db/storage/in_memory/in_memory_record_store.h" -#include <boost/shared_ptr.hpp> #include "mongo/db/jsobj.h" #include "mongo/db/namespace_string.h" @@ -47,7 +46,7 @@ namespace mongo { - using boost::shared_ptr; + using std::shared_ptr; class InMemoryRecordStore::InsertChange : public RecoveryUnit::Change { public: @@ -262,7 +261,7 @@ namespace mongo { // InMemoryRecordStore::InMemoryRecordStore(StringData ns, - boost::shared_ptr<void>* dataInOut, + std::shared_ptr<void>* dataInOut, bool isCapped, int64_t cappedMaxSize, int64_t cappedMaxDocs, diff --git a/src/mongo/db/storage/in_memory/in_memory_record_store.h b/src/mongo/db/storage/in_memory/in_memory_record_store.h index e091d75c4a1..53df7883758 100644 --- a/src/mongo/db/storage/in_memory/in_memory_record_store.h +++ b/src/mongo/db/storage/in_memory/in_memory_record_store.h @@ -31,7 +31,6 @@ #pragma once #include <boost/shared_array.hpp> -#include <boost/shared_ptr.hpp> #include <map> #include "mongo/db/storage/capped_callback.h" @@ -47,7 +46,7 @@ namespace mongo { class InMemoryRecordStore : public RecordStore { public: explicit InMemoryRecordStore(StringData ns, - boost::shared_ptr<void>* dataInOut, + std::shared_ptr<void>* dataInOut, bool isCapped = false, int64_t cappedMaxSize = -1, int64_t cappedMaxDocs = -1, diff --git a/src/mongo/db/storage/in_memory/in_memory_record_store_test.cpp b/src/mongo/db/storage/in_memory/in_memory_record_store_test.cpp index 258317c8976..42138116da9 100644 --- a/src/mongo/db/storage/in_memory/in_memory_record_store_test.cpp +++ b/src/mongo/db/storage/in_memory/in_memory_record_store_test.cpp @@ -30,7 +30,6 @@ #include "mongo/db/storage/in_memory/in_memory_record_store.h" -#include <boost/shared_ptr.hpp> #include "mongo/db/storage/in_memory/in_memory_recovery_unit.h" #include "mongo/db/storage/record_store_test_harness.h" @@ -51,7 +50,7 @@ namespace mongo { return new InMemoryRecoveryUnit(); } - boost::shared_ptr<void> data; + std::shared_ptr<void> data; }; HarnessHelper* newHarnessHelper() { diff --git a/src/mongo/db/storage/in_memory/in_memory_recovery_unit.h b/src/mongo/db/storage/in_memory/in_memory_recovery_unit.h index 343e9abf595..2ef0552d58e 100644 --- a/src/mongo/db/storage/in_memory/in_memory_recovery_unit.h +++ b/src/mongo/db/storage/in_memory/in_memory_recovery_unit.h @@ -30,7 +30,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include <vector> #include "mongo/db/record_id.h" @@ -65,7 +64,7 @@ namespace mongo { virtual SnapshotId getSnapshotId() const { return SnapshotId(); } private: - typedef boost::shared_ptr<Change> ChangePtr; + typedef std::shared_ptr<Change> ChangePtr; typedef std::vector<ChangePtr> Changes; Changes _changes; diff --git a/src/mongo/db/storage/mmap_v1/dur.cpp b/src/mongo/db/storage/mmap_v1/dur.cpp index 94096dc910e..4b33d7a2bf9 100644 --- a/src/mongo/db/storage/mmap_v1/dur.cpp +++ b/src/mongo/db/storage/mmap_v1/dur.cpp @@ -75,7 +75,6 @@ #include <boost/thread/condition_variable.hpp> #include <boost/thread/mutex.hpp> -#include <boost/shared_ptr.hpp> #include <boost/thread/thread.hpp> #include <iomanip> #include <utility> @@ -527,7 +526,7 @@ namespace { } void DurableImpl::createdFile(const std::string& filename, unsigned long long len) { - boost::shared_ptr<DurOp> op(new FileCreatedOp(filename, len)); + std::shared_ptr<DurOp> op(new FileCreatedOp(filename, len)); commitJob.noteOp(op); } diff --git a/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp b/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp index bfcdd30de4b..666a6c4a2eb 100644 --- a/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp @@ -44,7 +44,7 @@ namespace mongo { - using boost::shared_ptr; + using std::shared_ptr; using std::endl; using std::max; using std::min; diff --git a/src/mongo/db/storage/mmap_v1/dur_commitjob.h b/src/mongo/db/storage/mmap_v1/dur_commitjob.h index a7fae340989..b2d07c3b293 100644 --- a/src/mongo/db/storage/mmap_v1/dur_commitjob.h +++ b/src/mongo/db/storage/mmap_v1/dur_commitjob.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include "mongo/db/storage/mmap_v1/durop.h" #include "mongo/util/concurrency/mutex.h" @@ -36,7 +35,7 @@ namespace mongo { namespace dur { - typedef std::vector<boost::shared_ptr<DurOp> > DurOpsVector; + typedef std::vector<std::shared_ptr<DurOp> > DurOpsVector; /** * Declaration of an intent to write to a region of a memory mapped view. We store the end @@ -141,7 +140,7 @@ namespace dur { /** * Note an operation other than a "basic write". */ - void noteOp(boost::shared_ptr<DurOp> p); + void noteOp(std::shared_ptr<DurOp> p); /** * Record/note an intent to write. diff --git a/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp b/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp index 73583a77ef7..b79dba66cfd 100644 --- a/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp @@ -38,7 +38,6 @@ #include "mongo/platform/basic.h" -#include <boost/shared_ptr.hpp> #include <boost/thread.hpp> #include "mongo/db/storage/mmap_v1/aligned_builder.h" @@ -181,8 +180,8 @@ namespace mongo { h.fileId = j.curFileId(); // Ops other than basic writes (DurOp's) go first - const std::vector<boost::shared_ptr<DurOp> >& durOps = commitJob.ops(); - for (std::vector<boost::shared_ptr<DurOp> >::const_iterator i = durOps.begin(); + const std::vector<std::shared_ptr<DurOp> >& durOps = commitJob.ops(); + for (std::vector<std::shared_ptr<DurOp> >::const_iterator i = durOps.begin(); i != durOps.end(); i++) { diff --git a/src/mongo/db/storage/mmap_v1/dur_recover.cpp b/src/mongo/db/storage/mmap_v1/dur_recover.cpp index 5e61e39930f..edef79fc92b 100644 --- a/src/mongo/db/storage/mmap_v1/dur_recover.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_recover.cpp @@ -58,7 +58,7 @@ namespace mongo { - using boost::shared_ptr; + using std::shared_ptr; using std::unique_ptr; using std::endl; using std::hex; @@ -99,7 +99,7 @@ namespace mongo { const JEntry *e; // local db sentinel is already parsed out here into dbName // if not one of the two simple JEntry's above, this is the operation: - boost::shared_ptr<DurOp> op; + std::shared_ptr<DurOp> op; }; @@ -190,7 +190,7 @@ namespace mongo { case JEntry::OpCode_FileCreated: case JEntry::OpCode_DropDb: { e.dbName = 0; - boost::shared_ptr<DurOp> op = DurOp::read(lenOrOpCode, *_entries); + std::shared_ptr<DurOp> op = DurOp::read(lenOrOpCode, *_entries); if (_doDurOps) { e.op = op; } @@ -302,7 +302,7 @@ namespace mongo { log() << "journal error applying writes, file " << fn << " is not open" << endl; verify(false); } - boost::shared_ptr<DurableMappedFile> sp (new DurableMappedFile); + std::shared_ptr<DurableMappedFile> sp (new DurableMappedFile); verify(sp->open(fn, false)); rj._mmfs.push_back(sp); mmf = sp.get(); diff --git a/src/mongo/db/storage/mmap_v1/dur_recover.h b/src/mongo/db/storage/mmap_v1/dur_recover.h index a78c05eb242..1e22a693ed6 100644 --- a/src/mongo/db/storage/mmap_v1/dur_recover.h +++ b/src/mongo/db/storage/mmap_v1/dur_recover.h @@ -31,7 +31,6 @@ #pragma once #include <boost/filesystem/operations.hpp> -#include <boost/shared_ptr.hpp> #include <list> #include "mongo/db/storage/mmap_v1/dur_journalformat.h" @@ -87,7 +86,7 @@ namespace mongo { // Set of memory mapped files and a mutex to protect them mongo::mutex _mx; - std::list<boost::shared_ptr<DurableMappedFile> > _mmfs; + std::list<std::shared_ptr<DurableMappedFile> > _mmfs; // Are we in recovery or WRITETODATAFILES bool _recovering; diff --git a/src/mongo/db/storage/mmap_v1/durop.cpp b/src/mongo/db/storage/mmap_v1/durop.cpp index 573c1f5688a..2a049596593 100644 --- a/src/mongo/db/storage/mmap_v1/durop.cpp +++ b/src/mongo/db/storage/mmap_v1/durop.cpp @@ -35,7 +35,6 @@ #include "mongo/db/storage/mmap_v1/durop.h" #include <boost/filesystem/operations.hpp> -#include <boost/shared_ptr.hpp> #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/storage/mmap_v1/aligned_builder.h" @@ -49,7 +48,7 @@ namespace mongo { using std::unique_ptr; - using boost::shared_ptr; + using std::shared_ptr; using std::endl; using std::string; diff --git a/src/mongo/db/storage/mmap_v1/durop.h b/src/mongo/db/storage/mmap_v1/durop.h index e7da38a32d1..9ebddb3dfc0 100644 --- a/src/mongo/db/storage/mmap_v1/durop.h +++ b/src/mongo/db/storage/mmap_v1/durop.h @@ -30,7 +30,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include "mongo/db/storage/mmap_v1/dur_journalformat.h" #include "mongo/db/storage/paths.h" @@ -64,7 +63,7 @@ namespace mongo { /** read a durop from journal file referenced by br. @param opcode the opcode which has already been written from the bufreader */ - static boost::shared_ptr<DurOp> read(unsigned opcode, BufReader& br); + static std::shared_ptr<DurOp> read(unsigned opcode, BufReader& br); /** replay the operation (during recovery) throws diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.h b/src/mongo/db/storage/wiredtiger/wiredtiger_index.h index 4d3c50c09f7..c2b3d42538f 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/shared_ptr.hpp> #include <wiredtiger.h> #include "mongo/base/status_with.h" |