diff options
218 files changed, 651 insertions, 120 deletions
diff --git a/src/mongo/client/dbclient_rs.h b/src/mongo/client/dbclient_rs.h index 2bf7eb88081..85ee0062410 100644 --- a/src/mongo/client/dbclient_rs.h +++ b/src/mongo/client/dbclient_rs.h @@ -29,6 +29,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <utility> diff --git a/src/mongo/client/dbclient_rs_test.cpp b/src/mongo/client/dbclient_rs_test.cpp index 6082d899a31..030ebaaac26 100644 --- a/src/mongo/client/dbclient_rs_test.cpp +++ b/src/mongo/client/dbclient_rs_test.cpp @@ -41,6 +41,7 @@ #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" +#include <boost/scoped_ptr.hpp> #include <map> #include <memory> #include <string> diff --git a/src/mongo/client/dbclientinterface.h b/src/mongo/client/dbclientinterface.h index 959992068fc..645974b37a1 100644 --- a/src/mongo/client/dbclientinterface.h +++ b/src/mongo/client/dbclientinterface.h @@ -32,6 +32,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/base/string_data.h" #include "mongo/bson/bson_field.h" #include "mongo/client/export_macros.h" diff --git a/src/mongo/client/parallel.h b/src/mongo/client/parallel.h index a6fc2367d66..85ef519ca55 100644 --- a/src/mongo/client/parallel.h +++ b/src/mongo/client/parallel.h @@ -33,6 +33,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/client/export_macros.h" #include "mongo/db/dbmessage.h" #include "mongo/db/matcher/matcher.h" @@ -376,10 +378,10 @@ namespace mongo { int _options; BSONObj _cmd; DBClientBase * _conn; - scoped_ptr<AScopedConnection> _connHolder; // used if not provided a connection + boost::scoped_ptr<AScopedConnection> _connHolder; // used if not provided a connection bool _useShardConn; - scoped_ptr<DBClientCursor> _cursor; + boost::scoped_ptr<DBClientCursor> _cursor; BSONObj _res; bool _ok; diff --git a/src/mongo/client/sasl_scramsha1_client_conversation.cpp b/src/mongo/client/sasl_scramsha1_client_conversation.cpp index c84de2bd2a7..436d069d531 100644 --- a/src/mongo/client/sasl_scramsha1_client_conversation.cpp +++ b/src/mongo/client/sasl_scramsha1_client_conversation.cpp @@ -31,6 +31,7 @@ #include "mongo/client/sasl_scramsha1_client_conversation.h" #include <boost/algorithm/string/replace.hpp> +#include <boost/scoped_ptr.hpp> #include "mongo/base/parse_number.h" #include "mongo/client/sasl_client_session.h" @@ -41,6 +42,9 @@ #include "mongo/util/text.h" namespace mongo { + + using boost::scoped_ptr; + SaslSCRAMSHA1ClientConversation::SaslSCRAMSHA1ClientConversation( SaslClientSession* saslClientSession) : SaslClientConversation(saslClientSession), diff --git a/src/mongo/client/syncclusterconnection.h b/src/mongo/client/syncclusterconnection.h index 92c79f50232..9a1537ea773 100644 --- a/src/mongo/client/syncclusterconnection.h +++ b/src/mongo/client/syncclusterconnection.h @@ -30,6 +30,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include "mongo/bson/bsonelement.h" #include "mongo/bson/bsonobj.h" @@ -157,7 +158,7 @@ namespace mongo { std::vector<BSONObj> _lastErrors; // Optionally attached by user - scoped_ptr<QueryHandler> _customQueryHandler; + boost::scoped_ptr<QueryHandler> _customQueryHandler; mongo::mutex _mutex; map<string,int> _lockTypes; diff --git a/src/mongo/crypto/mechanism_scram.cpp b/src/mongo/crypto/mechanism_scram.cpp index d77a0c72b85..34f7c870a93 100644 --- a/src/mongo/crypto/mechanism_scram.cpp +++ b/src/mongo/crypto/mechanism_scram.cpp @@ -30,6 +30,7 @@ #include "mongo/crypto/mechanism_scram.h" +#include <boost/scoped_ptr.hpp> #include <vector> #include "mongo/crypto/crypto.h" @@ -39,6 +40,8 @@ namespace mongo { namespace scram { + using boost::scoped_ptr; + // Compute the SCRAM step Hi() as defined in RFC5802 static void HMACIteration(const unsigned char input[], size_t inputLen, diff --git a/src/mongo/db/auth/authorization_manager.h b/src/mongo/db/auth/authorization_manager.h index 80f4784acf0..99c3648178e 100644 --- a/src/mongo/db/auth/authorization_manager.h +++ b/src/mongo/db/auth/authorization_manager.h @@ -477,7 +477,7 @@ namespace mongo { */ bool _authEnabled; - scoped_ptr<AuthzManagerExternalState> _externalState; + boost::scoped_ptr<AuthzManagerExternalState> _externalState; /** * Cached value of the authorization schema version. diff --git a/src/mongo/db/auth/authorization_manager_test.cpp b/src/mongo/db/auth/authorization_manager_test.cpp index 2f29749722a..4d89de6c5c0 100644 --- a/src/mongo/db/auth/authorization_manager_test.cpp +++ b/src/mongo/db/auth/authorization_manager_test.cpp @@ -28,6 +28,7 @@ /** * Unit tests of the AuthorizationManager type. */ +#include <boost/scoped_ptr.hpp> #include "mongo/base/status.h" #include "mongo/bson/mutable/document.h" @@ -49,6 +50,8 @@ namespace mongo { namespace { + using boost::scoped_ptr; + TEST(RoleParsingTest, BuildRoleBSON) { RoleGraph graph; RoleName roleA("roleA", "dbA"); diff --git a/src/mongo/db/auth/authorization_session.h b/src/mongo/db/auth/authorization_session.h index a2fc0e9e05b..3a184e4be7d 100644 --- a/src/mongo/db/auth/authorization_session.h +++ b/src/mongo/db/auth/authorization_session.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <string> #include <vector> @@ -222,7 +223,7 @@ namespace mongo { // lock on the admin database (to update out-of-date user privilege information). bool _isAuthorizedForPrivilege(const Privilege& privilege); - scoped_ptr<AuthzSessionExternalState> _externalState; + boost::scoped_ptr<AuthzSessionExternalState> _externalState; // All Users who have been authenticated on this connection. UserSet _authenticatedUsers; diff --git a/src/mongo/db/auth/authorization_session_test.cpp b/src/mongo/db/auth/authorization_session_test.cpp index e0263650651..da878ce324c 100644 --- a/src/mongo/db/auth/authorization_session_test.cpp +++ b/src/mongo/db/auth/authorization_session_test.cpp @@ -28,6 +28,7 @@ /** * Unit tests of the AuthorizationSession type. */ +#include <boost/scoped_ptr.hpp> #include "mongo/base/status.h" #include "mongo/db/auth/authz_session_external_state_mock.h" @@ -46,6 +47,8 @@ namespace mongo { namespace { + using boost::scoped_ptr; + class FailureCapableAuthzManagerExternalStateMock : public AuthzManagerExternalStateMock { public: diff --git a/src/mongo/db/auth/authz_manager_external_state_s.cpp b/src/mongo/db/auth/authz_manager_external_state_s.cpp index 61fd27f1de6..d10fd8d4e2b 100644 --- a/src/mongo/db/auth/authz_manager_external_state_s.cpp +++ b/src/mongo/db/auth/authz_manager_external_state_s.cpp @@ -50,6 +50,8 @@ namespace mongo { + using boost::scoped_ptr; + AuthzManagerExternalStateMongos::AuthzManagerExternalStateMongos() {} AuthzManagerExternalStateMongos::~AuthzManagerExternalStateMongos() {} diff --git a/src/mongo/db/auth/authz_manager_external_state_s.h b/src/mongo/db/auth/authz_manager_external_state_s.h index be8ed10a548..e903ca7e43a 100644 --- a/src/mongo/db/auth/authz_manager_external_state_s.h +++ b/src/mongo/db/auth/authz_manager_external_state_s.h @@ -110,7 +110,7 @@ namespace mongo { private: boost::mutex _distLockGuard; // Guards access to _authzDataUpdateLock - scoped_ptr<ScopedDistributedLock> _authzDataUpdateLock; + boost::scoped_ptr<ScopedDistributedLock> _authzDataUpdateLock; }; } // namespace mongo diff --git a/src/mongo/db/auth/native_sasl_authentication_session.cpp b/src/mongo/db/auth/native_sasl_authentication_session.cpp index 1ed358a3f7f..02541481c32 100644 --- a/src/mongo/db/auth/native_sasl_authentication_session.cpp +++ b/src/mongo/db/auth/native_sasl_authentication_session.cpp @@ -30,6 +30,7 @@ #include "mongo/db/auth/native_sasl_authentication_session.h" +#include <boost/scoped_ptr.hpp> #include <boost/range/size.hpp> #include "mongo/base/init.h" @@ -51,6 +52,9 @@ #include "mongo/util/mongoutils/str.h" namespace mongo { + + using boost::scoped_ptr; + namespace { SaslAuthenticationSession* createNativeSaslAuthenticationSession( AuthorizationSession* authzSession, diff --git a/src/mongo/db/auth/native_sasl_authentication_session.h b/src/mongo/db/auth/native_sasl_authentication_session.h index 5e8857d0683..5f73ee7771d 100644 --- a/src/mongo/db/auth/native_sasl_authentication_session.h +++ b/src/mongo/db/auth/native_sasl_authentication_session.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <string> #include "mongo/base/disallow_copying.h" diff --git a/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp b/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp index b36aded8b1a..3ec0e0f32de 100644 --- a/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp +++ b/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp @@ -34,6 +34,7 @@ #include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string/replace.hpp> +#include <boost/scoped_ptr.hpp> #include "mongo/crypto/crypto.h" #include "mongo/crypto/mechanism_scram.h" @@ -47,6 +48,9 @@ #include "mongo/util/text.h" namespace mongo { + + using boost::scoped_ptr; + SaslSCRAMSHA1ServerConversation::SaslSCRAMSHA1ServerConversation( SaslAuthenticationSession* saslAuthSession) : SaslServerConversation(saslAuthSession), diff --git a/src/mongo/db/auth/user_document_parser_test.cpp b/src/mongo/db/auth/user_document_parser_test.cpp index 2af535d7bd4..3d812f267df 100644 --- a/src/mongo/db/auth/user_document_parser_test.cpp +++ b/src/mongo/db/auth/user_document_parser_test.cpp @@ -29,6 +29,8 @@ * Unit tests of the UserDocumentParser type. */ +#include <boost/scoped_ptr.hpp> + #include "mongo/base/status.h" #include "mongo/db/auth/action_set.h" #include "mongo/db/auth/action_type.h" @@ -43,6 +45,8 @@ namespace mongo { namespace { + using boost::scoped_ptr; + class V1UserDocumentParsing : public ::mongo::unittest::Test { public: V1UserDocumentParsing() {} diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp index e34c72e0200..643c0f32893 100644 --- a/src/mongo/db/catalog/collection.cpp +++ b/src/mongo/db/catalog/collection.cpp @@ -34,6 +34,8 @@ #include "mongo/db/catalog/collection.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/counter.h" #include "mongo/base/owned_pointer_map.h" #include "mongo/db/clientcursor.h" @@ -53,6 +55,7 @@ namespace mongo { + using boost::scoped_ptr; using logger::LogComponent; std::string CompactOptions::toString() const { diff --git a/src/mongo/db/catalog/cursor_manager.h b/src/mongo/db/catalog/cursor_manager.h index af94d917f79..3f92e8eaf69 100644 --- a/src/mongo/db/catalog/cursor_manager.h +++ b/src/mongo/db/catalog/cursor_manager.h @@ -30,6 +30,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/clientcursor.h" #include "mongo/db/invalidation_type.h" #include "mongo/db/namespace_string.h" @@ -133,7 +135,7 @@ namespace mongo { NamespaceString _nss; unsigned _collectionCacheRuntimeId; - scoped_ptr<PseudoRandom> _random; + boost::scoped_ptr<PseudoRandom> _random; SimpleMutex _mutex; diff --git a/src/mongo/db/catalog/index_create.cpp b/src/mongo/db/catalog/index_create.cpp index 76745822ad0..9d6c723c061 100644 --- a/src/mongo/db/catalog/index_create.cpp +++ b/src/mongo/db/catalog/index_create.cpp @@ -35,6 +35,7 @@ #include "mongo/db/catalog/index_create.h" #include <boost/make_shared.hpp> +#include <boost/scoped_ptr.hpp> #include "mongo/base/error_codes.h" #include "mongo/client/dbclientinterface.h" @@ -53,6 +54,8 @@ namespace mongo { + using boost::scoped_ptr; + /** * On rollback sets MultiIndexBlock::_needToCleanup to true. */ diff --git a/src/mongo/db/catalog/index_create.h b/src/mongo/db/catalog/index_create.h index d28fe33cc23..a94f0fddeeb 100644 --- a/src/mongo/db/catalog/index_create.h +++ b/src/mongo/db/catalog/index_create.h @@ -30,6 +30,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <set> #include <string> #include <vector> diff --git a/src/mongo/db/client.h b/src/mongo/db/client.h index 6b9239e7875..98b830e7223 100644 --- a/src/mongo/db/client.h +++ b/src/mongo/db/client.h @@ -36,6 +36,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <boost/thread/thread.hpp> #include "mongo/db/catalog/database.h" diff --git a/src/mongo/db/client_basic.cpp b/src/mongo/db/client_basic.cpp index 6f7d01f5451..46bfcc44725 100644 --- a/src/mongo/db/client_basic.cpp +++ b/src/mongo/db/client_basic.cpp @@ -30,11 +30,15 @@ #include "mongo/db/client_basic.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/auth/authentication_session.h" #include "mongo/db/auth/authorization_session.h" namespace mongo { + using boost::scoped_ptr; + ClientBasic::ClientBasic(AbstractMessagingPort* messagingPort) : _messagingPort(messagingPort) { } ClientBasic::~ClientBasic() {} diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h index 8174efab5ab..21c08f5f886 100644 --- a/src/mongo/db/clientcursor.h +++ b/src/mongo/db/clientcursor.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <boost/thread/recursive_mutex.hpp> #include "mongo/db/jsobj.h" @@ -276,7 +277,7 @@ namespace mongo { // // The underlying execution machinery. // - scoped_ptr<PlanExecutor> _exec; + boost::scoped_ptr<PlanExecutor> _exec; }; /** diff --git a/src/mongo/db/clientlistplugin.cpp b/src/mongo/db/clientlistplugin.cpp index 607c37f4131..9ed142ad218 100644 --- a/src/mongo/db/clientlistplugin.cpp +++ b/src/mongo/db/clientlistplugin.cpp @@ -28,6 +28,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <boost/thread/locks.hpp> #include "mongo/bson/bsonobjbuilder.h" @@ -45,6 +46,9 @@ #include "mongo/util/stringutils.h" namespace mongo { + + using boost::scoped_ptr; + namespace { class ClientListPlugin : public WebStatusPlugin { diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp index 75e329e42d0..22a1101d115 100644 --- a/src/mongo/db/cloner.cpp +++ b/src/mongo/db/cloner.cpp @@ -34,6 +34,8 @@ #include "mongo/db/cloner.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/status.h" #include "mongo/bson/util/builder.h" #include "mongo/client/dbclientinterface.h" @@ -60,6 +62,8 @@ namespace mongo { + using boost::scoped_ptr; + MONGO_EXPORT_SERVER_PARAMETER(skipCorruptDocumentsWhenCloning, bool, false); BSONElement getErrField(const BSONObj& o); diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp index c4bd12f28d1..c9134f7e491 100644 --- a/src/mongo/db/commands/collection_to_capped.cpp +++ b/src/mongo/db/commands/collection_to_capped.cpp @@ -30,6 +30,8 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/background.h" #include "mongo/db/client.h" #include "mongo/db/commands.h" @@ -40,6 +42,9 @@ #include "mongo/db/operation_context_impl.h" namespace mongo { + + using boost::scoped_ptr; + namespace { Status cloneCollectionAsCapped( OperationContext* txn, diff --git a/src/mongo/db/commands/count.cpp b/src/mongo/db/commands/count.cpp index 2eb8ceb87e3..71cde2f3aa4 100644 --- a/src/mongo/db/commands/count.cpp +++ b/src/mongo/db/commands/count.cpp @@ -30,6 +30,8 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/catalog/database.h" #include "mongo/db/client.h" #include "mongo/db/catalog/collection.h" @@ -44,6 +46,8 @@ namespace mongo { + using boost::scoped_ptr; + /* select count(*) */ class CmdCount : public Command { public: diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp index 955f84d1f0a..891d19765b2 100644 --- a/src/mongo/db/commands/dbhash.cpp +++ b/src/mongo/db/commands/dbhash.cpp @@ -32,6 +32,8 @@ #include "mongo/db/commands/dbhash.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/client.h" #include "mongo/db/commands.h" #include "mongo/db/catalog/database.h" @@ -43,6 +45,8 @@ namespace mongo { + using boost::scoped_ptr; + DBHashCmd dbhashCmd; diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp index 22b75933189..5679db641e6 100644 --- a/src/mongo/db/commands/find_and_modify.cpp +++ b/src/mongo/db/commands/find_and_modify.cpp @@ -32,6 +32,8 @@ #include "mongo/db/commands/find_and_modify.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/commands.h" #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/db/dbhelpers.h" @@ -45,6 +47,8 @@ namespace mongo { + using boost::scoped_ptr; + /* Find and Modify an object returning either the old (default) or new value*/ class CmdFindAndModify : public Command { public: diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index 6a414b52261..a0a1c21c7b7 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -30,6 +30,8 @@ #include "mongo/db/commands/find_cmd.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/auth/authorization_session.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" @@ -42,6 +44,8 @@ namespace mongo { + using boost::scoped_ptr; + static FindCmd findCmd; Status FindCmd::checkAuthForCommand(ClientBasic* client, diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp index b5d68ba4f63..cab42a0bcda 100644 --- a/src/mongo/db/commands/geo_near_cmd.cpp +++ b/src/mongo/db/commands/geo_near_cmd.cpp @@ -28,6 +28,7 @@ #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kCommand +#include <boost/scoped_ptr.hpp> #include <vector> #include "mongo/db/auth/action_set.h" @@ -52,6 +53,8 @@ namespace mongo { + using boost::scoped_ptr; + class Geo2dFindNearCmd : public Command { public: Geo2dFindNearCmd() : Command("geoNear") {} diff --git a/src/mongo/db/commands/group.cpp b/src/mongo/db/commands/group.cpp index 08a7701b7a7..5f5b87f5e62 100644 --- a/src/mongo/db/commands/group.cpp +++ b/src/mongo/db/commands/group.cpp @@ -30,6 +30,8 @@ #include "mongo/db/commands/group.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/auth/action_set.h" #include "mongo/db/auth/action_type.h" #include "mongo/db/auth/authorization_session.h" @@ -42,6 +44,8 @@ namespace mongo { + using boost::scoped_ptr; + static GroupCommand cmdGroup; GroupCommand::GroupCommand() : Command("group") {} diff --git a/src/mongo/db/commands/index_filter_commands.cpp b/src/mongo/db/commands/index_filter_commands.cpp index 7e126f5e221..575415a3a59 100644 --- a/src/mongo/db/commands/index_filter_commands.cpp +++ b/src/mongo/db/commands/index_filter_commands.cpp @@ -28,6 +28,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <string> #include <sstream> diff --git a/src/mongo/db/commands/index_filter_commands_test.cpp b/src/mongo/db/commands/index_filter_commands_test.cpp index e892bcee7a8..3ca48225e28 100644 --- a/src/mongo/db/commands/index_filter_commands_test.cpp +++ b/src/mongo/db/commands/index_filter_commands_test.cpp @@ -32,6 +32,8 @@ #include "mongo/db/commands/index_filter_commands.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/json.h" #include "mongo/db/operation_context_noop.h" #include "mongo/db/query/plan_ranker.h" @@ -42,6 +44,7 @@ using namespace mongo; namespace { + using boost::scoped_ptr; using std::string; using std::vector; diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp index 6b633ca522a..53f1c880f45 100644 --- a/src/mongo/db/commands/list_collections.cpp +++ b/src/mongo/db/commands/list_collections.cpp @@ -30,6 +30,8 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/catalog/collection_catalog_entry.h" #include "mongo/db/catalog/cursor_manager.h" #include "mongo/db/catalog/database.h" @@ -46,6 +48,8 @@ namespace mongo { + using boost::scoped_ptr; + class CmdListCollections : public Command { public: virtual bool slaveOk() const { return false; } diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index f062a239f91..d5aebcdc887 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -34,6 +34,8 @@ #include "mongo/db/commands/mr.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/client/connpool.h" #include "mongo/client/parallel.h" #include "mongo/db/auth/authorization_session.h" @@ -66,6 +68,8 @@ namespace mongo { + using boost::scoped_ptr; + namespace mr { AtomicUInt32 Config::JOB_NUMBER; diff --git a/src/mongo/db/commands/mr.h b/src/mongo/db/commands/mr.h index 404e6a24072..d177d91959e 100644 --- a/src/mongo/db/commands/mr.h +++ b/src/mongo/db/commands/mr.h @@ -192,9 +192,9 @@ namespace mongo { // functions - scoped_ptr<Mapper> mapper; - scoped_ptr<Reducer> reducer; - scoped_ptr<Finalizer> finalizer; + boost::scoped_ptr<Mapper> mapper; + boost::scoped_ptr<Reducer> reducer; + boost::scoped_ptr<Finalizer> finalizer; BSONObj mapParams; BSONObj scopeSetup; @@ -351,10 +351,10 @@ namespace mongo { int _add(InMemory* im , const BSONObj& a); OperationContext* _txn; - scoped_ptr<Scope> _scope; + boost::scoped_ptr<Scope> _scope; bool _onDisk; // if the end result of this map reduce is disk or not - scoped_ptr<InMemory> _temp; + boost::scoped_ptr<InMemory> _temp; long _size; // bytes in _temp long _dupCount; // number of duplicate key entries diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index 48de5b1ccc5..11d740f29bd 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -28,6 +28,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <vector> #include "mongo/db/auth/action_set.h" @@ -53,6 +54,7 @@ namespace mongo { using boost::intrusive_ptr; + using boost::scoped_ptr; static bool isCursorCommand(BSONObj cmdObj) { BSONElement cursorElem = cmdObj["cursor"]; diff --git a/src/mongo/db/commands/plan_cache_commands.cpp b/src/mongo/db/commands/plan_cache_commands.cpp index 8ccdf53642e..8477afb1b69 100644 --- a/src/mongo/db/commands/plan_cache_commands.cpp +++ b/src/mongo/db/commands/plan_cache_commands.cpp @@ -30,6 +30,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <string> #include <sstream> @@ -47,6 +48,7 @@ namespace { + using boost::scoped_ptr; using std::string; using namespace mongo; diff --git a/src/mongo/db/commands/plan_cache_commands_test.cpp b/src/mongo/db/commands/plan_cache_commands_test.cpp index d2cae74ac12..e723923d185 100644 --- a/src/mongo/db/commands/plan_cache_commands_test.cpp +++ b/src/mongo/db/commands/plan_cache_commands_test.cpp @@ -33,6 +33,8 @@ #include "mongo/db/commands/plan_cache_commands.h" #include <algorithm> +#include <boost/scoped_ptr.hpp> + #include "mongo/db/json.h" #include "mongo/db/operation_context_noop.h" #include "mongo/db/query/plan_ranker.h" @@ -44,6 +46,7 @@ using namespace mongo; namespace { + using boost::scoped_ptr; using std::string; using std::vector; diff --git a/src/mongo/db/commands/write_commands/batch_executor.cpp b/src/mongo/db/commands/write_commands/batch_executor.cpp index 21dad098aa0..56e55539508 100644 --- a/src/mongo/db/commands/write_commands/batch_executor.cpp +++ b/src/mongo/db/commands/write_commands/batch_executor.cpp @@ -32,6 +32,7 @@ #include "mongo/db/commands/write_commands/batch_executor.h" +#include <boost/scoped_ptr.hpp> #include <memory> #include "mongo/base/error_codes.h" @@ -73,6 +74,8 @@ namespace mongo { + using boost::scoped_ptr; + namespace { /** diff --git a/src/mongo/db/commands/write_commands/batch_executor.h b/src/mongo/db/commands/write_commands/batch_executor.h index 21b8ca9f980..3050f66ceca 100644 --- a/src/mongo/db/commands/write_commands/batch_executor.h +++ b/src/mongo/db/commands/write_commands/batch_executor.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <string> #include "mongo/base/disallow_copying.h" @@ -154,7 +155,7 @@ namespace mongo { LastError* _le; // Stats - scoped_ptr<WriteBatchStats> _stats; + boost::scoped_ptr<WriteBatchStats> _stats; }; /** diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp index 99961da06c3..5ef335b7138 100644 --- a/src/mongo/db/dbcommands.cpp +++ b/src/mongo/db/dbcommands.cpp @@ -32,6 +32,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <time.h> #include "mongo/base/disallow_copying.h" @@ -86,6 +87,7 @@ namespace mongo { + using boost::scoped_ptr; using std::string; CmdShutdown cmdShutdown; diff --git a/src/mongo/db/dbeval.cpp b/src/mongo/db/dbeval.cpp index 72d7ebcd977..711b2df7777 100644 --- a/src/mongo/db/dbeval.cpp +++ b/src/mongo/db/dbeval.cpp @@ -32,6 +32,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <time.h> #include "mongo/bson/util/builder.h" @@ -47,6 +48,8 @@ namespace mongo { + using boost::scoped_ptr; + const int edebug=0; static bool dbEval(OperationContext* txn, diff --git a/src/mongo/db/exec/collection_scan.h b/src/mongo/db/exec/collection_scan.h index f7f434ad86c..375e4ad8fde 100644 --- a/src/mongo/db/exec/collection_scan.h +++ b/src/mongo/db/exec/collection_scan.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/collection_scan_common.h" #include "mongo/db/exec/plan_stage.h" #include "mongo/db/matcher/expression.h" @@ -89,7 +91,7 @@ namespace mongo { // The filter is not owned by us. const MatchExpression* _filter; - scoped_ptr<RecordIterator> _iter; + boost::scoped_ptr<RecordIterator> _iter; CollectionScanParams _params; diff --git a/src/mongo/db/exec/count.h b/src/mongo/db/exec/count.h index e0b7d261bd2..4a2954ad140 100644 --- a/src/mongo/db/exec/count.h +++ b/src/mongo/db/exec/count.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/plan_stage.h" namespace mongo { @@ -124,7 +126,7 @@ namespace mongo { // by us. WorkingSet* _ws; - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; CommonStats _commonStats; CountStats _specificStats; diff --git a/src/mongo/db/exec/delete.h b/src/mongo/db/exec/delete.h index 4c64679fde9..9bdacf19354 100644 --- a/src/mongo/db/exec/delete.h +++ b/src/mongo/db/exec/delete.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/plan_stage.h" #include "mongo/db/jsobj.h" @@ -115,7 +117,7 @@ namespace mongo { // stage. Collection* _collection; - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; // Stats CommonStats _commonStats; diff --git a/src/mongo/db/exec/fetch.h b/src/mongo/db/exec/fetch.h index 3c8b5c00b6a..53ed3952a06 100644 --- a/src/mongo/db/exec/fetch.h +++ b/src/mongo/db/exec/fetch.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/plan_stage.h" #include "mongo/db/jsobj.h" #include "mongo/db/matcher/expression.h" @@ -89,7 +91,7 @@ namespace mongo { // _ws is not owned by us. WorkingSet* _ws; - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; // The filter is not owned by us. const MatchExpression* _filter; diff --git a/src/mongo/db/exec/geo_near.cpp b/src/mongo/db/exec/geo_near.cpp index caea23bb79a..29ed167bd2d 100644 --- a/src/mongo/db/exec/geo_near.cpp +++ b/src/mongo/db/exec/geo_near.cpp @@ -46,10 +46,13 @@ #include "mongo/db/index/expression_params.h" #include "mongo/util/log.h" +#include <boost/scoped_ptr.hpp> #include <algorithm> namespace mongo { + using boost::scoped_ptr; + // // Shared GeoNear search functionality // diff --git a/src/mongo/db/exec/geo_near.h b/src/mongo/db/exec/geo_near.h index dfb6368869e..66147b61928 100644 --- a/src/mongo/db/exec/geo_near.h +++ b/src/mongo/db/exec/geo_near.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/near.h" #include "mongo/db/exec/working_set.h" #include "mongo/db/exec/plan_stats.h" @@ -102,7 +104,7 @@ namespace mongo { double _boundsIncrement; class DensityEstimator; - scoped_ptr<DensityEstimator> _densityEstimator; + boost::scoped_ptr<DensityEstimator> _densityEstimator; }; /** @@ -147,7 +149,7 @@ namespace mongo { double _boundsIncrement; class DensityEstimator; - scoped_ptr<DensityEstimator> _densityEstimator; + boost::scoped_ptr<DensityEstimator> _densityEstimator; }; } // namespace mongo diff --git a/src/mongo/db/exec/group.h b/src/mongo/db/exec/group.h index 6e24c2c0664..2374fc7b2b0 100644 --- a/src/mongo/db/exec/group.h +++ b/src/mongo/db/exec/group.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/plan_stage.h" #include "mongo/scripting/engine.h" @@ -142,7 +144,7 @@ namespace mongo { CommonStats _commonStats; GroupStats _specificStats; - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; // Current state for this stage. GroupState _groupState; diff --git a/src/mongo/db/exec/index_scan.h b/src/mongo/db/exec/index_scan.h index 54481c77ff1..088d33c5dda 100644 --- a/src/mongo/db/exec/index_scan.h +++ b/src/mongo/db/exec/index_scan.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/plan_stage.h" #include "mongo/db/index/btree_index_cursor.h" #include "mongo/db/index/index_access_method.h" @@ -141,7 +143,7 @@ namespace mongo { // Index access. const IndexAccessMethod* _iam; // owned by Collection -> IndexCatalog - scoped_ptr<IndexCursor> _indexCursor; + boost::scoped_ptr<IndexCursor> _indexCursor; BSONObj _keyPattern; // Keeps track of what work we need to do next. @@ -163,7 +165,7 @@ namespace mongo { IndexScanParams _params; // For our "fast" Btree-only navigation AKA the index bounds optimization. - scoped_ptr<IndexBoundsChecker> _checker; + boost::scoped_ptr<IndexBoundsChecker> _checker; BtreeIndexCursor* _btreeCursor; int _keyEltsToUse; bool _movePastKeyElts; diff --git a/src/mongo/db/exec/keep_mutations.h b/src/mongo/db/exec/keep_mutations.h index 74538d6b5e2..004106ba315 100644 --- a/src/mongo/db/exec/keep_mutations.h +++ b/src/mongo/db/exec/keep_mutations.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/jsobj.h" #include "mongo/db/exec/plan_stage.h" #include "mongo/db/matcher/expression.h" @@ -71,7 +73,7 @@ namespace mongo { // Not owned here. WorkingSet* _workingSet; - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; // Not owned here. Should be the full query expression tree. const MatchExpression* _filter; diff --git a/src/mongo/db/exec/limit.h b/src/mongo/db/exec/limit.h index 2426732b904..489eea2e589 100644 --- a/src/mongo/db/exec/limit.h +++ b/src/mongo/db/exec/limit.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/jsobj.h" #include "mongo/db/exec/plan_stage.h" #include "mongo/db/record_id.h" @@ -67,7 +69,7 @@ namespace mongo { private: WorkingSet* _ws; - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; // We only return this many results. int _numToReturn; diff --git a/src/mongo/db/exec/multi_plan.h b/src/mongo/db/exec/multi_plan.h index e0e2070847d..22a8daded01 100644 --- a/src/mongo/db/exec/multi_plan.h +++ b/src/mongo/db/exec/multi_plan.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/jsobj.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/exec/plan_stage.h" diff --git a/src/mongo/db/exec/near.h b/src/mongo/db/exec/near.h index 62741f8014b..126bb04ab3e 100644 --- a/src/mongo/db/exec/near.h +++ b/src/mongo/db/exec/near.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <queue> #include "mongo/base/string_data.h" @@ -179,14 +180,14 @@ namespace mongo { unordered_map<RecordId, WorkingSetID, RecordId::Hasher> _nextIntervalSeen; // Stats for the stage covering this interval - scoped_ptr<IntervalStats> _nextIntervalStats; + boost::scoped_ptr<IntervalStats> _nextIntervalStats; // Sorted buffered results to be returned - the current interval struct SearchResult; std::priority_queue<SearchResult> _resultBuffer; // Stats - scoped_ptr<PlanStageStats> _stats; + boost::scoped_ptr<PlanStageStats> _stats; // The current stage from which this stage should buffer results // Pointer to the last interval in _childrenIntervals. Owned by _childrenIntervals. @@ -211,7 +212,7 @@ namespace mongo { bool inclusiveMax); // Owned by NearStage - scoped_ptr<PlanStage> const covering; + boost::scoped_ptr<PlanStage> const covering; const bool dedupCovering; const double minDistance; diff --git a/src/mongo/db/exec/oplogstart.h b/src/mongo/db/exec/oplogstart.h index d18b2450e7f..78505a2a54c 100644 --- a/src/mongo/db/exec/oplogstart.h +++ b/src/mongo/db/exec/oplogstart.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/base/owned_pointer_vector.h" #include "mongo/db/exec/collection_scan.h" #include "mongo/db/exec/plan_stage.h" @@ -102,7 +104,7 @@ namespace mongo { OperationContext* _txn; // If we're backwards scanning we just punt to a collscan. - scoped_ptr<CollectionScan> _cs; + boost::scoped_ptr<CollectionScan> _cs; // This is only used for the extent hopping scan. typedef OwnedPointerVector<RecordIterator> SubIterators; diff --git a/src/mongo/db/exec/projection.h b/src/mongo/db/exec/projection.h index 9302ba836cb..7724216b00e 100644 --- a/src/mongo/db/exec/projection.h +++ b/src/mongo/db/exec/projection.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/plan_stage.h" #include "mongo/db/exec/projection_exec.h" #include "mongo/db/jsobj.h" @@ -122,11 +124,11 @@ namespace mongo { private: Status transform(WorkingSetMember* member); - scoped_ptr<ProjectionExec> _exec; + boost::scoped_ptr<ProjectionExec> _exec; // _ws is not owned by us. WorkingSet* _ws; - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; // Stats CommonStats _commonStats; diff --git a/src/mongo/db/exec/shard_filter.h b/src/mongo/db/exec/shard_filter.h index 614b0bb6ad9..904fc000a38 100644 --- a/src/mongo/db/exec/shard_filter.h +++ b/src/mongo/db/exec/shard_filter.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/plan_stage.h" #include "mongo/db/jsobj.h" #include "mongo/db/record_id.h" @@ -97,7 +99,7 @@ namespace mongo { private: WorkingSet* _ws; - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; // Stats CommonStats _commonStats; diff --git a/src/mongo/db/exec/skip.h b/src/mongo/db/exec/skip.h index b22ee7734a6..b61f23a9c7f 100644 --- a/src/mongo/db/exec/skip.h +++ b/src/mongo/db/exec/skip.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/exec/plan_stage.h" #include "mongo/db/jsobj.h" #include "mongo/db/record_id.h" @@ -66,7 +68,7 @@ namespace mongo { private: WorkingSet* _ws; - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; // We drop the first _toSkip results that we would have returned. int _toSkip; diff --git a/src/mongo/db/exec/sort.h b/src/mongo/db/exec/sort.h index 44453974be4..5211747c2ef 100644 --- a/src/mongo/db/exec/sort.h +++ b/src/mongo/db/exec/sort.h @@ -242,7 +242,7 @@ namespace mongo { // Comparator for data buffer // Initialization follows sort key generator - scoped_ptr<WorkingSetComparator> _sortKeyComparator; + boost::scoped_ptr<WorkingSetComparator> _sortKeyComparator; // The data we buffer and sort. // _data will contain sorted data when all data is gathered @@ -253,7 +253,7 @@ namespace mongo { // be used to provide the results of this stage through _resultIterator. std::vector<SortableDataItem> _data; typedef std::set<SortableDataItem, WorkingSetComparator> SortableDataItemSet; - scoped_ptr<SortableDataItemSet> _dataSet; + boost::scoped_ptr<SortableDataItemSet> _dataSet; // Iterates through _data post-sort returning it. std::vector<SortableDataItem>::iterator _resultIterator; diff --git a/src/mongo/db/exec/update.h b/src/mongo/db/exec/update.h index 604bc5c202a..08bf949b958 100644 --- a/src/mongo/db/exec/update.h +++ b/src/mongo/db/exec/update.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/catalog/collection.h" #include "mongo/db/exec/plan_stage.h" #include "mongo/db/jsobj.h" @@ -155,7 +157,7 @@ namespace mongo { Collection* _collection; // Owned by us. - scoped_ptr<PlanStage> _child; + boost::scoped_ptr<PlanStage> _child; // Stats CommonStats _commonStats; diff --git a/src/mongo/db/geo/big_polygon.cpp b/src/mongo/db/geo/big_polygon.cpp index 2f7c20871c6..eb6540651cb 100644 --- a/src/mongo/db/geo/big_polygon.cpp +++ b/src/mongo/db/geo/big_polygon.cpp @@ -28,6 +28,7 @@ #include "mongo/db/geo/big_polygon.h" +#include <boost/scoped_ptr.hpp> #include <map> #include "mongo/base/owned_pointer_vector.h" diff --git a/src/mongo/db/geo/geometry_container.h b/src/mongo/db/geo/geometry_container.h index 501b17ce687..415f603d178 100644 --- a/src/mongo/db/geo/geometry_container.h +++ b/src/mongo/db/geo/geometry_container.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <string> #include "mongo/base/disallow_copying.h" @@ -142,20 +143,20 @@ namespace mongo { // Only one of these shared_ptrs should be non-NULL. S2Region is a // superclass but it only supports testing against S2Cells. We need // the most specific class we can get. - scoped_ptr<PointWithCRS> _point; - scoped_ptr<LineWithCRS> _line; - scoped_ptr<BoxWithCRS> _box; - scoped_ptr<PolygonWithCRS> _polygon; - scoped_ptr<CapWithCRS> _cap; - scoped_ptr<MultiPointWithCRS> _multiPoint; - scoped_ptr<MultiLineWithCRS> _multiLine; - scoped_ptr<MultiPolygonWithCRS> _multiPolygon; - scoped_ptr<GeometryCollection> _geometryCollection; + boost::scoped_ptr<PointWithCRS> _point; + boost::scoped_ptr<LineWithCRS> _line; + boost::scoped_ptr<BoxWithCRS> _box; + boost::scoped_ptr<PolygonWithCRS> _polygon; + boost::scoped_ptr<CapWithCRS> _cap; + boost::scoped_ptr<MultiPointWithCRS> _multiPoint; + boost::scoped_ptr<MultiLineWithCRS> _multiLine; + boost::scoped_ptr<MultiPolygonWithCRS> _multiPolygon; + boost::scoped_ptr<GeometryCollection> _geometryCollection; // Cached for use during covering calculations // TODO: _s2Region is currently generated immediately - don't necessarily need to do this - scoped_ptr<S2RegionUnion> _s2Region; - scoped_ptr<R2Region> _r2Region; + boost::scoped_ptr<S2RegionUnion> _s2Region; + boost::scoped_ptr<R2Region> _r2Region; }; } // namespace mongo diff --git a/src/mongo/db/geo/r2_region_coverer.h b/src/mongo/db/geo/r2_region_coverer.h index d3c0620535d..e95da0228a6 100644 --- a/src/mongo/db/geo/r2_region_coverer.h +++ b/src/mongo/db/geo/r2_region_coverer.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <queue> #include "mongo/db/geo/hash.h" @@ -107,8 +108,8 @@ namespace mongo { typedef pair<int, Candidate*> QueueEntry; typedef priority_queue<QueueEntry, vector<QueueEntry>, CompareQueueEntries> CandidateQueue; - scoped_ptr<CandidateQueue> _candidateQueue; // Priority queue owns candidate pointers. - scoped_ptr<vector<GeoHash> > _results; + boost::scoped_ptr<CandidateQueue> _candidateQueue; // Priority queue owns candidate pointers. + boost::scoped_ptr<vector<GeoHash> > _results; }; diff --git a/src/mongo/db/geo/shapes.h b/src/mongo/db/geo/shapes.h index 074c71d2e4e..d67643f7823 100644 --- a/src/mongo/db/geo/shapes.h +++ b/src/mongo/db/geo/shapes.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <cmath> #include <string> #include <vector> @@ -190,8 +191,8 @@ namespace mongo { std::vector<Point> _points; // Cached attributes of the polygon - mutable scoped_ptr<Box> _bounds; - mutable scoped_ptr<Point> _centroid; + mutable boost::scoped_ptr<Box> _bounds; + mutable boost::scoped_ptr<Point> _centroid; }; class R2Region { @@ -300,10 +301,10 @@ namespace mongo { PolygonWithCRS() : crs(UNSET) {} - scoped_ptr<S2Polygon> s2Polygon; + boost::scoped_ptr<S2Polygon> s2Polygon; // Simple polygons with strict winding order may be bigger or smaller than a hemisphere. // Only used for query. We don't support storing/indexing big polygons. - scoped_ptr<BigSimplePolygon> bigPolygon; + boost::scoped_ptr<BigSimplePolygon> bigPolygon; Polygon oldPolygon; CRS crs; diff --git a/src/mongo/db/hasher.cpp b/src/mongo/db/hasher.cpp index 4b41b163156..8acb2269459 100644 --- a/src/mongo/db/hasher.cpp +++ b/src/mongo/db/hasher.cpp @@ -33,11 +33,16 @@ */ #include "mongo/db/hasher.h" + +#include <boost/scoped_ptr.hpp> + #include "mongo/db/jsobj.h" #include "mongo/util/startup_test.h" namespace mongo { + using boost::scoped_ptr; + Hasher::Hasher( HashSeed seed ) : _seed( seed ) { md5_init( &_md5State ); md5_append( &_md5State , reinterpret_cast< const md5_byte_t * >( & _seed ) , sizeof( _seed ) ); diff --git a/src/mongo/db/index/btree_access_method.h b/src/mongo/db/index/btree_access_method.h index c776e9340b5..bb866694414 100644 --- a/src/mongo/db/index/btree_access_method.h +++ b/src/mongo/db/index/btree_access_method.h @@ -59,7 +59,7 @@ namespace mongo { virtual void getKeys(const BSONObj& obj, BSONObjSet* keys); // Our keys differ for V0 and V1. - scoped_ptr<BtreeKeyGenerator> _keyGenerator; + boost::scoped_ptr<BtreeKeyGenerator> _keyGenerator; }; } // namespace mongo diff --git a/src/mongo/db/index/btree_based_access_method.h b/src/mongo/db/index/btree_based_access_method.h index 54de8799e46..041aefac151 100644 --- a/src/mongo/db/index/btree_based_access_method.h +++ b/src/mongo/db/index/btree_based_access_method.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <vector> #include "mongo/base/disallow_copying.h" @@ -143,7 +144,7 @@ namespace mongo { const RecordId& loc, bool dupsAllowed); - scoped_ptr<SortedDataInterface> _newInterface; + boost::scoped_ptr<SortedDataInterface> _newInterface; }; /** diff --git a/src/mongo/db/index/btree_based_bulk_access_method.cpp b/src/mongo/db/index/btree_based_bulk_access_method.cpp index 0c4b2f2ffb8..073db4c1d92 100644 --- a/src/mongo/db/index/btree_based_bulk_access_method.cpp +++ b/src/mongo/db/index/btree_based_bulk_access_method.cpp @@ -32,6 +32,8 @@ #include "mongo/db/index/btree_based_bulk_access_method.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/curop.h" #include "mongo/db/operation_context.h" #include "mongo/db/storage_options.h" @@ -40,6 +42,8 @@ namespace mongo { + using boost::scoped_ptr; + // // Comparison for external sorter interface // diff --git a/src/mongo/db/index/btree_based_bulk_access_method.h b/src/mongo/db/index/btree_based_bulk_access_method.h index 3869a1373fd..f683ec51aff 100644 --- a/src/mongo/db/index/btree_based_bulk_access_method.h +++ b/src/mongo/db/index/btree_based_bulk_access_method.h @@ -26,6 +26,7 @@ * it in the license file. */ +#include <boost/scoped_ptr.hpp> #include <set> #include <vector> diff --git a/src/mongo/db/index/btree_index_cursor.h b/src/mongo/db/index/btree_index_cursor.h index bff946979e3..51210592532 100644 --- a/src/mongo/db/index/btree_index_cursor.h +++ b/src/mongo/db/index/btree_index_cursor.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <vector> #include "mongo/base/status.h" diff --git a/src/mongo/db/index/btree_key_generator_test.cpp b/src/mongo/db/index/btree_key_generator_test.cpp index 2ca6f3442a8..8b162eca82d 100644 --- a/src/mongo/db/index/btree_key_generator_test.cpp +++ b/src/mongo/db/index/btree_key_generator_test.cpp @@ -28,12 +28,14 @@ #include "mongo/db/index/btree_key_generator.h" +#include <boost/scoped_ptr.hpp> #include <iostream> #include "mongo/db/json.h" #include "mongo/unittest/unittest.h" using namespace mongo; +using boost::scoped_ptr; namespace { diff --git a/src/mongo/db/index/haystack_access_method.cpp b/src/mongo/db/index/haystack_access_method.cpp index d282ce32d43..826bbc082fb 100644 --- a/src/mongo/db/index/haystack_access_method.cpp +++ b/src/mongo/db/index/haystack_access_method.cpp @@ -32,6 +32,8 @@ #include "mongo/db/index/haystack_access_method.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/status.h" #include "mongo/db/geo/hash.h" #include "mongo/db/index/expression_keys_private.h" @@ -43,6 +45,8 @@ namespace mongo { + using boost::scoped_ptr; + HaystackAccessMethod::HaystackAccessMethod(IndexCatalogEntry* btreeState, SortedDataInterface* btree) : BtreeBasedAccessMethod(btreeState, btree) { diff --git a/src/mongo/db/index/index_access_method.h b/src/mongo/db/index/index_access_method.h index 6dcd94bf0c7..6178de482f9 100644 --- a/src/mongo/db/index/index_access_method.h +++ b/src/mongo/db/index/index_access_method.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/index/index_cursor.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/jsobj.h" @@ -226,7 +228,7 @@ namespace mongo { bool _isValid; // This is meant to be filled out only by the friends above. - scoped_ptr<PrivateUpdateData> _indexSpecificUpdateData; + boost::scoped_ptr<PrivateUpdateData> _indexSpecificUpdateData; }; class UpdateTicket::PrivateUpdateData { diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp index 40bb5800afc..1cab723e5a0 100644 --- a/src/mongo/db/instance.cpp +++ b/src/mongo/db/instance.cpp @@ -32,6 +32,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <boost/thread/thread.hpp> #include <fstream> @@ -94,6 +95,7 @@ namespace mongo { + using boost::scoped_ptr; using logger::LogComponent; namespace { diff --git a/src/mongo/db/introspect.cpp b/src/mongo/db/introspect.cpp index 72017ea199c..69389bb6ecf 100644 --- a/src/mongo/db/introspect.cpp +++ b/src/mongo/db/introspect.cpp @@ -35,6 +35,8 @@ #include "mongo/pch.h" #undef MONGO_PCH_WHITELISTED +#include <boost/scoped_ptr.hpp> + #include "mongo/bson/util/builder.h" #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/auth/authorization_session.h" @@ -49,6 +51,8 @@ namespace mongo { + using boost::scoped_ptr; + namespace { void _appendUserInfo(const CurOp& c, BSONObjBuilder& builder, diff --git a/src/mongo/db/json.cpp b/src/mongo/db/json.cpp index 6008ff5fa5c..2edca737b0b 100644 --- a/src/mongo/db/json.cpp +++ b/src/mongo/db/json.cpp @@ -29,6 +29,8 @@ #include "mongo/db/json.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/parse_number.h" #include "mongo/db/jsobj.h" #include "mongo/platform/cstdint.h" @@ -41,6 +43,8 @@ namespace mongo { + using boost::scoped_ptr; + #if 0 #define MONGO_JSON_DEBUG(message) log() << "JSON DEBUG @ " << __FILE__\ << ":" << __LINE__ << " " << __FUNCTION__ << ": " << message << endl; diff --git a/src/mongo/db/operation_context_noop.h b/src/mongo/db/operation_context_noop.h index 0ebdbceb386..84c7d70a60b 100644 --- a/src/mongo/db/operation_context_noop.h +++ b/src/mongo/db/operation_context_noop.h @@ -27,6 +27,8 @@ */ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/operation_context.h" #include "mongo/db/client.h" #include "mongo/db/concurrency/locker_noop.h" @@ -107,7 +109,7 @@ namespace mongo { private: std::auto_ptr<RecoveryUnit> _recoveryUnit; - scoped_ptr<Locker> _locker; + boost::scoped_ptr<Locker> _locker; ProgressMeter _pm; }; diff --git a/src/mongo/db/ops/modifier_add_to_set.h b/src/mongo/db/ops/modifier_add_to_set.h index 065f6c83657..d5187ad1dab 100644 --- a/src/mongo/db/ops/modifier_add_to_set.h +++ b/src/mongo/db/ops/modifier_add_to_set.h @@ -80,7 +80,7 @@ namespace mongo { mutablebson::Element _val; struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; } // namespace mongo diff --git a/src/mongo/db/ops/modifier_bit.h b/src/mongo/db/ops/modifier_bit.h index 60fb4ab5e8c..e6c337857f1 100644 --- a/src/mongo/db/ops/modifier_bit.h +++ b/src/mongo/db/ops/modifier_bit.h @@ -94,7 +94,7 @@ namespace mongo { OpEntries _ops; struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; } // namespace mongo diff --git a/src/mongo/db/ops/modifier_compare.h b/src/mongo/db/ops/modifier_compare.h index 8aaa3a5e18e..880869d803c 100644 --- a/src/mongo/db/ops/modifier_compare.h +++ b/src/mongo/db/ops/modifier_compare.h @@ -105,7 +105,7 @@ namespace mongo { // prepare() was issued and until a log() is issued. The document this mod is // being prepared against must be live throughout all the calls. struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; } // namespace mongo diff --git a/src/mongo/db/ops/modifier_current_date.h b/src/mongo/db/ops/modifier_current_date.h index d85cd6e1d2b..469b1cca5e8 100644 --- a/src/mongo/db/ops/modifier_current_date.h +++ b/src/mongo/db/ops/modifier_current_date.h @@ -84,7 +84,7 @@ namespace mongo { // State which changes with each call of the mod. struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; } // namespace mongo diff --git a/src/mongo/db/ops/modifier_inc.h b/src/mongo/db/ops/modifier_inc.h index 3a93590fcbc..8e51d8ac6e1 100644 --- a/src/mongo/db/ops/modifier_inc.h +++ b/src/mongo/db/ops/modifier_inc.h @@ -95,7 +95,7 @@ namespace mongo { SafeNum _val; struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; } // namespace mongo diff --git a/src/mongo/db/ops/modifier_object_replace.h b/src/mongo/db/ops/modifier_object_replace.h index c8bc2ee4b5f..fe00f57ea29 100644 --- a/src/mongo/db/ops/modifier_object_replace.h +++ b/src/mongo/db/ops/modifier_object_replace.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/bson/mutable/element.h" @@ -91,7 +93,7 @@ namespace mongo { // was issued and until a log() is issued. The document this mod is being prepared // against must e live throughout all the calls. struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; } // namespace mongo diff --git a/src/mongo/db/ops/modifier_pop.h b/src/mongo/db/ops/modifier_pop.h index 00b8991dbbf..c8ab8ef8977 100644 --- a/src/mongo/db/ops/modifier_pop.h +++ b/src/mongo/db/ops/modifier_pop.h @@ -83,7 +83,7 @@ namespace mongo { // The instance of the field in the provided doc. // This data is valid after prepare, for use by log and apply struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; } // namespace mongo diff --git a/src/mongo/db/ops/modifier_pull.h b/src/mongo/db/ops/modifier_pull.h index b415ea0682d..f2fdba0cf24 100644 --- a/src/mongo/db/ops/modifier_pull.h +++ b/src/mongo/db/ops/modifier_pull.h @@ -78,11 +78,11 @@ namespace mongo { BSONObj _exprObj; // If we are using the matcher, this is the match expression we built around _exprObj. - scoped_ptr<MatchExpression> _matchExpr; + boost::scoped_ptr<MatchExpression> _matchExpr; bool _matcherOnPrimitive; struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; } // namespace mongo diff --git a/src/mongo/db/ops/modifier_pull_all.h b/src/mongo/db/ops/modifier_pull_all.h index 54e3ae571e2..349aa71d186 100644 --- a/src/mongo/db/ops/modifier_pull_all.h +++ b/src/mongo/db/ops/modifier_pull_all.h @@ -78,7 +78,7 @@ namespace mongo { // The instance of the field in the provided doc. // This data is valid after prepare, for use by log and apply struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; // User specified elements to remove std::vector<BSONElement> _elementsToFind; diff --git a/src/mongo/db/ops/modifier_push.h b/src/mongo/db/ops/modifier_push.h index 9abe6d7d0e0..d44d9a09769 100644 --- a/src/mongo/db/ops/modifier_push.h +++ b/src/mongo/db/ops/modifier_push.h @@ -129,7 +129,7 @@ namespace mongo { // prepare() was issued and until a log() is issued. The document this mod is // being prepared against must be live throughout all the calls. struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; diff --git a/src/mongo/db/ops/modifier_rename.h b/src/mongo/db/ops/modifier_rename.h index 21ac594024d..f57b3cb4ef4 100644 --- a/src/mongo/db/ops/modifier_rename.h +++ b/src/mongo/db/ops/modifier_rename.h @@ -93,7 +93,7 @@ namespace mongo { // The state carried over from prepare for apply/log struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; } // namespace mongo diff --git a/src/mongo/db/ops/modifier_set.h b/src/mongo/db/ops/modifier_set.h index f4ff52d6e4c..237ad903472 100644 --- a/src/mongo/db/ops/modifier_set.h +++ b/src/mongo/db/ops/modifier_set.h @@ -108,7 +108,7 @@ namespace mongo { // prepare() was issued and until a log() is issued. The document this mod is // being prepared against must be live throughout all the calls. struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; diff --git a/src/mongo/db/ops/modifier_unset.h b/src/mongo/db/ops/modifier_unset.h index 3e4a5fc2b22..7a825465896 100644 --- a/src/mongo/db/ops/modifier_unset.h +++ b/src/mongo/db/ops/modifier_unset.h @@ -97,7 +97,7 @@ namespace mongo { // prepare() was issued and until a log() is issued. The document this mod is // being prepared against must be live throughout all the calls. struct PreparedState; - scoped_ptr<PreparedState> _preparedState; + boost::scoped_ptr<PreparedState> _preparedState; }; diff --git a/src/mongo/db/ops/update_driver.cpp b/src/mongo/db/ops/update_driver.cpp index df8de62873e..556637ecee5 100644 --- a/src/mongo/db/ops/update_driver.cpp +++ b/src/mongo/db/ops/update_driver.cpp @@ -28,6 +28,8 @@ #include "mongo/db/ops/update_driver.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/error_codes.h" #include "mongo/base/string_data.h" #include "mongo/bson/mutable/algorithm.h" @@ -46,6 +48,7 @@ namespace mongo { namespace str = mongoutils::str; namespace mb = mongo::mutablebson; + using boost::scoped_ptr; using pathsupport::EqualityMatches; UpdateDriver::UpdateDriver(const Options& opts) diff --git a/src/mongo/db/pipeline/document_source.h b/src/mongo/db/pipeline/document_source.h index 5683244c946..52900cfaa42 100644 --- a/src/mongo/db/pipeline/document_source.h +++ b/src/mongo/db/pipeline/document_source.h @@ -35,6 +35,7 @@ #include <boost/optional.hpp> #include <boost/intrusive_ptr.hpp> +#include <boost/scoped_ptr.hpp> #include <boost/unordered_map.hpp> #include <deque> @@ -558,7 +559,7 @@ namespace mongo { GroupsMap::iterator groupsIterator; // only used when _spilled - scoped_ptr<Sorter<Value, Value>::Iterator> _sorterIterator; + boost::scoped_ptr<Sorter<Value, Value>::Iterator> _sorterIterator; std::pair<Value, Value> _firstPartOfNextGroup; Value _currentId; Accumulators _currentAccumulators; @@ -608,7 +609,7 @@ namespace mongo { DocumentSourceMatch(const BSONObj &query, const boost::intrusive_ptr<ExpressionContext> &pExpCtx); - scoped_ptr<Matcher> matcher; + boost::scoped_ptr<Matcher> matcher; bool _isTextQuery; }; @@ -903,7 +904,7 @@ namespace mongo { bool _done; bool _mergingPresorted; - scoped_ptr<MySorter::Iterator> _output; + boost::scoped_ptr<MySorter::Iterator> _output; }; class DocumentSourceLimit : public DocumentSource @@ -1050,11 +1051,11 @@ namespace mongo { void unwindPath(const FieldPath &fieldPath); // Configuration state. - scoped_ptr<FieldPath> _unwindPath; + boost::scoped_ptr<FieldPath> _unwindPath; // Iteration state. class Unwinder; - scoped_ptr<Unwinder> _unwinder; + boost::scoped_ptr<Unwinder> _unwinder; }; class DocumentSourceGeoNear : public DocumentSource @@ -1096,13 +1097,13 @@ namespace mongo { // coords and distanceField are required, rest are optional BSONObj coords; // "near" option, but near is a reserved keyword on windows bool coordsIsArray; - scoped_ptr<FieldPath> distanceField; // Using scoped_ptr because FieldPath can't be empty + boost::scoped_ptr<FieldPath> distanceField; // Using scoped_ptr because FieldPath can't be empty long long limit; double maxDistance; BSONObj query; bool spherical; double distanceMultiplier; - scoped_ptr<FieldPath> includeLocs; + boost::scoped_ptr<FieldPath> includeLocs; bool uniqueDocs; // these fields are used while processing the results diff --git a/src/mongo/db/pipeline/document_source_sort.cpp b/src/mongo/db/pipeline/document_source_sort.cpp index cce7f16cca6..2af962abafe 100644 --- a/src/mongo/db/pipeline/document_source_sort.cpp +++ b/src/mongo/db/pipeline/document_source_sort.cpp @@ -34,6 +34,7 @@ #include "mongo/db/pipeline/document_source.h" #include <boost/make_shared.hpp> +#include <boost/scoped_ptr.hpp> #include "mongo/db/jsobj.h" #include "mongo/db/pipeline/document.h" @@ -44,6 +45,7 @@ namespace mongo { using boost::intrusive_ptr; + using boost::scoped_ptr; const char DocumentSourceSort::sortName[] = "$sort"; diff --git a/src/mongo/db/query/canonical_query.h b/src/mongo/db/query/canonical_query.h index 800f2c833a0..b03eaefd4f6 100644 --- a/src/mongo/db/query/canonical_query.h +++ b/src/mongo/db/query/canonical_query.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/base/status.h" #include "mongo/db/dbmessage.h" #include "mongo/db/jsobj.h" @@ -230,12 +232,12 @@ namespace mongo { const MatchExpressionParser::WhereCallback& whereCallback, MatchExpression* root); - scoped_ptr<LiteParsedQuery> _pq; + boost::scoped_ptr<LiteParsedQuery> _pq; // _root points into _pq->getFilter() - scoped_ptr<MatchExpression> _root; + boost::scoped_ptr<MatchExpression> _root; - scoped_ptr<ParsedProjection> _proj; + boost::scoped_ptr<ParsedProjection> _proj; /** * Cache key is a string-ified combination of the query and sort obfuscated diff --git a/src/mongo/db/query/explain.cpp b/src/mongo/db/query/explain.cpp index cbaaf0bb8e2..ecce742a307 100644 --- a/src/mongo/db/query/explain.cpp +++ b/src/mongo/db/query/explain.cpp @@ -30,6 +30,8 @@ #include "mongo/db/query/explain.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/owned_pointer_vector.h" #include "mongo/db/exec/multi_plan.h" #include "mongo/db/query/get_executor.h" @@ -46,6 +48,7 @@ namespace { using namespace mongo; + using boost::scoped_ptr; /** * Traverse the tree rooted at 'root', and add all tree nodes into the list 'flattened'. diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index b44f4040644..575bf325b2c 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -32,6 +32,8 @@ #include "mongo/db/query/find.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/client/dbclientinterface.h" #include "mongo/db/clientcursor.h" #include "mongo/db/commands.h" @@ -60,6 +62,8 @@ #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" +using boost::scoped_ptr; + namespace mongo { // The .h for this in find_constants.h. const int32_t MaxBytesToReturnToClientAtOnce = 4 * 1024 * 1024; diff --git a/src/mongo/db/query/lite_parsed_query_test.cpp b/src/mongo/db/query/lite_parsed_query_test.cpp index 285412303ff..7ec42f2e0ad 100644 --- a/src/mongo/db/query/lite_parsed_query_test.cpp +++ b/src/mongo/db/query/lite_parsed_query_test.cpp @@ -32,10 +32,13 @@ #include "mongo/db/query/lite_parsed_query.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/json.h" #include "mongo/unittest/unittest.h" using namespace mongo; +using boost::scoped_ptr; namespace { diff --git a/src/mongo/db/query/plan_cache.h b/src/mongo/db/query/plan_cache.h index bc89e9aa7da..57f5657b053 100644 --- a/src/mongo/db/query/plan_cache.h +++ b/src/mongo/db/query/plan_cache.h @@ -30,6 +30,7 @@ #include <set> #include <boost/optional/optional.hpp> +#include <boost/scoped_ptr.hpp> #include <boost/thread/mutex.hpp> #include "mongo/db/exec/plan_stats.h" @@ -139,7 +140,7 @@ namespace mongo { // can be used to tag an isomorphic match expression. If 'wholeIXSoln' // is true, then 'tree' is used to store the relevant IndexEntry. // If 'collscanSoln' is true, then 'tree' should be NULL. - scoped_ptr<PlanCacheIndexTree> tree; + boost::scoped_ptr<PlanCacheIndexTree> tree; enum SolutionType { // Indicates that the plan should use diff --git a/src/mongo/db/query/plan_cache_test.cpp b/src/mongo/db/query/plan_cache_test.cpp index 726f6378883..19b44fd46a5 100644 --- a/src/mongo/db/query/plan_cache_test.cpp +++ b/src/mongo/db/query/plan_cache_test.cpp @@ -33,8 +33,10 @@ #include "mongo/db/query/plan_cache.h" #include <algorithm> +#include <boost/scoped_ptr.hpp> #include <ostream> #include <memory> + #include "mongo/db/jsobj.h" #include "mongo/db/json.h" #include "mongo/db/query/qlog.h" @@ -50,6 +52,7 @@ using namespace mongo; namespace { + using boost::scoped_ptr; using std::auto_ptr; static const char* ns = "somebogusns"; diff --git a/src/mongo/db/query/plan_enumerator.h b/src/mongo/db/query/plan_enumerator.h index 5f27a6ebbf1..1edd1d850a1 100644 --- a/src/mongo/db/query/plan_enumerator.h +++ b/src/mongo/db/query/plan_enumerator.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <vector> #include "mongo/base/disallow_copying.h" @@ -231,10 +232,10 @@ namespace mongo { * Associates indices with predicates. */ struct NodeAssignment { - scoped_ptr<PredicateAssignment> pred; - scoped_ptr<OrAssignment> orAssignment; - scoped_ptr<AndAssignment> andAssignment; - scoped_ptr<ArrayAssignment> arrayAssignment; + boost::scoped_ptr<PredicateAssignment> pred; + boost::scoped_ptr<OrAssignment> orAssignment; + boost::scoped_ptr<AndAssignment> andAssignment; + boost::scoped_ptr<ArrayAssignment> arrayAssignment; std::string toString() const; }; diff --git a/src/mongo/db/query/query_solution.h b/src/mongo/db/query/query_solution.h index 81a93d2c26c..e495fa6aed0 100644 --- a/src/mongo/db/query/query_solution.h +++ b/src/mongo/db/query/query_solution.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/jsobj.h" #include "mongo/db/matcher/expression.h" #include "mongo/db/fts/fts_query.h" @@ -148,7 +150,7 @@ namespace mongo { // If a stage has a non-NULL filter all values outputted from that stage must pass that // filter. - scoped_ptr<MatchExpression> filter; + boost::scoped_ptr<MatchExpression> filter; protected: /** @@ -176,7 +178,7 @@ namespace mongo { QuerySolution() : hasBlockingStage(false), indexFilterApplied(false) { } // Owned here. - scoped_ptr<QuerySolutionNode> root; + boost::scoped_ptr<QuerySolutionNode> root; // Any filters in root or below point into this object. Must be owned. BSONObj filterData; diff --git a/src/mongo/db/range_deleter.h b/src/mongo/db/range_deleter.h index a40415b5146..6cc9d6eddb6 100644 --- a/src/mongo/db/range_deleter.h +++ b/src/mongo/db/range_deleter.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <boost/thread/thread.hpp> #include <deque> #include <set> @@ -199,10 +200,10 @@ namespace mongo { /** Returns true if stopWorkers() was called. This call is synchronized. */ bool stopRequested() const; - scoped_ptr<RangeDeleterEnv> _env; + boost::scoped_ptr<RangeDeleterEnv> _env; // Initially not active. Must be started explicitly. - scoped_ptr<boost::thread> _worker; + boost::scoped_ptr<boost::thread> _worker; // Protects _stopRequested. mutable mutex _stopMutex; diff --git a/src/mongo/db/repl/elect_cmd_runner_test.cpp b/src/mongo/db/repl/elect_cmd_runner_test.cpp index b91317620f6..983e39a3b1b 100644 --- a/src/mongo/db/repl/elect_cmd_runner_test.cpp +++ b/src/mongo/db/repl/elect_cmd_runner_test.cpp @@ -41,6 +41,9 @@ #include "mongo/stdx/functional.h" #include "mongo/unittest/unittest.h" + +using boost::scoped_ptr; + namespace mongo { namespace repl { namespace { diff --git a/src/mongo/db/repl/freshness_checker.h b/src/mongo/db/repl/freshness_checker.h index 0b6471b31ac..8f8d07a1d65 100644 --- a/src/mongo/db/repl/freshness_checker.h +++ b/src/mongo/db/repl/freshness_checker.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <vector> #include "mongo/base/disallow_copying.h" diff --git a/src/mongo/db/repl/freshness_checker_test.cpp b/src/mongo/db/repl/freshness_checker_test.cpp index f17e860b67d..362b4746606 100644 --- a/src/mongo/db/repl/freshness_checker_test.cpp +++ b/src/mongo/db/repl/freshness_checker_test.cpp @@ -43,6 +43,8 @@ #include "mongo/unittest/unittest.h" #include "mongo/util/mongoutils/str.h" +using boost::scoped_ptr; + namespace mongo { namespace repl { namespace { diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp index 742817cc1e4..9a72485e0d9 100644 --- a/src/mongo/db/repl/master_slave.cpp +++ b/src/mongo/db/repl/master_slave.cpp @@ -44,6 +44,7 @@ #include <iostream> #include <pcrecpp.h> +#include <boost/scoped_ptr.hpp> #include <boost/thread/thread.hpp> #include "mongo/db/auth/authorization_manager.h" @@ -66,8 +67,9 @@ #include "mongo/util/exit.h" #include "mongo/util/log.h" -namespace mongo { +using boost::scoped_ptr; +namespace mongo { namespace repl { void pretouchOperation(OperationContext* txn, const BSONObj& op); diff --git a/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp b/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp index b1cf1bf5da6..3b4fe4ac8a0 100644 --- a/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp +++ b/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp @@ -28,6 +28,8 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/unittest/unittest.h" #include "mongo/util/assert_util.h" #include "mongo/db/repl/repl_set_heartbeat_response.h" @@ -36,6 +38,8 @@ namespace mongo { namespace repl { namespace { + using boost::scoped_ptr; + bool stringContains(const std::string &haystack, const std::string& needle) { return haystack.find(needle) != std::string::npos; } diff --git a/src/mongo/db/repl/scoped_conn.h b/src/mongo/db/repl/scoped_conn.h index d8bed889d6d..9c3f67e8a8b 100644 --- a/src/mongo/db/repl/scoped_conn.h +++ b/src/mongo/db/repl/scoped_conn.h @@ -30,6 +30,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <map> #include "mongo/db/auth/authorization_manager.h" @@ -96,7 +97,7 @@ namespace repl { static mongo::mutex mapMutex; struct ConnectionInfo { mongo::mutex lock; - scoped_ptr<DBClientConnection> cc; + boost::scoped_ptr<DBClientConnection> cc; bool connected; ConnectionInfo(); @@ -119,7 +120,7 @@ namespace repl { } *connInfo; typedef std::map<std::string,ScopedConn::ConnectionInfo*> M; static M& _map; - scoped_ptr<DBClientConnection>& conn() { return connInfo->cc; } + boost::scoped_ptr<DBClientConnection>& conn() { return connInfo->cc; } const std::string _hostport; // we should already be locked... diff --git a/src/mongo/db/repl/topology_coordinator_impl_test.cpp b/src/mongo/db/repl/topology_coordinator_impl_test.cpp index 435773e6977..a0505446905 100644 --- a/src/mongo/db/repl/topology_coordinator_impl_test.cpp +++ b/src/mongo/db/repl/topology_coordinator_impl_test.cpp @@ -28,6 +28,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <iostream> #include "mongo/db/repl/heartbeat_response_action.h" @@ -44,6 +45,8 @@ #define ASSERT_NO_ACTION(EXPRESSION) \ ASSERT_EQUALS(mongo::repl::HeartbeatResponseAction::NoAction, (EXPRESSION)) +using boost::scoped_ptr; + namespace mongo { namespace repl { namespace { diff --git a/src/mongo/db/storage/kv/kv_catalog.cpp b/src/mongo/db/storage/kv/kv_catalog.cpp index a5a37c69ede..3f5c4c85be3 100644 --- a/src/mongo/db/storage/kv/kv_catalog.cpp +++ b/src/mongo/db/storage/kv/kv_catalog.cpp @@ -32,6 +32,7 @@ #include "mongo/db/storage/kv/kv_catalog.h" +#include <boost/scoped_ptr.hpp> #include <stdlib.h> #include "mongo/db/concurrency/d_concurrency.h" @@ -52,6 +53,8 @@ namespace { const ResourceId resourceIdCatalogMetadata(RESOURCE_METADATA, 1ULL); } + using boost::scoped_ptr; + class KVCatalog::AddIdentChange : public RecoveryUnit::Change { public: AddIdentChange(KVCatalog* catalog, const StringData& ident) diff --git a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp index 46c8b8f1965..f1d721ede4a 100644 --- a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp +++ b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp @@ -30,6 +30,8 @@ #include "mongo/db/storage/kv/kv_engine_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/operation_context_noop.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/storage/kv/kv_catalog.h" @@ -40,6 +42,8 @@ namespace mongo { + using boost::scoped_ptr; + namespace { class MyOperationContext : public OperationContextNoop { public: diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp index 6d2912b1152..969a7a08b71 100644 --- a/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp +++ b/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp @@ -28,12 +28,16 @@ #include "mongo/db/storage/sorted_data_interface.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/operation_context.h" #include "mongo/db/storage/mmap_v1/btree/btree_logic.h" namespace mongo { + using boost::scoped_ptr; + template <class OnDiskFormat> class BtreeBuilderInterfaceImpl : public SortedDataBuilderInterface { public: diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp index 7478c239f0d..6faffcc6900 100644 --- a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp +++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp @@ -30,10 +30,15 @@ #include "mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/operation_context.h" #include "mongo/db/ops/update.h" namespace mongo { + + using boost::scoped_ptr; + BOOST_STATIC_ASSERT(RecordStoreV1Base::Buckets == NamespaceDetails::SmallBuckets + NamespaceDetails::LargeBuckets); diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.h b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.h index fd7a7854093..a0df358f00e 100644 --- a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.h +++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.h @@ -30,6 +30,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <list> #include <string> @@ -86,7 +87,7 @@ namespace mongo { const std::string _database; DurableMappedFile _f; - scoped_ptr<NamespaceHashTable> _ht; + boost::scoped_ptr<NamespaceHashTable> _ht; }; } diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp index 9a2a7e57d5d..999c279d49d 100644 --- a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp +++ b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp @@ -32,6 +32,7 @@ #include "mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.h" +#include <boost/scoped_ptr.hpp> #include <utility> #include "mongo/db/catalog/index_catalog_entry.h" @@ -54,6 +55,9 @@ #include "mongo/util/log.h" namespace mongo { + + using boost::scoped_ptr; + namespace { /** diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.h b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.h index 6a597e85dc3..e6cae1cacc9 100644 --- a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.h +++ b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <map> #include <string> @@ -135,8 +136,8 @@ namespace mongo { // RecoveryUnit to ensure correct handling of rollback. struct Entry { - scoped_ptr<CollectionCatalogEntry> catalogEntry; - scoped_ptr<RecordStoreV1Base> recordStore; + boost::scoped_ptr<CollectionCatalogEntry> catalogEntry; + boost::scoped_ptr<RecordStoreV1Base> recordStore; }; typedef std::map<std::string, Entry*> CollectionMap; diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp index 8a05d791863..6bf7b377857 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp @@ -32,6 +32,8 @@ #include "mongo/db/storage/mmap_v1/record_store_v1_base.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/catalog/collection.h" #include "mongo/db/operation_context.h" #include "mongo/db/storage/mmap_v1/extent.h" @@ -45,6 +47,8 @@ namespace mongo { + using boost::scoped_ptr; + /* Deleted list buckets are used to quickly locate free space based on size. Each bucket contains records up to that size (meaning a record with a size exactly equal to bucketSizes[n] would go into bucket n+1). diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_base.h b/src/mongo/db/storage/mmap_v1/record_store_v1_base.h index 8f34b145ffb..12d78f78c58 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_base.h +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_base.h @@ -30,6 +30,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/mmap_v1/diskloc.h" #include "mongo/db/storage/record_store.h" @@ -253,7 +255,7 @@ namespace mongo { int len, bool enforceQuota ); - scoped_ptr<RecordStoreV1MetaData> _details; + boost::scoped_ptr<RecordStoreV1MetaData> _details; ExtentManager* _extentManager; bool _isSystemIndexes; diff --git a/src/mongo/db/storage/mmap_v1/repair_database.cpp b/src/mongo/db/storage/mmap_v1/repair_database.cpp index fbe2045cff1..afd4c08a546 100644 --- a/src/mongo/db/storage/mmap_v1/repair_database.cpp +++ b/src/mongo/db/storage/mmap_v1/repair_database.cpp @@ -35,6 +35,7 @@ #include "mongo/db/storage/mmap_v1/mmap_v1_engine.h" #include <boost/filesystem/operations.hpp> +#include <boost/scoped_ptr.hpp> #include "mongo/db/background.h" #include "mongo/db/catalog/collection.h" @@ -54,6 +55,8 @@ namespace mongo { + using boost::scoped_ptr; + typedef boost::filesystem::path Path; // inheritable class to implement an operation that may be applied to all diff --git a/src/mongo/db/storage/record_store_test_customoption.cpp b/src/mongo/db/storage/record_store_test_customoption.cpp index ab5e51be113..d5d99f1bf9e 100644 --- a/src/mongo/db/storage/record_store_test_customoption.cpp +++ b/src/mongo/db/storage/record_store_test_customoption.cpp @@ -30,6 +30,8 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/bson/bsonobj.h" #include "mongo/bson/bsonmisc.h" #include "mongo/db/storage/record_store.h" @@ -37,6 +39,8 @@ namespace mongo { + using boost::scoped_ptr; + // Verify that calling setCustomOption() with { "usePowerOf2Sizes": true } // returns an OK status. TEST( RecordStoreTestHarness, SetPowerOf2SizesOptionTrue ) { diff --git a/src/mongo/db/storage/record_store_test_datafor.cpp b/src/mongo/db/storage/record_store_test_datafor.cpp index 13acd9270ee..a068c26ad27 100644 --- a/src/mongo/db/storage/record_store_test_datafor.cpp +++ b/src/mongo/db/storage/record_store_test_datafor.cpp @@ -30,6 +30,8 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/record_id.h" #include "mongo/db/storage/record_data.h" #include "mongo/db/storage/record_store.h" @@ -40,6 +42,8 @@ using std::stringstream; namespace mongo { + using boost::scoped_ptr; + // Insert a record and verify its contents by calling dataFor() // on the returned RecordId. TEST( RecordStoreTestHarness, DataFor ) { diff --git a/src/mongo/db/storage/record_store_test_datasize.cpp b/src/mongo/db/storage/record_store_test_datasize.cpp index f2b7730403b..aadcc99acb8 100644 --- a/src/mongo/db/storage/record_store_test_datasize.cpp +++ b/src/mongo/db/storage/record_store_test_datasize.cpp @@ -30,6 +30,8 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" @@ -38,6 +40,8 @@ using std::stringstream; namespace mongo { + using boost::scoped_ptr; + // Verify that an empty collection takes up no space. TEST( RecordStoreTestHarness, DataSizeEmpty ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/record_store_test_deleterecord.cpp b/src/mongo/db/storage/record_store_test_deleterecord.cpp index afc4d78c92c..e51ba6c224f 100644 --- a/src/mongo/db/storage/record_store_test_deleterecord.cpp +++ b/src/mongo/db/storage/record_store_test_deleterecord.cpp @@ -30,6 +30,8 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/record_id.h" #include "mongo/db/storage/record_data.h" #include "mongo/db/storage/record_store.h" @@ -40,6 +42,8 @@ using std::stringstream; namespace mongo { + using boost::scoped_ptr; + // Insert a record and try to delete it. TEST( RecordStoreTestHarness, DeleteRecord ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/record_store_test_harness.cpp b/src/mongo/db/storage/record_store_test_harness.cpp index cd0694132cc..1d8cd2bd32a 100644 --- a/src/mongo/db/storage/record_store_test_harness.cpp +++ b/src/mongo/db/storage/record_store_test_harness.cpp @@ -30,10 +30,15 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" namespace mongo { + + using boost::scoped_ptr; + TEST( RecordStoreTestHarness, Simple1 ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); scoped_ptr<RecordStore> rs( harnessHelper->newNonCappedRecordStore() ); diff --git a/src/mongo/db/storage/record_store_test_insertrecord.cpp b/src/mongo/db/storage/record_store_test_insertrecord.cpp index df539a013d8..5fddb8c4e01 100644 --- a/src/mongo/db/storage/record_store_test_insertrecord.cpp +++ b/src/mongo/db/storage/record_store_test_insertrecord.cpp @@ -30,6 +30,8 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/record_id.h" #include "mongo/db/storage/record_data.h" #include "mongo/db/storage/record_store.h" @@ -41,6 +43,8 @@ using std::stringstream; namespace mongo { + using boost::scoped_ptr; + // Insert a record and verify the number of entries in the collection is 1. TEST( RecordStoreTestHarness, InsertRecord ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/record_store_test_manyiter.cpp b/src/mongo/db/storage/record_store_test_manyiter.cpp index 83ddcdc5c8f..ba31c2109e7 100644 --- a/src/mongo/db/storage/record_store_test_manyiter.cpp +++ b/src/mongo/db/storage/record_store_test_manyiter.cpp @@ -30,6 +30,8 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/record_id.h" #include "mongo/db/storage/record_data.h" #include "mongo/db/storage/record_store.h" @@ -42,6 +44,8 @@ using std::vector; namespace mongo { + using boost::scoped_ptr; + // Create multiple iterators over an empty record store. TEST( RecordStoreTestHarness, GetManyIteratorsEmpty ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/record_store_test_recorditer.cpp b/src/mongo/db/storage/record_store_test_recorditer.cpp index 0b0bcb0e7a4..4d67b6bfd90 100644 --- a/src/mongo/db/storage/record_store_test_recorditer.cpp +++ b/src/mongo/db/storage/record_store_test_recorditer.cpp @@ -31,6 +31,7 @@ #include "mongo/db/storage/record_store_test_harness.h" #include <algorithm> +#include <boost/scoped_ptr.hpp> #include "mongo/bson/util/builder.h" #include "mongo/db/record_id.h" @@ -38,6 +39,7 @@ #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::string; using std::stringstream; diff --git a/src/mongo/db/storage/record_store_test_recordstore.cpp b/src/mongo/db/storage/record_store_test_recordstore.cpp index 8cca19a5426..c5dd2c60805 100644 --- a/src/mongo/db/storage/record_store_test_recordstore.cpp +++ b/src/mongo/db/storage/record_store_test_recordstore.cpp @@ -30,9 +30,12 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::string; namespace mongo { diff --git a/src/mongo/db/storage/record_store_test_repairiter.cpp b/src/mongo/db/storage/record_store_test_repairiter.cpp index 535a0fa4d79..12f035aff32 100644 --- a/src/mongo/db/storage/record_store_test_repairiter.cpp +++ b/src/mongo/db/storage/record_store_test_repairiter.cpp @@ -30,11 +30,14 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/record_id.h" #include "mongo/db/storage/record_data.h" #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::set; using std::string; using std::stringstream; diff --git a/src/mongo/db/storage/record_store_test_storagesize.cpp b/src/mongo/db/storage/record_store_test_storagesize.cpp index edbaa28d045..9f5ec9163cf 100644 --- a/src/mongo/db/storage/record_store_test_storagesize.cpp +++ b/src/mongo/db/storage/record_store_test_storagesize.cpp @@ -30,9 +30,12 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::string; using std::stringstream; diff --git a/src/mongo/db/storage/record_store_test_touch.cpp b/src/mongo/db/storage/record_store_test_touch.cpp index 14084ceadd4..505ab02c453 100644 --- a/src/mongo/db/storage/record_store_test_touch.cpp +++ b/src/mongo/db/storage/record_store_test_touch.cpp @@ -30,9 +30,12 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::string; using std::stringstream; diff --git a/src/mongo/db/storage/record_store_test_truncate.cpp b/src/mongo/db/storage/record_store_test_truncate.cpp index 1beb17278ca..a4d21b1f0cc 100644 --- a/src/mongo/db/storage/record_store_test_truncate.cpp +++ b/src/mongo/db/storage/record_store_test_truncate.cpp @@ -30,9 +30,12 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::string; using std::stringstream; diff --git a/src/mongo/db/storage/record_store_test_updaterecord.cpp b/src/mongo/db/storage/record_store_test_updaterecord.cpp index 63ca8fd77e1..207f2d2ef2d 100644 --- a/src/mongo/db/storage/record_store_test_updaterecord.cpp +++ b/src/mongo/db/storage/record_store_test_updaterecord.cpp @@ -30,12 +30,15 @@ #include "mongo/db/storage/record_store_test_updaterecord.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/record_id.h" #include "mongo/db/storage/record_data.h" #include "mongo/db/storage/record_store.h" #include "mongo/db/storage/record_store_test_harness.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::string; using std::stringstream; diff --git a/src/mongo/db/storage/record_store_test_updatewithdamages.cpp b/src/mongo/db/storage/record_store_test_updatewithdamages.cpp index 63280494557..d60baeee071 100644 --- a/src/mongo/db/storage/record_store_test_updatewithdamages.cpp +++ b/src/mongo/db/storage/record_store_test_updatewithdamages.cpp @@ -30,11 +30,14 @@ #include "mongo/db/storage/record_store_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/record_id.h" #include "mongo/db/storage/record_data.h" #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::string; namespace mongo { diff --git a/src/mongo/db/storage/record_store_test_validate.cpp b/src/mongo/db/storage/record_store_test_validate.cpp index 80bf1eede60..984b8beb8ef 100644 --- a/src/mongo/db/storage/record_store_test_validate.cpp +++ b/src/mongo/db/storage/record_store_test_validate.cpp @@ -30,10 +30,13 @@ #include "mongo/db/storage/record_store_test_validate.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/record_store.h" #include "mongo/db/storage/record_store_test_harness.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::string; namespace mongo { diff --git a/src/mongo/db/storage/record_store_test_validate.h b/src/mongo/db/storage/record_store_test_validate.h index 4a75d798d67..d403800dc84 100644 --- a/src/mongo/db/storage/record_store_test_validate.h +++ b/src/mongo/db/storage/record_store_test_validate.h @@ -30,6 +30,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/record_data.h" #include "mongo/db/storage/record_store.h" #include "mongo/db/storage/record_store_test_harness.h" @@ -83,13 +85,13 @@ namespace { void setUp() { { - scoped_ptr<OperationContext> opCtx( newOperationContext() ); + boost::scoped_ptr<OperationContext> opCtx( newOperationContext() ); ASSERT_EQUALS( 0, _rs->numRecords( opCtx.get() ) ); } int nToInsert = 10; for ( int i = 0; i < nToInsert; i++ ) { - scoped_ptr<OperationContext> opCtx( newOperationContext() ); + boost::scoped_ptr<OperationContext> opCtx( newOperationContext() ); { stringstream ss; ss << "record " << i; @@ -107,14 +109,14 @@ namespace { } { - scoped_ptr<OperationContext> opCtx( newOperationContext() ); + boost::scoped_ptr<OperationContext> opCtx( newOperationContext() ); ASSERT_EQUALS( nToInsert, _rs->numRecords( opCtx.get() ) ); } } private: - scoped_ptr<HarnessHelper> _harnessHelper; - scoped_ptr<RecordStore> _rs; + boost::scoped_ptr<HarnessHelper> _harnessHelper; + boost::scoped_ptr<RecordStore> _rs; set<string> _remain; }; diff --git a/src/mongo/db/storage/rocks/rocks_record_store.h b/src/mongo/db/storage/rocks/rocks_record_store.h index 1c234598fc7..5bcf7befb8d 100644 --- a/src/mongo/db/storage/rocks/rocks_record_store.h +++ b/src/mongo/db/storage/rocks/rocks_record_store.h @@ -32,6 +32,7 @@ #pragma once #include <atomic> +#include <boost/scoped_ptr.hpp> #include <string> #include <memory> #include <vector> diff --git a/src/mongo/db/storage/rocks/rocks_record_store_test.cpp b/src/mongo/db/storage/rocks/rocks_record_store_test.cpp index 6a27f822cc5..16883e7e401 100644 --- a/src/mongo/db/storage/rocks/rocks_record_store_test.cpp +++ b/src/mongo/db/storage/rocks/rocks_record_store_test.cpp @@ -32,6 +32,7 @@ #include <vector> #include <boost/filesystem/operations.hpp> +#include <boost/scoped_ptr.hpp> #include <rocksdb/comparator.h> #include <rocksdb/db.h> @@ -48,6 +49,8 @@ namespace mongo { + using boost::scoped_ptr; + class RocksRecordStoreHarnessHelper : public HarnessHelper { public: RocksRecordStoreHarnessHelper() : _tempDir(_testNamespace) { diff --git a/src/mongo/db/storage/rocks/rocks_sorted_data_impl.cpp b/src/mongo/db/storage/rocks/rocks_sorted_data_impl.cpp index 7e683686bb6..188d5ee1280 100644 --- a/src/mongo/db/storage/rocks/rocks_sorted_data_impl.cpp +++ b/src/mongo/db/storage/rocks/rocks_sorted_data_impl.cpp @@ -32,6 +32,7 @@ #include "mongo/db/storage/rocks/rocks_sorted_data_impl.h" +#include <boost/scoped_ptr.hpp> #include <cstdlib> #include <string> @@ -50,6 +51,8 @@ namespace mongo { + using boost::scoped_ptr; + namespace { const int kTempKeyMaxSize = 1024; // Do the same as the heap implementation diff --git a/src/mongo/db/storage/rocks/rocks_sorted_data_impl_test.cpp b/src/mongo/db/storage/rocks/rocks_sorted_data_impl_test.cpp index f5df90ea478..4a266c2efed 100644 --- a/src/mongo/db/storage/rocks/rocks_sorted_data_impl_test.cpp +++ b/src/mongo/db/storage/rocks/rocks_sorted_data_impl_test.cpp @@ -26,6 +26,7 @@ * it in the license file. */ +#include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <boost/filesystem/operations.hpp> @@ -45,6 +46,8 @@ namespace mongo { + using boost::scoped_ptr; + class RocksSortedDataImplHarness : public HarnessHelper { public: RocksSortedDataImplHarness() : _order(Ordering::make(BSONObj())), _tempDir(_testNamespace) { diff --git a/src/mongo/db/storage/sorted_data_interface_test_bulkbuilder.cpp b/src/mongo/db/storage/sorted_data_interface_test_bulkbuilder.cpp index f058d98231d..8de85f0d5de 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_bulkbuilder.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_bulkbuilder.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Add a key using a bulk builder. TEST( SortedDataInterface, BuilderAddKey ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/sorted_data_interface_test_cursor.cpp b/src/mongo/db/storage/sorted_data_interface_test_cursor.cpp index c6adfd3de3f..069c93a4041 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_cursor.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_cursor.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Call getDirection() on a forward cursor and verify the result equals +1. TEST( SortedDataInterface, GetCursorDirection ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp b/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp index da78e71e595..b2d59de5ec1 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Insert multiple single-field keys and advance to each of them // using a forward cursor by specifying their exact key. When // advanceTo() is called on a duplicate key, the cursor is diff --git a/src/mongo/db/storage/sorted_data_interface_test_cursor_locate.cpp b/src/mongo/db/storage/sorted_data_interface_test_cursor_locate.cpp index 5c21f00616e..3d0a95e99a6 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_cursor_locate.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_cursor_locate.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Insert a key and try to locate it using a forward cursor // by specifying its exact key and RecordId. TEST( SortedDataInterface, Locate ) { diff --git a/src/mongo/db/storage/sorted_data_interface_test_cursor_position.cpp b/src/mongo/db/storage/sorted_data_interface_test_cursor_position.cpp index ba368de3e34..fd341c8e2ed 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_cursor_position.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_cursor_position.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Verify that two forward cursors positioned at EOF are considered // to point to the same place. TEST( SortedDataInterface, CursorsPointToSamePlaceIfEOF ) { diff --git a/src/mongo/db/storage/sorted_data_interface_test_cursor_saverestore.cpp b/src/mongo/db/storage/sorted_data_interface_test_cursor_saverestore.cpp index 2031e1cf278..2e71e60b145 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_cursor_saverestore.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_cursor_saverestore.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Insert multiple keys and try to iterate through all of them // using a forward cursor while calling savePosition() and // restorePosition() in succession. diff --git a/src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp b/src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp index a8644536ea2..56ddfc390a1 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_dupkeycheck.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Insert a key and verify that dupKeyCheck() returns a non-OK status for // the same key. When dupKeyCheck() is called with the exact (key, RecordId) // pair that was inserted, it should still return an OK status. diff --git a/src/mongo/db/storage/sorted_data_interface_test_fullvalidate.cpp b/src/mongo/db/storage/sorted_data_interface_test_fullvalidate.cpp index 703d281b520..20ba21ec815 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_fullvalidate.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_fullvalidate.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Insert multiple keys and verify that fullValidate() either sets // the `numKeysOut` as the number of entries in the index, or as -1. TEST( SortedDataInterface, FullValidate ) { diff --git a/src/mongo/db/storage/sorted_data_interface_test_harness.cpp b/src/mongo/db/storage/sorted_data_interface_test_harness.cpp index 0f7ff24a940..f26ac1ef494 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_harness.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_harness.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + TEST( SortedDataInterface, InsertWithDups1 ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); scoped_ptr<SortedDataInterface> sorted( harnessHelper->newSortedDataInterface( false ) ); diff --git a/src/mongo/db/storage/sorted_data_interface_test_insert.cpp b/src/mongo/db/storage/sorted_data_interface_test_insert.cpp index 2ae1675ca74..d18530f9353 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_insert.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_insert.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Insert a key and verify that the number of entries in the index equals 1. TEST( SortedDataInterface, Insert ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/sorted_data_interface_test_isempty.cpp b/src/mongo/db/storage/sorted_data_interface_test_isempty.cpp index 1a85e25b80d..d8d40a58cbc 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_isempty.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_isempty.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Verify that isEmpty() returns true when the index is empty, // returns false when a key is inserted, and returns true again // when that is unindex. diff --git a/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp b/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp index dc6da2a988e..b016b8f6a82 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_rollback.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Insert multiple keys and verify that omitting the commit() // on the WriteUnitOfWork causes the changes to not become visible. TEST( SortedDataInterface, InsertWithoutCommit ) { diff --git a/src/mongo/db/storage/sorted_data_interface_test_spaceused.cpp b/src/mongo/db/storage/sorted_data_interface_test_spaceused.cpp index f11bbe3b49b..5332bd0afb0 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_spaceused.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_spaceused.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Verify that an empty index takes up no space. TEST( SortedDataInterface, GetSpaceUsedBytesEmpty ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/sorted_data_interface_test_touch.cpp b/src/mongo/db/storage/sorted_data_interface_test_touch.cpp index 0719dd0209f..f131660f4b0 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_touch.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_touch.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Verify that calling touch() on an empty index returns an OK status. TEST( SortedDataInterface, TouchEmpty ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp b/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp index 1ca69411417..9429f6218fa 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_unindex.cpp @@ -30,11 +30,15 @@ #include "mongo/db/storage/sorted_data_interface_test_harness.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/storage/sorted_data_interface.h" #include "mongo/unittest/unittest.h" namespace mongo { + using boost::scoped_ptr; + // Insert a key and verify that it can be unindexed. TEST( SortedDataInterface, Unindex ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h index fcfc812fe4e..4d2e0561aba 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h @@ -34,6 +34,7 @@ #include <set> #include <string> +#include <boost/scoped_ptr.hpp> #include <boost/thread/mutex.hpp> #include <wiredtiger.h> @@ -139,7 +140,7 @@ namespace mongo { std::set<std::string> _identToDrop; mutable boost::mutex _identToDropMutex; - scoped_ptr<WiredTigerSizeStorer> _sizeStorer; + boost::scoped_ptr<WiredTigerSizeStorer> _sizeStorer; string _sizeStorerUri; mutable ElapsedTracker _sizeStorerSyncTracker; }; diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp index e0583408f0c..301b1225354 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp @@ -35,6 +35,7 @@ #include "mongo/db/storage/wiredtiger/wiredtiger_record_store.h" +#include <boost/scoped_ptr.hpp> #include <boost/shared_array.hpp> #include <wiredtiger.h> @@ -56,6 +57,9 @@ #define RS_ITERATOR_TRACE(x) namespace mongo { + + using boost::scoped_ptr; + namespace { static const int kMinimumRecordStoreVersion = 1; static const int kCurrentRecordStoreVersion = 1; // New record stores use this by default. diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h index 5e2ba6fc683..b9ba9382b45 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.h @@ -34,6 +34,7 @@ #include <set> #include <string> +#include <boost/scoped_ptr.hpp> #include <boost/thread/mutex.hpp> #include "mongo/db/catalog/collection_options.h" @@ -219,7 +220,7 @@ namespace mongo { RecoveryUnit* _savedRecoveryUnit; // only used to sanity check between save/restore const bool _forward; bool _forParallelCollectionScan; - scoped_ptr<WiredTigerCursor> _cursor; + boost::scoped_ptr<WiredTigerCursor> _cursor; bool _eof; const RecordId _readUntilForOplog; diff --git a/src/mongo/dbtests/basictests.cpp b/src/mongo/dbtests/basictests.cpp index dd5dbe40f10..b0d7bb51c18 100644 --- a/src/mongo/dbtests/basictests.cpp +++ b/src/mongo/dbtests/basictests.cpp @@ -31,6 +31,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <iostream> #include "mongo/db/operation_context_impl.h" @@ -47,6 +48,8 @@ namespace BasicTests { + using boost::scoped_ptr; + class Rarely { public: void run() { diff --git a/src/mongo/dbtests/config_server_fixture.cpp b/src/mongo/dbtests/config_server_fixture.cpp index 479c21fa059..965ed3a6cfd 100644 --- a/src/mongo/dbtests/config_server_fixture.cpp +++ b/src/mongo/dbtests/config_server_fixture.cpp @@ -30,6 +30,7 @@ #include "mongo/dbtests/config_server_fixture.h" +#include <boost/scoped_ptr.hpp> #include <list> #include "mongo/dbtests/dbtests.h" @@ -46,6 +47,7 @@ namespace mongo { + using boost::scoped_ptr; using std::list; ConfigServerFixture::ConfigServerFixture() diff --git a/src/mongo/dbtests/indexupdatetests.cpp b/src/mongo/dbtests/indexupdatetests.cpp index f76292e2871..30ac55d7389 100644 --- a/src/mongo/dbtests/indexupdatetests.cpp +++ b/src/mongo/dbtests/indexupdatetests.cpp @@ -28,6 +28,8 @@ * 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" #include "mongo/db/catalog/index_create.h" @@ -44,6 +46,8 @@ namespace IndexUpdateTests { + using boost::scoped_ptr; + static const char* const _ns = "unittests.indexupdate"; /** diff --git a/src/mongo/dbtests/jstests.cpp b/src/mongo/dbtests/jstests.cpp index 06b4c7f23d4..d7cfa36bef6 100644 --- a/src/mongo/dbtests/jstests.cpp +++ b/src/mongo/dbtests/jstests.cpp @@ -33,6 +33,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include <iostream> #include <limits> @@ -46,6 +47,7 @@ #include "mongo/util/log.h" #include "mongo/util/timer.h" +using boost::scoped_ptr; using std::string; namespace JSTests { diff --git a/src/mongo/dbtests/mock/mock_conn_registry.h b/src/mongo/dbtests/mock/mock_conn_registry.h index 85c50b90839..f87196748ab 100644 --- a/src/mongo/dbtests/mock/mock_conn_registry.h +++ b/src/mongo/dbtests/mock/mock_conn_registry.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/base/status.h" #include "mongo/client/dbclientinterface.h" #include "mongo/dbtests/mock/mock_dbclient_connection.h" diff --git a/src/mongo/dbtests/mock/mock_dbclient_cursor.h b/src/mongo/dbtests/mock/mock_dbclient_cursor.h index 80ffea9216c..c8aa3a38bcf 100644 --- a/src/mongo/dbtests/mock/mock_dbclient_cursor.h +++ b/src/mongo/dbtests/mock/mock_dbclient_cursor.h @@ -29,6 +29,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/client/dbclientcursor.h" #include "mongo/client/dbclientmockcursor.h" diff --git a/src/mongo/dbtests/oplogstarttests.cpp b/src/mongo/dbtests/oplogstarttests.cpp index 1a6d397766f..c4da2f33bfb 100644 --- a/src/mongo/dbtests/oplogstarttests.cpp +++ b/src/mongo/dbtests/oplogstarttests.cpp @@ -22,6 +22,8 @@ #include "mongo/dbtests/dbtests.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/db/db.h" #include "mongo/db/dbdirectclient.h" #include "mongo/db/exec/oplogstart.h" @@ -35,6 +37,8 @@ namespace OplogStartTests { + using boost::scoped_ptr; + class Base { public: Base() : _txn(), diff --git a/src/mongo/dbtests/plan_ranking.cpp b/src/mongo/dbtests/plan_ranking.cpp index c10ba98d2dd..e2e998968a7 100644 --- a/src/mongo/dbtests/plan_ranking.cpp +++ b/src/mongo/dbtests/plan_ranking.cpp @@ -30,6 +30,7 @@ * 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" @@ -60,6 +61,8 @@ namespace mongo { namespace PlanRankingTests { + using boost::scoped_ptr; + static const char* ns = "unittests.PlanRankingTests"; class PlanRankingTestBase { diff --git a/src/mongo/dbtests/query_multi_plan_runner.cpp b/src/mongo/dbtests/query_multi_plan_runner.cpp index d8bbd50f8fa..6ff4e66d060 100644 --- a/src/mongo/dbtests/query_multi_plan_runner.cpp +++ b/src/mongo/dbtests/query_multi_plan_runner.cpp @@ -56,6 +56,8 @@ namespace mongo { namespace QueryMultiPlanRunner { + using boost::scoped_ptr; + /** * Create query solution. */ diff --git a/src/mongo/dbtests/query_plan_executor.cpp b/src/mongo/dbtests/query_plan_executor.cpp index 4b55d33262b..be4abf54f4d 100644 --- a/src/mongo/dbtests/query_plan_executor.cpp +++ b/src/mongo/dbtests/query_plan_executor.cpp @@ -26,6 +26,8 @@ * then also delete it in the license file. */ +#include <boost/scoped_ptr.hpp> + #include "mongo/db/clientcursor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" @@ -46,6 +48,8 @@ namespace QueryPlanExecutor { + using boost::scoped_ptr; + class PlanExecutorBase { public: PlanExecutorBase() : _client(&_txn) { diff --git a/src/mongo/dbtests/query_stage_and.cpp b/src/mongo/dbtests/query_stage_and.cpp index c3bb6e7b56b..8a9993e9dc1 100644 --- a/src/mongo/dbtests/query_stage_and.cpp +++ b/src/mongo/dbtests/query_stage_and.cpp @@ -31,6 +31,7 @@ * so we cannot test it outside of a dbtest. */ +#include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include "mongo/client/dbclientcursor.h" @@ -50,6 +51,8 @@ namespace QueryStageAnd { + using boost::scoped_ptr; + class QueryStageAndBase { public: QueryStageAndBase() : _client(&_txn) { diff --git a/src/mongo/dbtests/query_stage_collscan.cpp b/src/mongo/dbtests/query_stage_collscan.cpp index 42bd6931bb5..3e0f8b9aa54 100644 --- a/src/mongo/dbtests/query_stage_collscan.cpp +++ b/src/mongo/dbtests/query_stage_collscan.cpp @@ -30,6 +30,8 @@ * This file tests db/exec/collection_scan.cpp. */ +#include <boost/scoped_ptr.hpp> + #include "mongo/client/dbclientcursor.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" @@ -46,6 +48,8 @@ namespace QueryStageCollectionScan { + using boost::scoped_ptr; + // // Stage-specific tests. // diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp index d8310f42934..dc05d13ce8c 100644 --- a/src/mongo/dbtests/query_stage_count.cpp +++ b/src/mongo/dbtests/query_stage_count.cpp @@ -26,6 +26,7 @@ * it in the license file. */ +#include <boost/scoped_ptr.hpp> #include <memory> #include "mongo/db/exec/collection_scan.h" @@ -41,6 +42,8 @@ namespace QueryStageCount { + using boost::scoped_ptr; + const int kDocuments = 100; const int kInterjections = kDocuments; diff --git a/src/mongo/dbtests/query_stage_delete.cpp b/src/mongo/dbtests/query_stage_delete.cpp index f12ea3e8f1f..49513f6cffc 100644 --- a/src/mongo/dbtests/query_stage_delete.cpp +++ b/src/mongo/dbtests/query_stage_delete.cpp @@ -30,6 +30,8 @@ * This file tests db/exec/delete.cpp. */ +#include <boost/scoped_ptr.hpp> + #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" #include "mongo/db/dbdirectclient.h" @@ -40,6 +42,8 @@ namespace QueryStageDelete { + using boost::scoped_ptr; + // // Stage-specific tests. // diff --git a/src/mongo/dbtests/query_stage_limit_skip.cpp b/src/mongo/dbtests/query_stage_limit_skip.cpp index 994faa3323f..cdb8b3dd935 100644 --- a/src/mongo/dbtests/query_stage_limit_skip.cpp +++ b/src/mongo/dbtests/query_stage_limit_skip.cpp @@ -30,6 +30,8 @@ * 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" #include "mongo/db/exec/mock_stage.h" @@ -43,6 +45,8 @@ using namespace mongo; namespace { + using boost::scoped_ptr; + static const int N = 50; /* Populate a MockStage and return it. Caller owns it. */ diff --git a/src/mongo/dbtests/query_stage_update.cpp b/src/mongo/dbtests/query_stage_update.cpp index ac3472881e9..814a67e4e4f 100644 --- a/src/mongo/dbtests/query_stage_update.cpp +++ b/src/mongo/dbtests/query_stage_update.cpp @@ -30,6 +30,8 @@ * 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" #include "mongo/db/dbdirectclient.h" @@ -48,6 +50,8 @@ namespace QueryStageUpdate { + using boost::scoped_ptr; + class QueryStageUpdateBase { public: QueryStageUpdateBase() diff --git a/src/mongo/dbtests/replica_set_monitor_test.cpp b/src/mongo/dbtests/replica_set_monitor_test.cpp index f77a46856bf..109b21adb47 100644 --- a/src/mongo/dbtests/replica_set_monitor_test.cpp +++ b/src/mongo/dbtests/replica_set_monitor_test.cpp @@ -35,6 +35,7 @@ #include "mongo/dbtests/mock/mock_replica_set.h" #include "mongo/unittest/unittest.h" +#include <boost/scoped_ptr.hpp> #include <set> #include <vector> diff --git a/src/mongo/dbtests/rollbacktests.cpp b/src/mongo/dbtests/rollbacktests.cpp index 2f7645e7ed1..92710eff8ee 100644 --- a/src/mongo/dbtests/rollbacktests.cpp +++ b/src/mongo/dbtests/rollbacktests.cpp @@ -28,6 +28,8 @@ * then also delete it in the license file. */ +#include <boost/scoped_ptr.hpp> + #include "mongo/bson/bsonobj.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database_catalog_entry.h" @@ -39,6 +41,7 @@ #include "mongo/dbtests/dbtests.h" #include "mongo/unittest/unittest.h" +using boost::scoped_ptr; using std::list; using std::string; diff --git a/src/mongo/logger/rotatable_file_appender.h b/src/mongo/logger/rotatable_file_appender.h index 296ada55dc2..777ef4f7fbf 100644 --- a/src/mongo/logger/rotatable_file_appender.h +++ b/src/mongo/logger/rotatable_file_appender.h @@ -27,6 +27,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/logger/appender.h" diff --git a/src/mongo/pch.h b/src/mongo/pch.h index a94d351e5d4..1bd3827dce4 100644 --- a/src/mongo/pch.h +++ b/src/mongo/pch.h @@ -50,7 +50,6 @@ #include <vector> #define BOOST_FILESYSTEM_VERSION 3 -#include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <boost/utility.hpp> @@ -59,7 +58,6 @@ namespace mongo { using namespace std; - using boost::scoped_ptr; using boost::shared_ptr; } diff --git a/src/mongo/s/balance.cpp b/src/mongo/s/balance.cpp index 0ddcbe23168..6e61ecd58d0 100644 --- a/src/mongo/s/balance.cpp +++ b/src/mongo/s/balance.cpp @@ -32,6 +32,8 @@ #include "mongo/s/balance.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/owned_pointer_map.h" #include "mongo/client/dbclientcursor.h" #include "mongo/db/jsobj.h" @@ -59,6 +61,8 @@ namespace mongo { + using boost::scoped_ptr; + MONGO_FP_DECLARE(skipBalanceRound); Balancer balancer; diff --git a/src/mongo/s/balance.h b/src/mongo/s/balance.h index 8220c71074d..df87cb94b19 100644 --- a/src/mongo/s/balance.h +++ b/src/mongo/s/balance.h @@ -35,6 +35,8 @@ #include "mongo/pch.h" #undef MONGO_PCH_WHITELISTED +#include <boost/scoped_ptr.hpp> + #include "mongo/client/dbclientinterface.h" #include "mongo/s/balancer_policy.h" #include "mongo/util/background.h" @@ -77,7 +79,7 @@ namespace mongo { int _balancedLastTime; // decide which chunks to move; owned here. - scoped_ptr<BalancerPolicy> _policy; + boost::scoped_ptr<BalancerPolicy> _policy; /** * Checks that the balancer can connect to all servers it needs to do its job. diff --git a/src/mongo/s/balancer_policy_tests.cpp b/src/mongo/s/balancer_policy_tests.cpp index 5d36fb57e78..3d9a92c417f 100644 --- a/src/mongo/s/balancer_policy_tests.cpp +++ b/src/mongo/s/balancer_policy_tests.cpp @@ -27,6 +27,8 @@ #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kDefault +#include <boost/scoped_ptr.hpp> + #include "mongo/base/owned_pointer_map.h" #include "mongo/platform/random.h" #include "mongo/s/balancer_policy.h" @@ -37,6 +39,8 @@ namespace mongo { + using boost::scoped_ptr; + namespace { typedef OwnedPointerMap<string, OwnedPointerVector<ChunkType> > OwnedShardToChunksMap; diff --git a/src/mongo/s/chunk_manager_targeter.h b/src/mongo/s/chunk_manager_targeter.h index cf3c6e3fa38..75fb8500d4b 100644 --- a/src/mongo/s/chunk_manager_targeter.h +++ b/src/mongo/s/chunk_manager_targeter.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <map> #include "mongo/bson/bsonobj.h" diff --git a/src/mongo/s/cluster_client_internal.cpp b/src/mongo/s/cluster_client_internal.cpp index 69264e55b9c..5a9b7c2a0e6 100644 --- a/src/mongo/s/cluster_client_internal.cpp +++ b/src/mongo/s/cluster_client_internal.cpp @@ -32,6 +32,7 @@ #include "mongo/s/cluster_client_internal.h" +#include <boost/scoped_ptr.hpp> #include <string> #include <vector> @@ -47,6 +48,7 @@ namespace mongo { + using boost::scoped_ptr; using std::string; using std::vector; using mongoutils::str::stream; diff --git a/src/mongo/s/cluster_write.h b/src/mongo/s/cluster_write.h index 9bb15bcdc5c..a4144fff252 100644 --- a/src/mongo/s/cluster_write.h +++ b/src/mongo/s/cluster_write.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/s/write_ops/batch_write_exec.h" #include "mongo/s/write_ops/batched_command_request.h" #include "mongo/s/write_ops/batched_command_response.h" @@ -58,7 +60,7 @@ namespace mongo { bool _autoSplit; int _timeoutMillis; - scoped_ptr<ClusterWriterStats> _stats; + boost::scoped_ptr<ClusterWriterStats> _stats; }; class ClusterWriterStats { @@ -75,7 +77,7 @@ namespace mongo { private: - scoped_ptr<BatchWriteExecStats> _shardStats; + boost::scoped_ptr<BatchWriteExecStats> _shardStats; }; /** diff --git a/src/mongo/s/commands_admin.cpp b/src/mongo/s/commands_admin.cpp index 7e9ee96cffd..566ea634e82 100644 --- a/src/mongo/s/commands_admin.cpp +++ b/src/mongo/s/commands_admin.cpp @@ -32,6 +32,8 @@ #include "mongo/db/commands.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/client/connpool.h" #include "mongo/client/dbclientcursor.h" #include "mongo/client/replica_set_monitor.h" @@ -79,6 +81,8 @@ namespace mongo { + using boost::scoped_ptr; + namespace dbgrid_cmds { class GridAdminCmd : public Command { diff --git a/src/mongo/s/commands_public.cpp b/src/mongo/s/commands_public.cpp index 122d75f5992..086326b4517 100644 --- a/src/mongo/s/commands_public.cpp +++ b/src/mongo/s/commands_public.cpp @@ -32,6 +32,8 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/init.h" #include "mongo/client/connpool.h" #include "mongo/client/parallel.h" @@ -71,6 +73,7 @@ namespace mongo { using boost::intrusive_ptr; + using boost::scoped_ptr; namespace dbgrid_pub_cmds { diff --git a/src/mongo/s/config.cpp b/src/mongo/s/config.cpp index 8690529a829..bf37bf9244c 100644 --- a/src/mongo/s/config.cpp +++ b/src/mongo/s/config.cpp @@ -32,6 +32,7 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> #include "pcrecpp.h" #include "mongo/client/connpool.h" @@ -60,6 +61,8 @@ namespace mongo { + using boost::scoped_ptr; + int ConfigServer::VERSION = 3; Shard Shard::EMPTY; diff --git a/src/mongo/s/config_upgrade.cpp b/src/mongo/s/config_upgrade.cpp index bc5e2812a07..ff79ce482e2 100644 --- a/src/mongo/s/config_upgrade.cpp +++ b/src/mongo/s/config_upgrade.cpp @@ -30,6 +30,8 @@ #include "mongo/s/config_upgrade.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/init.h" #include "mongo/client/dbclientcursor.h" #include "mongo/s/cluster_client_internal.h" @@ -46,6 +48,7 @@ namespace mongo { + using boost::scoped_ptr; using mongoutils::str::stream; // diff --git a/src/mongo/s/config_upgrade_helpers.cpp b/src/mongo/s/config_upgrade_helpers.cpp index b013ca6eeea..b678052c7b1 100644 --- a/src/mongo/s/config_upgrade_helpers.cpp +++ b/src/mongo/s/config_upgrade_helpers.cpp @@ -30,6 +30,8 @@ #include "mongo/s/config_upgrade_helpers.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/client/connpool.h" #include "mongo/db/field_parser.h" #include "mongo/db/namespace_string.h" @@ -42,6 +44,7 @@ namespace mongo { + using boost::scoped_ptr; using mongoutils::str::stream; // Custom field used in upgrade state to determine if/where we failed on last upgrade diff --git a/src/mongo/s/cursors.cpp b/src/mongo/s/cursors.cpp index 21ddc58568e..70504b700eb 100644 --- a/src/mongo/s/cursors.cpp +++ b/src/mongo/s/cursors.cpp @@ -33,6 +33,7 @@ #include "mongo/s/cursors.h" +#include <boost/scoped_ptr.hpp> #include <string> #include <vector> @@ -53,6 +54,8 @@ namespace mongo { + using boost::scoped_ptr; + const int ShardedClientCursor::INIT_REPLY_BUFFER_SIZE = 32768; // -------- ShardedCursor ----------- diff --git a/src/mongo/s/d_migrate.cpp b/src/mongo/s/d_migrate.cpp index c25b0f44ca2..0821c824c40 100644 --- a/src/mongo/s/d_migrate.cpp +++ b/src/mongo/s/d_migrate.cpp @@ -39,6 +39,7 @@ #include "mongo/platform/basic.h" #include <algorithm> +#include <boost/scoped_ptr.hpp> #include <boost/thread/thread.hpp> #include <map> #include <string> @@ -93,6 +94,7 @@ using namespace std; namespace { + using boost::scoped_ptr; using mongo::WriteConcernOptions; using mongo::repl::ReplicationCoordinator; diff --git a/src/mongo/s/dbclient_multi_command.cpp b/src/mongo/s/dbclient_multi_command.cpp index 82496b3f9bd..286789e2c0d 100644 --- a/src/mongo/s/dbclient_multi_command.cpp +++ b/src/mongo/s/dbclient_multi_command.cpp @@ -28,6 +28,8 @@ #include "mongo/s/dbclient_multi_command.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/bson/mutable/document.h" #include "mongo/db/audit.h" #include "mongo/db/client_basic.h" @@ -40,6 +42,8 @@ namespace mongo { + using boost::scoped_ptr; + DBClientMultiCommand::PendingCommand::PendingCommand( const ConnectionString& endpoint, const StringData& dbName, const BSONObj& cmdObj ) : diff --git a/src/mongo/s/distlock.cpp b/src/mongo/s/distlock.cpp index 49be1c1591a..0fcb83de97c 100644 --- a/src/mongo/s/distlock.cpp +++ b/src/mongo/s/distlock.cpp @@ -31,6 +31,7 @@ #include "mongo/s/distlock.h" +#include <boost/scoped_ptr.hpp> #include <boost/thread/thread.hpp> #include "mongo/db/server_options.h" @@ -44,6 +45,8 @@ namespace mongo { + using boost::scoped_ptr; + LabeledLevel DistributedLock::logLvl( 1 ); DistributedLock::LastPings DistributedLock::lastPings; diff --git a/src/mongo/s/metadata_loader_test.cpp b/src/mongo/s/metadata_loader_test.cpp index d4be8a16620..4a0b8efd09b 100644 --- a/src/mongo/s/metadata_loader_test.cpp +++ b/src/mongo/s/metadata_loader_test.cpp @@ -27,7 +27,6 @@ */ #include <boost/scoped_ptr.hpp> - #include <vector> #include "mongo/base/status.h" diff --git a/src/mongo/s/multi_host_query_test.cpp b/src/mongo/s/multi_host_query_test.cpp index 3b7cc7431e6..22f53867150 100644 --- a/src/mongo/s/multi_host_query_test.cpp +++ b/src/mongo/s/multi_host_query_test.cpp @@ -28,12 +28,15 @@ #include "mongo/s/multi_host_query.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/unittest/unittest.h" #include "mongo/util/concurrency/synchronization.h" namespace { using namespace mongo; + using boost::scoped_ptr; using boost::shared_ptr; using std::map; diff --git a/src/mongo/s/request.h b/src/mongo/s/request.h index f010b9db275..2e85582dadd 100644 --- a/src/mongo/s/request.h +++ b/src/mongo/s/request.h @@ -35,6 +35,8 @@ #include "mongo/pch.h" #undef MONGO_PCH_WHITELISTED +#include <boost/scoped_ptr.hpp> + #include "mongo/db/dbmessage.h" #include "mongo/s/config.h" #include "mongo/util/net/message.h" diff --git a/src/mongo/s/shard_key_pattern.cpp b/src/mongo/s/shard_key_pattern.cpp index 35404e9ea0d..3f753a0e3ba 100644 --- a/src/mongo/s/shard_key_pattern.cpp +++ b/src/mongo/s/shard_key_pattern.cpp @@ -28,6 +28,7 @@ #include "mongo/s/shard_key_pattern.h" +#include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <vector> @@ -41,6 +42,7 @@ namespace mongo { + using boost::scoped_ptr; using boost::shared_ptr; using std::auto_ptr; using std::pair; diff --git a/src/mongo/s/strategy.cpp b/src/mongo/s/strategy.cpp index fb03e115f6f..9d2af5515f1 100644 --- a/src/mongo/s/strategy.cpp +++ b/src/mongo/s/strategy.cpp @@ -32,6 +32,8 @@ #include "mongo/platform/basic.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/status.h" #include "mongo/base/owned_pointer_vector.h" #include "mongo/bson/util/builder.h" @@ -69,6 +71,8 @@ namespace mongo { + using boost::scoped_ptr; + static bool _isSystemIndexes( const char* ns ) { return nsToCollectionSubstring(ns) == "system.indexes"; } diff --git a/src/mongo/s/write_ops/batch_upconvert.cpp b/src/mongo/s/write_ops/batch_upconvert.cpp index 01eb475e82e..abe12d9d7af 100644 --- a/src/mongo/s/write_ops/batch_upconvert.cpp +++ b/src/mongo/s/write_ops/batch_upconvert.cpp @@ -28,6 +28,8 @@ #include "mongo/s/write_ops/batch_upconvert.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/bson/bsonobj.h" #include "mongo/db/dbmessage.h" #include "mongo/db/namespace_string.h" @@ -40,6 +42,7 @@ namespace mongo { + using boost::scoped_ptr; using mongoutils::str::stream; using std::vector; diff --git a/src/mongo/s/write_ops/batch_write_exec_test.cpp b/src/mongo/s/write_ops/batch_write_exec_test.cpp index 470e31922d9..b0e069fd796 100644 --- a/src/mongo/s/write_ops/batch_write_exec_test.cpp +++ b/src/mongo/s/write_ops/batch_write_exec_test.cpp @@ -28,6 +28,8 @@ #include "mongo/s/write_ops/batch_write_exec.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/owned_pointer_vector.h" #include "mongo/s/mock_multi_write_command.h" #include "mongo/s/mock_ns_targeter.h" @@ -38,6 +40,7 @@ namespace { + using boost::scoped_ptr; using namespace mongo; /** diff --git a/src/mongo/s/write_ops/batch_write_op.h b/src/mongo/s/write_ops/batch_write_op.h index a2e601b97d1..0638cc43cb0 100644 --- a/src/mongo/s/write_ops/batch_write_op.h +++ b/src/mongo/s/write_ops/batch_write_op.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <set> #include <vector> @@ -179,7 +180,7 @@ namespace mongo { OwnedPointerVector<BatchedUpsertDetail> _upsertedIds; // Stats for the entire batch op - scoped_ptr<BatchWriteStats> _stats; + boost::scoped_ptr<BatchWriteStats> _stats; }; struct BatchWriteStats { diff --git a/src/mongo/s/write_ops/batched_command_request.h b/src/mongo/s/write_ops/batched_command_request.h index b0af8d24a7c..4b51f406ee3 100644 --- a/src/mongo/s/write_ops/batched_command_request.h +++ b/src/mongo/s/write_ops/batched_command_request.h @@ -28,6 +28,8 @@ #pragma once +#include <boost/scoped_ptr.hpp> + #include "mongo/base/disallow_copying.h" #include "mongo/s/bson_serializable.h" #include "mongo/s/write_ops/batched_insert_request.h" @@ -180,9 +182,9 @@ namespace mongo { private: BatchType _batchType; - scoped_ptr<BatchedInsertRequest> _insertReq; - scoped_ptr<BatchedUpdateRequest> _updateReq; - scoped_ptr<BatchedDeleteRequest> _deleteReq; + boost::scoped_ptr<BatchedInsertRequest> _insertReq; + boost::scoped_ptr<BatchedUpdateRequest> _updateReq; + boost::scoped_ptr<BatchedDeleteRequest> _deleteReq; }; /** diff --git a/src/mongo/s/write_ops/batched_delete_request.h b/src/mongo/s/write_ops/batched_delete_request.h index c823b13c065..8389d5b0f27 100644 --- a/src/mongo/s/write_ops/batched_delete_request.h +++ b/src/mongo/s/write_ops/batched_delete_request.h @@ -145,7 +145,7 @@ namespace mongo { bool _isOrderedSet; // (O) metadata associated with this request for internal use. - scoped_ptr<BatchedRequestMetadata> _metadata; + boost::scoped_ptr<BatchedRequestMetadata> _metadata; }; } // namespace mongo diff --git a/src/mongo/s/write_ops/batched_insert_request.h b/src/mongo/s/write_ops/batched_insert_request.h index 8e6be3240aa..151ab1bd4b0 100644 --- a/src/mongo/s/write_ops/batched_insert_request.h +++ b/src/mongo/s/write_ops/batched_insert_request.h @@ -139,7 +139,7 @@ namespace mongo { bool _isOrderedSet; // (O) metadata associated with this request for internal use. - scoped_ptr<BatchedRequestMetadata> _metadata; + boost::scoped_ptr<BatchedRequestMetadata> _metadata; // (O) cached copied of target ns NamespaceString _targetNSS; diff --git a/src/mongo/s/write_ops/batched_request_metadata.h b/src/mongo/s/write_ops/batched_request_metadata.h index 0a7c1eff3e3..648a0dcc4a5 100644 --- a/src/mongo/s/write_ops/batched_request_metadata.h +++ b/src/mongo/s/write_ops/batched_request_metadata.h @@ -28,6 +28,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <string> #include "mongo/bson/bson_field.h" diff --git a/src/mongo/s/write_ops/batched_update_request.h b/src/mongo/s/write_ops/batched_update_request.h index 8282cd92ad8..f092c18a09b 100644 --- a/src/mongo/s/write_ops/batched_update_request.h +++ b/src/mongo/s/write_ops/batched_update_request.h @@ -145,7 +145,7 @@ namespace mongo { bool _isOrderedSet; // (O) metadata associated with this request for internal use. - scoped_ptr<BatchedRequestMetadata> _metadata; + boost::scoped_ptr<BatchedRequestMetadata> _metadata; }; } // namespace mongo diff --git a/src/mongo/s/write_ops/write_op.h b/src/mongo/s/write_ops/write_op.h index 9fd05ffc44a..b54ec1718c3 100644 --- a/src/mongo/s/write_ops/write_op.h +++ b/src/mongo/s/write_ops/write_op.h @@ -183,7 +183,7 @@ namespace mongo { std::vector<ChildWriteOp*> _childOps; // filled when state == _Error - scoped_ptr<WriteErrorDetail> _error; + boost::scoped_ptr<WriteErrorDetail> _error; // Finished child operations, for debugging std::vector<ChildWriteOp*> _history; @@ -210,10 +210,10 @@ namespace mongo { TargetedWrite* pendingWrite; // filled when state > _Pending - scoped_ptr<ShardEndpoint> endpoint; + boost::scoped_ptr<ShardEndpoint> endpoint; // filled when state == _Error or (optionally) when state == _Cancelled - scoped_ptr<WriteErrorDetail> error; + boost::scoped_ptr<WriteErrorDetail> error; }; // First value is write item index in the batch, second value is child write op index diff --git a/src/mongo/s/write_ops/write_op_test.cpp b/src/mongo/s/write_ops/write_op_test.cpp index c7712f5774b..5559b49d3ec 100644 --- a/src/mongo/s/write_ops/write_op_test.cpp +++ b/src/mongo/s/write_ops/write_op_test.cpp @@ -28,6 +28,8 @@ #include "mongo/s/write_ops/write_op.h" +#include <boost/scoped_ptr.hpp> + #include "mongo/base/error_codes.h" #include "mongo/base/owned_pointer_vector.h" #include "mongo/s/mock_ns_targeter.h" @@ -38,6 +40,7 @@ namespace { + using boost::scoped_ptr; using namespace mongo; WriteErrorDetail* buildError( int code, const BSONObj& info, const string& message ) { diff --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp index 4d4be1407a2..5c42ba9cfd5 100644 --- a/src/mongo/scripting/engine.cpp +++ b/src/mongo/scripting/engine.cpp @@ -36,6 +36,7 @@ #include <cctype> #include <boost/filesystem/operations.hpp> #include <boost/scoped_array.hpp> +#include <boost/scoped_ptr.hpp> #include "mongo/client/dbclientcursor.h" #include "mongo/client/dbclientinterface.h" @@ -46,6 +47,9 @@ #include "mongo/util/text.h" namespace mongo { + + using boost::scoped_ptr; + long long Scope::_lastVersion = 1; namespace { diff --git a/src/mongo/scripting/engine_v8-3.25.h b/src/mongo/scripting/engine_v8-3.25.h index c15a044051f..c78d8b97b35 100644 --- a/src/mongo/scripting/engine_v8-3.25.h +++ b/src/mongo/scripting/engine_v8-3.25.h @@ -29,6 +29,7 @@ #pragma once +#include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <v8.h> #include <vector> diff --git a/src/mongo/scripting/v8-3.25_utils.cpp b/src/mongo/scripting/v8-3.25_utils.cpp index 3bb4efb7a3a..9a5ed27b5bf 100644 --- a/src/mongo/scripting/v8-3.25_utils.cpp +++ b/src/mongo/scripting/v8-3.25_utils.cpp @@ -32,6 +32,7 @@ #include "mongo/scripting/v8-3.25_utils.h" #include <boost/make_shared.hpp> +#include <boost/scoped_ptr.hpp> #include <boost/thread/condition_variable.hpp> #include <boost/thread/mutex.hpp> #include <boost/thread/thread.hpp> @@ -48,6 +49,7 @@ #include "mongo/util/mongoutils/str.h" using namespace std; +using boost::scoped_ptr; namespace mongo { diff --git a/src/mongo/scripting/v8_utils.cpp b/src/mongo/scripting/v8_utils.cpp index 1d7bb359a7e..4a3dbc9c8f7 100644 --- a/src/mongo/scripting/v8_utils.cpp +++ b/src/mongo/scripting/v8_utils.cpp @@ -32,6 +32,7 @@ #include "mongo/scripting/v8_utils.h" #include <boost/make_shared.hpp> +#include <boost/scoped_ptr.hpp> #include <boost/thread/condition_variable.hpp> #include <boost/thread/mutex.hpp> #include <boost/thread/thread.hpp> @@ -48,6 +49,7 @@ #include "mongo/util/mongoutils/str.h" using namespace std; +using boost::scoped_ptr; namespace mongo { diff --git a/src/mongo/shell/bench.h b/src/mongo/shell/bench.h index 3bdcfbed6eb..4f2490617fe 100644 --- a/src/mongo/shell/bench.h +++ b/src/mongo/shell/bench.h @@ -30,6 +30,7 @@ #include <string> +#include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <boost/thread/condition.hpp> #include <boost/thread/mutex.hpp> diff --git a/src/mongo/util/fail_point_service.cpp b/src/mongo/util/fail_point_service.cpp index 612640b49b3..43cf5c44d9b 100644 --- a/src/mongo/util/fail_point_service.cpp +++ b/src/mongo/util/fail_point_service.cpp @@ -28,7 +28,12 @@ #include "mongo/util/fail_point_service.h" +#include <boost/scoped_ptr.hpp> + namespace mongo { + + using boost::scoped_ptr; + MONGO_FP_DECLARE(dummy); // used by jstests/libs/fail_point.js scoped_ptr<FailPointRegistry> _fpRegistry(NULL); diff --git a/src/mongo/util/net/message_server_port.cpp b/src/mongo/util/net/message_server_port.cpp index 038394dda90..4fc0f96016a 100644 --- a/src/mongo/util/net/message_server_port.cpp +++ b/src/mongo/util/net/message_server_port.cpp @@ -34,6 +34,7 @@ #include "mongo/pch.h" #undef MONGO_PCH_WHITELISTED +#include <boost/scoped_ptr.hpp> #include <boost/thread/thread.hpp> #ifndef USE_ASIO @@ -63,6 +64,8 @@ namespace mongo { + using boost::scoped_ptr; + class PortMessageServer : public MessageServer , public Listener { public: /** |