diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2019-03-27 12:21:37 -0400 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2019-03-28 10:13:21 -0400 |
commit | f922827d45ce752e148185dfa3a785f7c9cf29fd (patch) | |
tree | b3ae7fdba18d9ef3384af6e0d009d091e5df14a3 | |
parent | f2f422d92b639edba0a10d40a43803723cb15baf (diff) | |
download | mongo-f922827d45ce752e148185dfa3a785f7c9cf29fd.tar.gz |
SERVER-40357 expand all calls to MONGO_DISALLOW_COPYING
produced by:
hits="$(git grep -n MONGO_DISALLOW_COPYING | cut -d: -f1 )"
for f in "$hits"; do
sed -i.orig '
s/^\( *\)MONGO_DISALLOW_COPYING(\(.*\));/\1\2(const \2\&) = delete;\n\1\2\& operator=(const \2\&) = delete;/;
' $f
done
426 files changed, 985 insertions, 828 deletions
diff --git a/src/mongo/base/deinitializer_context.h b/src/mongo/base/deinitializer_context.h index 61cba020f80..370b5c5526d 100644 --- a/src/mongo/base/deinitializer_context.h +++ b/src/mongo/base/deinitializer_context.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/service_context_fwd.h" #include <map> diff --git a/src/mongo/base/disallow_copying.h b/src/mongo/base/disallow_copying.h deleted file mode 100644 index 4d7d0177c22..00000000000 --- a/src/mongo/base/disallow_copying.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2018-present MongoDB, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * <http://www.mongodb.com/licensing/server-side-public-license>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the Server Side Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#pragma once - -/** - * Instruct the compiler not to create default copy constructor and assignment operator - * for class "CLASS". Must be the _first_ or _last_ line of the class declaration. Prefer - * to use it as the first line. - * - * If you use this macro and wish to make the class movable, you must define the move assignment - * operator and move constructor. - * - * Usage: - * class Foo { - * MONGO_DISALLOW_COPYING(Foo); - * public: - * ... - * }; - */ -#define MONGO_DISALLOW_COPYING(CLASS) \ - CLASS(const CLASS&) = delete; \ - CLASS& operator=(const CLASS&) = delete diff --git a/src/mongo/base/global_initializer_registerer.h b/src/mongo/base/global_initializer_registerer.h index 78ffd4c8455..088e6caf3a8 100644 --- a/src/mongo/base/global_initializer_registerer.h +++ b/src/mongo/base/global_initializer_registerer.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/initializer_function.h" #include "mongo/base/status.h" @@ -53,7 +52,8 @@ namespace mongo { * mongo/base/init.h and mongo/base/initializer_dependency_graph.h for details. */ class GlobalInitializerRegisterer { - MONGO_DISALLOW_COPYING(GlobalInitializerRegisterer); + GlobalInitializerRegisterer(const GlobalInitializerRegisterer&) = delete; + GlobalInitializerRegisterer& operator=(const GlobalInitializerRegisterer&) = delete; public: /** diff --git a/src/mongo/base/initializer.h b/src/mongo/base/initializer.h index 2474c65861c..eff1500387c 100644 --- a/src/mongo/base/initializer.h +++ b/src/mongo/base/initializer.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/initializer_context.h" #include "mongo/base/initializer_dependency_graph.h" #include "mongo/base/status.h" @@ -48,7 +47,8 @@ namespace mongo { * execute in an order that respects the programmer-established prerequistes. */ class Initializer { - MONGO_DISALLOW_COPYING(Initializer); + Initializer(const Initializer&) = delete; + Initializer& operator=(const Initializer&) = delete; public: Initializer(); diff --git a/src/mongo/base/initializer_context.h b/src/mongo/base/initializer_context.h index b087b34a649..12a6fd23f3a 100644 --- a/src/mongo/base/initializer_context.h +++ b/src/mongo/base/initializer_context.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/service_context_fwd.h" #include <map> @@ -43,7 +42,8 @@ namespace mongo { * See mongo/base/initializer.h and mongo/base/initializer_dependency_graph.h for more details. */ class InitializerContext { - MONGO_DISALLOW_COPYING(InitializerContext); + InitializerContext(const InitializerContext&) = delete; + InitializerContext& operator=(const InitializerContext&) = delete; public: typedef std::vector<std::string> ArgumentVector; diff --git a/src/mongo/base/initializer_dependency_graph.h b/src/mongo/base/initializer_dependency_graph.h index f65d3db8629..019ce28b9f3 100644 --- a/src/mongo/base/initializer_dependency_graph.h +++ b/src/mongo/base/initializer_dependency_graph.h @@ -33,7 +33,6 @@ #include <utility> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/initializer_function.h" #include "mongo/base/status.h" #include "mongo/stdx/unordered_map.h" @@ -84,7 +83,8 @@ private: * thread is executing those functions or addInitializer on the same instance. */ class InitializerDependencyGraph { - MONGO_DISALLOW_COPYING(InitializerDependencyGraph); + InitializerDependencyGraph(const InitializerDependencyGraph&) = delete; + InitializerDependencyGraph& operator=(const InitializerDependencyGraph&) = delete; public: InitializerDependencyGraph(); diff --git a/src/mongo/base/owned_pointer_map.h b/src/mongo/base/owned_pointer_map.h index 1a1fab5d34e..e64e2478909 100644 --- a/src/mongo/base/owned_pointer_map.h +++ b/src/mongo/base/owned_pointer_map.h @@ -31,7 +31,6 @@ #include <map> -#include "mongo/base/disallow_copying.h" namespace mongo { @@ -42,7 +41,8 @@ namespace mongo { */ template <class K, class T, class Compare = std::less<K>> class OwnedPointerMap { - MONGO_DISALLOW_COPYING(OwnedPointerMap); + OwnedPointerMap(const OwnedPointerMap&) = delete; + OwnedPointerMap& operator=(const OwnedPointerMap&) = delete; public: typedef typename std::map<K, T*, Compare> MapType; diff --git a/src/mongo/base/owned_pointer_vector.h b/src/mongo/base/owned_pointer_vector.h index fb207752f2e..199e172e4c3 100644 --- a/src/mongo/base/owned_pointer_vector.h +++ b/src/mongo/base/owned_pointer_vector.h @@ -32,7 +32,6 @@ #include <cstring> #include <vector> -#include "mongo/base/disallow_copying.h" namespace mongo { @@ -43,7 +42,8 @@ namespace mongo { */ template <class T> class OwnedPointerVector { - MONGO_DISALLOW_COPYING(OwnedPointerVector); + OwnedPointerVector(const OwnedPointerVector&) = delete; + OwnedPointerVector& operator=(const OwnedPointerVector&) = delete; public: OwnedPointerVector() {} diff --git a/src/mongo/base/secure_allocator.cpp b/src/mongo/base/secure_allocator.cpp index 1ccb816bc94..67aae3fbb1b 100644 --- a/src/mongo/base/secure_allocator.cpp +++ b/src/mongo/base/secure_allocator.cpp @@ -43,7 +43,6 @@ #include <sys/types.h> #endif -#include "mongo/base/disallow_copying.h" #include "mongo/base/init.h" #include "mongo/stdx/memory.h" #include "mongo/stdx/mutex.h" @@ -290,7 +289,8 @@ void systemDeallocate(void* ptr, std::size_t bytes) { * page size and allocate returns aligned pointers. */ class Allocation { - MONGO_DISALLOW_COPYING(Allocation); + Allocation(const Allocation&) = delete; + Allocation& operator=(const Allocation&) = delete; public: explicit Allocation(std::size_t initialAllocation) { diff --git a/src/mongo/base/string_data_comparator_interface.h b/src/mongo/base/string_data_comparator_interface.h index 1509f2b7488..1a3b1a68d60 100644 --- a/src/mongo/base/string_data_comparator_interface.h +++ b/src/mongo/base/string_data_comparator_interface.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/unordered_map.h" #include "mongo/stdx/unordered_set.h" #include "string_data.h" @@ -40,7 +39,8 @@ namespace mongo { * A StringData::ComparatorInterface is an abstract class for comparing StringData objects. */ class StringData::ComparatorInterface { - MONGO_DISALLOW_COPYING(ComparatorInterface); + ComparatorInterface(const ComparatorInterface&) = delete; + ComparatorInterface& operator=(const ComparatorInterface&) = delete; public: /** diff --git a/src/mongo/bson/bson_comparator_interface_base.h b/src/mongo/bson/bson_comparator_interface_base.h index f9f11e290e9..973c84ffb5c 100644 --- a/src/mongo/bson/bson_comparator_interface_base.h +++ b/src/mongo/bson/bson_comparator_interface_base.h @@ -35,7 +35,6 @@ #include <set> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data_comparator_interface.h" #include "mongo/stdx/unordered_map.h" #include "mongo/stdx/unordered_set.h" @@ -51,7 +50,8 @@ class BSONObj; */ template <typename T> class BSONComparatorInterfaceBase { - MONGO_DISALLOW_COPYING(BSONComparatorInterfaceBase); + BSONComparatorInterfaceBase(const BSONComparatorInterfaceBase&) = delete; + BSONComparatorInterfaceBase& operator=(const BSONComparatorInterfaceBase&) = delete; public: BSONComparatorInterfaceBase(BSONComparatorInterfaceBase&& other) = default; diff --git a/src/mongo/bson/bsonmisc.h b/src/mongo/bson/bsonmisc.h index db047dd8d2d..6baec67d7a6 100644 --- a/src/mongo/bson/bsonmisc.h +++ b/src/mongo/bson/bsonmisc.h @@ -188,7 +188,8 @@ extern Labeler::Label BSIZE; // Utility class to implement BSON( key << val ) as described above. class BSONObjBuilderValueStream { - MONGO_DISALLOW_COPYING(BSONObjBuilderValueStream); + BSONObjBuilderValueStream(const BSONObjBuilderValueStream&) = delete; + BSONObjBuilderValueStream& operator=(const BSONObjBuilderValueStream&) = delete; public: friend class Labeler; diff --git a/src/mongo/bson/bsonobj.h b/src/mongo/bson/bsonobj.h index 2bbe2e2d05b..336d84eb022 100644 --- a/src/mongo/bson/bsonobj.h +++ b/src/mongo/bson/bsonobj.h @@ -37,7 +37,6 @@ #include <vector> #include "mongo/base/data_type.h" -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/base/string_data_comparator_interface.h" #include "mongo/bson/bson_comparator_interface_base.h" @@ -754,7 +753,8 @@ private: /** Base class implementing ordered iteration through BSONElements. */ class BSONIteratorSorted { - MONGO_DISALLOW_COPYING(BSONIteratorSorted); + BSONIteratorSorted(const BSONIteratorSorted&) = delete; + BSONIteratorSorted& operator=(const BSONIteratorSorted&) = delete; public: ~BSONIteratorSorted() { diff --git a/src/mongo/bson/bsonobjbuilder.h b/src/mongo/bson/bsonobjbuilder.h index 9be6eab6987..c33021d6928 100644 --- a/src/mongo/bson/bsonobjbuilder.h +++ b/src/mongo/bson/bsonobjbuilder.h @@ -62,7 +62,8 @@ namespace mongo { See also the BSON() and BSON_ARRAY() macros. */ class BSONObjBuilder { - MONGO_DISALLOW_COPYING(BSONObjBuilder); + BSONObjBuilder(const BSONObjBuilder&) = delete; + BSONObjBuilder& operator=(const BSONObjBuilder&) = delete; public: /** @param initsize this is just a hint as to the final size of the object */ diff --git a/src/mongo/bson/mutable/document.cpp b/src/mongo/bson/mutable/document.cpp index aae9eddbe8b..1ef7ef07ecc 100644 --- a/src/mongo/bson/mutable/document.cpp +++ b/src/mongo/bson/mutable/document.cpp @@ -591,7 +591,8 @@ const bool paranoid = false; * Document. */ class Document::Impl { - MONGO_DISALLOW_COPYING(Impl); + Impl(const Impl&) = delete; + Impl& operator=(const Impl&) = delete; public: Impl(Document::InPlaceMode inPlaceMode) diff --git a/src/mongo/bson/mutable/document.h b/src/mongo/bson/mutable/document.h index 0828674b053..0098a6f06d9 100644 --- a/src/mongo/bson/mutable/document.h +++ b/src/mongo/bson/mutable/document.h @@ -31,7 +31,6 @@ #include <cstdint> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/mutable/const_element.h" #include "mongo/bson/mutable/damage_vector.h" @@ -234,7 +233,8 @@ namespace mutablebson { class Document { // TODO: In principle there is nothing that prevents implementing a deep copy for // Document, but for now it is not permitted. - MONGO_DISALLOW_COPYING(Document); + Document(const Document&) = delete; + Document& operator=(const Document&) = delete; public: // diff --git a/src/mongo/bson/util/builder.h b/src/mongo/bson/util/builder.h index b17b6d4752e..5a85a5fd219 100644 --- a/src/mongo/bson/util/builder.h +++ b/src/mongo/bson/util/builder.h @@ -41,7 +41,6 @@ #include "mongo/base/data_type_endian.h" #include "mongo/base/data_view.h" -#include "mongo/base/disallow_copying.h" #include "mongo/base/static_assert.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsontypes.h" @@ -76,7 +75,8 @@ template <typename Allocator> class StringBuilderImpl; class SharedBufferAllocator { - MONGO_DISALLOW_COPYING(SharedBufferAllocator); + SharedBufferAllocator(const SharedBufferAllocator&) = delete; + SharedBufferAllocator& operator=(const SharedBufferAllocator&) = delete; public: SharedBufferAllocator() = default; @@ -111,7 +111,8 @@ private: }; class StackAllocator { - MONGO_DISALLOW_COPYING(StackAllocator); + StackAllocator(const StackAllocator&) = delete; + StackAllocator& operator=(const StackAllocator&) = delete; public: StackAllocator() = default; diff --git a/src/mongo/client/connection_pool.h b/src/mongo/client/connection_pool.h index a6d25493644..5d72f5c25e1 100644 --- a/src/mongo/client/connection_pool.h +++ b/src/mongo/client/connection_pool.h @@ -31,7 +31,6 @@ #include <map> -#include "mongo/base/disallow_copying.h" #include "mongo/client/dbclient_connection.h" #include "mongo/stdx/list.h" #include "mongo/stdx/mutex.h" @@ -50,7 +49,8 @@ class NetworkConnectionHook; * it should only be used from one thread in accordance with the rules of DBClientBase. */ class ConnectionPool { - MONGO_DISALLOW_COPYING(ConnectionPool); + ConnectionPool(const ConnectionPool&) = delete; + ConnectionPool& operator=(const ConnectionPool&) = delete; public: /** @@ -79,7 +79,8 @@ public: * when the holder goes out of scope. */ class ConnectionPtr { - MONGO_DISALLOW_COPYING(ConnectionPtr); + ConnectionPtr(const ConnectionPtr&) = delete; + ConnectionPtr& operator=(const ConnectionPtr&) = delete; public: /** diff --git a/src/mongo/client/connpool.h b/src/mongo/client/connpool.h index cc69fb759ca..8073e5c3aef 100644 --- a/src/mongo/client/connpool.h +++ b/src/mongo/client/connpool.h @@ -69,7 +69,8 @@ struct ConnectionPoolStats; * PoolForHost is not thread-safe; thread safety is handled by DBConnectionPool. */ class PoolForHost { - MONGO_DISALLOW_COPYING(PoolForHost); + PoolForHost(const PoolForHost&) = delete; + PoolForHost& operator=(const PoolForHost&) = delete; public: // Sentinel value indicating pool has no cleanup limit @@ -411,7 +412,8 @@ private: }; class AScopedConnection { - MONGO_DISALLOW_COPYING(AScopedConnection); + AScopedConnection(const AScopedConnection&) = delete; + AScopedConnection& operator=(const AScopedConnection&) = delete; public: AScopedConnection() { diff --git a/src/mongo/client/cyrus_sasl_client_session.h b/src/mongo/client/cyrus_sasl_client_session.h index 60695236718..f5ba4dce5cd 100644 --- a/src/mongo/client/cyrus_sasl_client_session.h +++ b/src/mongo/client/cyrus_sasl_client_session.h @@ -39,7 +39,8 @@ namespace mongo { * using the Cyrus SASL library. */ class CyrusSaslClientSession : public SaslClientSession { - MONGO_DISALLOW_COPYING(CyrusSaslClientSession); + CyrusSaslClientSession(const CyrusSaslClientSession&) = delete; + CyrusSaslClientSession& operator=(const CyrusSaslClientSession&) = delete; public: CyrusSaslClientSession(); diff --git a/src/mongo/client/dbclient_base.cpp b/src/mongo/client/dbclient_base.cpp index 5ce7d923765..befee2a0350 100644 --- a/src/mongo/client/dbclient_base.cpp +++ b/src/mongo/client/dbclient_base.cpp @@ -412,7 +412,8 @@ string DBClientBase::createPasswordDigest(const string& username, const string& namespace { class ScopedMetadataWriterRemover { - MONGO_DISALLOW_COPYING(ScopedMetadataWriterRemover); + ScopedMetadataWriterRemover(const ScopedMetadataWriterRemover&) = delete; + ScopedMetadataWriterRemover& operator=(const ScopedMetadataWriterRemover&) = delete; public: ScopedMetadataWriterRemover(DBClientBase* cli) diff --git a/src/mongo/client/dbclient_base.h b/src/mongo/client/dbclient_base.h index e837a30eda8..a125b0f5f68 100644 --- a/src/mongo/client/dbclient_base.h +++ b/src/mongo/client/dbclient_base.h @@ -100,7 +100,8 @@ class DBClientQueryInterface { abstract class that implements the core db operations */ class DBClientBase : public DBClientQueryInterface { - MONGO_DISALLOW_COPYING(DBClientBase); + DBClientBase(const DBClientBase&) = delete; + DBClientBase& operator=(const DBClientBase&) = delete; public: DBClientBase() diff --git a/src/mongo/client/dbclient_cursor.h b/src/mongo/client/dbclient_cursor.h index 86a3e02af2b..e5b69b10b50 100644 --- a/src/mongo/client/dbclient_cursor.h +++ b/src/mongo/client/dbclient_cursor.h @@ -31,7 +31,6 @@ #include <stack> -#include "mongo/base/disallow_copying.h" #include "mongo/db/dbmessage.h" #include "mongo/db/jsobj.h" #include "mongo/db/json.h" @@ -45,7 +44,8 @@ class DBClientBase; /** Queries return a cursor object */ class DBClientCursor { - MONGO_DISALLOW_COPYING(DBClientCursor); + DBClientCursor(const DBClientCursor&) = delete; + DBClientCursor& operator=(const DBClientCursor&) = delete; public: /** If true, safe to call next(). Requests more from server if necessary. */ diff --git a/src/mongo/client/fetcher.h b/src/mongo/client/fetcher.h index befb6c9f147..3f877a0c9ec 100644 --- a/src/mongo/client/fetcher.h +++ b/src/mongo/client/fetcher.h @@ -34,7 +34,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" @@ -50,7 +49,8 @@ namespace mongo { class Fetcher { - MONGO_DISALLOW_COPYING(Fetcher); + Fetcher(const Fetcher&) = delete; + Fetcher& operator=(const Fetcher&) = delete; using RemoteCommandRequest = executor::RemoteCommandRequest; public: diff --git a/src/mongo/client/fetcher_test.cpp b/src/mongo/client/fetcher_test.cpp index f92405fa791..0f7768d458f 100644 --- a/src/mongo/client/fetcher_test.cpp +++ b/src/mongo/client/fetcher_test.cpp @@ -1080,7 +1080,8 @@ TEST_F(FetcherTest, FetcherAppliesRetryPolicyToFirstCommandButNotToGetMoreReques bool sharedCallbackStateDestroyed = false; class SharedCallbackState { - MONGO_DISALLOW_COPYING(SharedCallbackState); + SharedCallbackState(const SharedCallbackState&) = delete; + SharedCallbackState& operator=(const SharedCallbackState&) = delete; public: SharedCallbackState() {} diff --git a/src/mongo/client/native_sasl_client_session.h b/src/mongo/client/native_sasl_client_session.h index 3d44ec2c932..f3c8571fdff 100644 --- a/src/mongo/client/native_sasl_client_session.h +++ b/src/mongo/client/native_sasl_client_session.h @@ -39,7 +39,8 @@ class SaslClientConversation; * native SASL implementation. */ class NativeSaslClientSession : public SaslClientSession { - MONGO_DISALLOW_COPYING(NativeSaslClientSession); + NativeSaslClientSession(const NativeSaslClientSession&) = delete; + NativeSaslClientSession& operator=(const NativeSaslClientSession&) = delete; public: NativeSaslClientSession(); diff --git a/src/mongo/client/remote_command_retry_scheduler.h b/src/mongo/client/remote_command_retry_scheduler.h index 09393539933..82766f7ca18 100644 --- a/src/mongo/client/remote_command_retry_scheduler.h +++ b/src/mongo/client/remote_command_retry_scheduler.h @@ -33,7 +33,6 @@ #include <initializer_list> #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/base/error_codes.h" #include "mongo/executor/task_executor.h" #include "mongo/stdx/condition_variable.h" @@ -58,7 +57,8 @@ namespace mongo { * - list of error codes, if present in the response, should stop the scheduler. */ class RemoteCommandRetryScheduler { - MONGO_DISALLOW_COPYING(RemoteCommandRetryScheduler); + RemoteCommandRetryScheduler(const RemoteCommandRetryScheduler&) = delete; + RemoteCommandRetryScheduler& operator=(const RemoteCommandRetryScheduler&) = delete; public: class RetryPolicy; diff --git a/src/mongo/client/remote_command_retry_scheduler_test.cpp b/src/mongo/client/remote_command_retry_scheduler_test.cpp index ac05e4c515f..d04d69f4135 100644 --- a/src/mongo/client/remote_command_retry_scheduler_test.cpp +++ b/src/mongo/client/remote_command_retry_scheduler_test.cpp @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/client/remote_command_retry_scheduler.h" #include "mongo/db/jsobj.h" @@ -67,7 +66,8 @@ protected: }; class CallbackResponseSaver { - MONGO_DISALLOW_COPYING(CallbackResponseSaver); + CallbackResponseSaver(const CallbackResponseSaver&) = delete; + CallbackResponseSaver& operator=(const CallbackResponseSaver&) = delete; public: CallbackResponseSaver(); @@ -517,7 +517,8 @@ TEST_F(RemoteCommandRetrySchedulerTest, bool sharedCallbackStateDestroyed = false; class SharedCallbackState { - MONGO_DISALLOW_COPYING(SharedCallbackState); + SharedCallbackState(const SharedCallbackState&) = delete; + SharedCallbackState& operator=(const SharedCallbackState&) = delete; public: SharedCallbackState() {} diff --git a/src/mongo/client/remote_command_targeter.h b/src/mongo/client/remote_command_targeter.h index 346003e5ae2..df4caa2c4d3 100644 --- a/src/mongo/client/remote_command_targeter.h +++ b/src/mongo/client/remote_command_targeter.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/util/future.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/time_support.h" @@ -47,7 +46,8 @@ class StatusWith; * Interface encapsulating the targeting logic for a given replica set or a standalone host. */ class RemoteCommandTargeter { - MONGO_DISALLOW_COPYING(RemoteCommandTargeter); + RemoteCommandTargeter(const RemoteCommandTargeter&) = delete; + RemoteCommandTargeter& operator=(const RemoteCommandTargeter&) = delete; public: virtual ~RemoteCommandTargeter() = default; diff --git a/src/mongo/client/remote_command_targeter_factory.h b/src/mongo/client/remote_command_targeter_factory.h index 4e219cc1bfc..f8cc15ec02e 100644 --- a/src/mongo/client/remote_command_targeter_factory.h +++ b/src/mongo/client/remote_command_targeter_factory.h @@ -31,7 +31,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" namespace mongo { @@ -43,7 +42,8 @@ class RemoteCommandTargeter; * replica set, etc). */ class RemoteCommandTargeterFactory { - MONGO_DISALLOW_COPYING(RemoteCommandTargeterFactory); + RemoteCommandTargeterFactory(const RemoteCommandTargeterFactory&) = delete; + RemoteCommandTargeterFactory& operator=(const RemoteCommandTargeterFactory&) = delete; public: virtual ~RemoteCommandTargeterFactory() = default; diff --git a/src/mongo/client/replica_set_monitor.h b/src/mongo/client/replica_set_monitor.h index 89f96b6dea7..e0fa492ac9d 100644 --- a/src/mongo/client/replica_set_monitor.h +++ b/src/mongo/client/replica_set_monitor.h @@ -35,7 +35,6 @@ #include <set> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/client/mongo_uri.h" #include "mongo/executor/task_executor.h" @@ -57,7 +56,8 @@ typedef std::shared_ptr<ReplicaSetMonitor> ReplicaSetMonitorPtr; * All methods perform the required synchronization to allow callers from multiple threads. */ class ReplicaSetMonitor : public std::enable_shared_from_this<ReplicaSetMonitor> { - MONGO_DISALLOW_COPYING(ReplicaSetMonitor); + ReplicaSetMonitor(const ReplicaSetMonitor&) = delete; + ReplicaSetMonitor& operator=(const ReplicaSetMonitor&) = delete; public: class Refresher; diff --git a/src/mongo/client/replica_set_monitor_internal.h b/src/mongo/client/replica_set_monitor_internal.h index bf7b11fb94c..823451de8b0 100644 --- a/src/mongo/client/replica_set_monitor_internal.h +++ b/src/mongo/client/replica_set_monitor_internal.h @@ -41,7 +41,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/client/read_preference.h" #include "mongo/client/replica_set_monitor.h" #include "mongo/db/jsobj.h" @@ -86,7 +85,8 @@ struct ReplicaSetMonitor::IsMasterReply { }; struct ReplicaSetMonitor::SetState { - MONGO_DISALLOW_COPYING(SetState); + SetState(const SetState&) = delete; + SetState& operator=(const SetState&) = delete; public: /** @@ -228,7 +228,8 @@ public: }; struct ReplicaSetMonitor::ScanState { - MONGO_DISALLOW_COPYING(ScanState); + ScanState(const ScanState&) = delete; + ScanState& operator=(const ScanState&) = delete; public: ScanState() = default; diff --git a/src/mongo/client/replica_set_monitor_manager.h b/src/mongo/client/replica_set_monitor_manager.h index 0185cc66428..ed92bc3b28c 100644 --- a/src/mongo/client/replica_set_monitor_manager.h +++ b/src/mongo/client/replica_set_monitor_manager.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/executor/task_executor.h" #include "mongo/stdx/mutex.h" #include "mongo/util/string_map.h" @@ -48,7 +47,8 @@ class MongoURI; * Manages the lifetime of a set of replica set monitors. */ class ReplicaSetMonitorManager { - MONGO_DISALLOW_COPYING(ReplicaSetMonitorManager); + ReplicaSetMonitorManager(const ReplicaSetMonitorManager&) = delete; + ReplicaSetMonitorManager& operator=(const ReplicaSetMonitorManager&) = delete; public: ReplicaSetMonitorManager(); diff --git a/src/mongo/client/sasl_client_conversation.h b/src/mongo/client/sasl_client_conversation.h index 2d563726578..8035c4b9388 100644 --- a/src/mongo/client/sasl_client_conversation.h +++ b/src/mongo/client/sasl_client_conversation.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" namespace mongo { @@ -45,7 +44,8 @@ class StatusWith; * of a SASL mechanism conversation. */ class SaslClientConversation { - MONGO_DISALLOW_COPYING(SaslClientConversation); + SaslClientConversation(const SaslClientConversation&) = delete; + SaslClientConversation& operator=(const SaslClientConversation&) = delete; public: /** diff --git a/src/mongo/client/sasl_client_session.h b/src/mongo/client/sasl_client_session.h index 9eb11043dcf..dcb0df60e62 100644 --- a/src/mongo/client/sasl_client_session.h +++ b/src/mongo/client/sasl_client_session.h @@ -32,7 +32,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/string_data.h" #include "mongo/stdx/functional.h" @@ -53,7 +52,8 @@ namespace mongo { * parameterPassword parameter is not constrained. */ class SaslClientSession { - MONGO_DISALLOW_COPYING(SaslClientSession); + SaslClientSession(const SaslClientSession&) = delete; + SaslClientSession& operator=(const SaslClientSession&) = delete; public: typedef stdx::function<SaslClientSession*(const std::string&)> SaslClientSessionFactoryFn; diff --git a/src/mongo/client/sasl_plain_client_conversation.h b/src/mongo/client/sasl_plain_client_conversation.h index 796de42194a..626453ceb45 100644 --- a/src/mongo/client/sasl_plain_client_conversation.h +++ b/src/mongo/client/sasl_plain_client_conversation.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/string_data.h" #include "mongo/client/sasl_client_conversation.h" @@ -41,7 +40,8 @@ namespace mongo { * Client side authentication session for SASL PLAIN. */ class SaslPLAINClientConversation : public SaslClientConversation { - MONGO_DISALLOW_COPYING(SaslPLAINClientConversation); + SaslPLAINClientConversation(const SaslPLAINClientConversation&) = delete; + SaslPLAINClientConversation& operator=(const SaslPLAINClientConversation&) = delete; public: /** diff --git a/src/mongo/client/sasl_scram_client_conversation.h b/src/mongo/client/sasl_scram_client_conversation.h index a9422c50bc9..0d5f4eafc6c 100644 --- a/src/mongo/client/sasl_scram_client_conversation.h +++ b/src/mongo/client/sasl_scram_client_conversation.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/string_data.h" #include "mongo/client/sasl_client_conversation.h" @@ -47,7 +46,8 @@ namespace mongo { * Client side authentication session for SASL PLAIN. */ class SaslSCRAMClientConversation : public SaslClientConversation { - MONGO_DISALLOW_COPYING(SaslSCRAMClientConversation); + SaslSCRAMClientConversation(const SaslSCRAMClientConversation&) = delete; + SaslSCRAMClientConversation& operator=(const SaslSCRAMClientConversation&) = delete; public: using SaslClientConversation::SaslClientConversation; diff --git a/src/mongo/db/auth/auth_op_observer.h b/src/mongo/db/auth/auth_op_observer.h index a31e09cdfe9..3e91a9c9884 100644 --- a/src/mongo/db/auth/auth_op_observer.h +++ b/src/mongo/db/auth/auth_op_observer.h @@ -38,7 +38,8 @@ namespace mongo { * relevant entries for authentication. */ class AuthOpObserver final : public OpObserver { - MONGO_DISALLOW_COPYING(AuthOpObserver); + AuthOpObserver(const AuthOpObserver&) = delete; + AuthOpObserver& operator=(const AuthOpObserver&) = delete; public: AuthOpObserver(); diff --git a/src/mongo/db/auth/authentication_session.h b/src/mongo/db/auth/authentication_session.h index 5eceeedff09..a7d5e779828 100644 --- a/src/mongo/db/auth/authentication_session.h +++ b/src/mongo/db/auth/authentication_session.h @@ -31,7 +31,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/db/auth/sasl_mechanism_registry.h" namespace mongo { @@ -42,7 +41,8 @@ class Client; * Type representing an ongoing authentication session. */ class AuthenticationSession { - MONGO_DISALLOW_COPYING(AuthenticationSession); + AuthenticationSession(const AuthenticationSession&) = delete; + AuthenticationSession& operator=(const AuthenticationSession&) = delete; public: explicit AuthenticationSession(std::unique_ptr<ServerMechanismBase> mech) diff --git a/src/mongo/db/auth/authorization_manager.h b/src/mongo/db/auth/authorization_manager.h index 1ec9f421a4c..b1b6a6e0583 100644 --- a/src/mongo/db/auth/authorization_manager.h +++ b/src/mongo/db/auth/authorization_manager.h @@ -34,7 +34,6 @@ #include <boost/optional.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/base/secure_allocator.h" #include "mongo/base/shim.h" #include "mongo/base/status.h" diff --git a/src/mongo/db/auth/authorization_manager_impl.cpp b/src/mongo/db/auth/authorization_manager_impl.cpp index 9eb185421ef..bf5d941adf6 100644 --- a/src/mongo/db/auth/authorization_manager_impl.cpp +++ b/src/mongo/db/auth/authorization_manager_impl.cpp @@ -263,7 +263,8 @@ MONGO_REGISTER_SHIM(AuthorizationManager::create)()->std::unique_ptr<Authorizati * into the cache, because some invalidation event occurred during the fetch phase. */ class AuthorizationManagerImpl::CacheGuard { - MONGO_DISALLOW_COPYING(CacheGuard); + CacheGuard(const CacheGuard&) = delete; + CacheGuard& operator=(const CacheGuard&) = delete; public: /** diff --git a/src/mongo/db/auth/authorization_manager_impl.h b/src/mongo/db/auth/authorization_manager_impl.h index 66f088b69b6..8b1d1dd06a1 100644 --- a/src/mongo/db/auth/authorization_manager_impl.h +++ b/src/mongo/db/auth/authorization_manager_impl.h @@ -34,7 +34,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/secure_allocator.h" #include "mongo/base/status.h" #include "mongo/bson/mutable/element.h" diff --git a/src/mongo/db/auth/authorization_session_for_test.h b/src/mongo/db/auth/authorization_session_for_test.h index a52a30b2fd1..b5eee9d1efd 100644 --- a/src/mongo/db/auth/authorization_session_for_test.h +++ b/src/mongo/db/auth/authorization_session_for_test.h @@ -39,7 +39,8 @@ namespace mongo { class AuthorizationSessionForTest : public AuthorizationSessionImpl { - MONGO_DISALLOW_COPYING(AuthorizationSessionForTest); + AuthorizationSessionForTest(const AuthorizationSessionForTest&) = delete; + AuthorizationSessionForTest& operator=(const AuthorizationSessionForTest&) = delete; public: using AuthorizationSessionImpl::AuthorizationSessionImpl; diff --git a/src/mongo/db/auth/authorization_session_impl.h b/src/mongo/db/auth/authorization_session_impl.h index 2cdc380ec77..5820052f811 100644 --- a/src/mongo/db/auth/authorization_session_impl.h +++ b/src/mongo/db/auth/authorization_session_impl.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/action_set.h" #include "mongo/db/auth/action_type.h" diff --git a/src/mongo/db/auth/authz_manager_external_state.h b/src/mongo/db/auth/authz_manager_external_state.h index 8fe4cff6ad8..361ff2a3f1f 100644 --- a/src/mongo/db/auth/authz_manager_external_state.h +++ b/src/mongo/db/auth/authz_manager_external_state.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/shim.h" #include "mongo/base/status.h" #include "mongo/db/auth/authorization_manager.h" diff --git a/src/mongo/db/auth/authz_manager_external_state_d.h b/src/mongo/db/auth/authz_manager_external_state_d.h index d5eaecc9659..38d1c1df8b7 100644 --- a/src/mongo/db/auth/authz_manager_external_state_d.h +++ b/src/mongo/db/auth/authz_manager_external_state_d.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/authz_manager_external_state_local.h" #include "mongo/db/auth/role_graph.h" @@ -44,7 +43,8 @@ namespace mongo { * The implementation of AuthzManagerExternalState functionality for mongod. */ class AuthzManagerExternalStateMongod : public AuthzManagerExternalStateLocal { - MONGO_DISALLOW_COPYING(AuthzManagerExternalStateMongod); + AuthzManagerExternalStateMongod(const AuthzManagerExternalStateMongod&) = delete; + AuthzManagerExternalStateMongod& operator=(const AuthzManagerExternalStateMongod&) = delete; public: AuthzManagerExternalStateMongod(); diff --git a/src/mongo/db/auth/authz_manager_external_state_local.h b/src/mongo/db/auth/authz_manager_external_state_local.h index 1307fb560c4..492f182cbbd 100644 --- a/src/mongo/db/auth/authz_manager_external_state_local.h +++ b/src/mongo/db/auth/authz_manager_external_state_local.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/authz_manager_external_state.h" #include "mongo/db/auth/role_graph.h" @@ -51,7 +50,8 @@ class Document; * and user information are stored locally. */ class AuthzManagerExternalStateLocal : public AuthzManagerExternalState { - MONGO_DISALLOW_COPYING(AuthzManagerExternalStateLocal); + AuthzManagerExternalStateLocal(const AuthzManagerExternalStateLocal&) = delete; + AuthzManagerExternalStateLocal& operator=(const AuthzManagerExternalStateLocal&) = delete; public: virtual ~AuthzManagerExternalStateLocal() = default; diff --git a/src/mongo/db/auth/authz_manager_external_state_mock.h b/src/mongo/db/auth/authz_manager_external_state_mock.h index 5110f39988c..9d316a764f9 100644 --- a/src/mongo/db/auth/authz_manager_external_state_mock.h +++ b/src/mongo/db/auth/authz_manager_external_state_mock.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/authz_manager_external_state_local.h" #include "mongo/db/auth/role_graph.h" @@ -49,7 +48,8 @@ class AuthorizationManager; * Mock of the AuthzManagerExternalState class used only for testing. */ class AuthzManagerExternalStateMock : public AuthzManagerExternalStateLocal { - MONGO_DISALLOW_COPYING(AuthzManagerExternalStateMock); + AuthzManagerExternalStateMock(const AuthzManagerExternalStateMock&) = delete; + AuthzManagerExternalStateMock& operator=(const AuthzManagerExternalStateMock&) = delete; public: AuthzManagerExternalStateMock(); 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 113a3d8276e..f0f1e476c8a 100644 --- a/src/mongo/db/auth/authz_manager_external_state_s.h +++ b/src/mongo/db/auth/authz_manager_external_state_s.h @@ -32,7 +32,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/authz_manager_external_state.h" #include "mongo/db/auth/privilege_format.h" @@ -45,7 +44,8 @@ namespace mongo { * The implementation of AuthzManagerExternalState functionality for mongos. */ class AuthzManagerExternalStateMongos : public AuthzManagerExternalState { - MONGO_DISALLOW_COPYING(AuthzManagerExternalStateMongos); + AuthzManagerExternalStateMongos(const AuthzManagerExternalStateMongos&) = delete; + AuthzManagerExternalStateMongos& operator=(const AuthzManagerExternalStateMongos&) = delete; public: AuthzManagerExternalStateMongos(); diff --git a/src/mongo/db/auth/authz_session_external_state.h b/src/mongo/db/auth/authz_session_external_state.h index f7bffa12e31..7647a9c9df9 100644 --- a/src/mongo/db/auth/authz_session_external_state.h +++ b/src/mongo/db/auth/authz_session_external_state.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/auth/user_name.h" diff --git a/src/mongo/db/auth/authz_session_external_state_d.h b/src/mongo/db/auth/authz_session_external_state_d.h index 342ceed1285..1b29c027b97 100644 --- a/src/mongo/db/auth/authz_session_external_state_d.h +++ b/src/mongo/db/auth/authz_session_external_state_d.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/authz_session_external_state_server_common.h" @@ -39,7 +38,8 @@ namespace mongo { * The implementation of AuthzSessionExternalState functionality for mongod. */ class AuthzSessionExternalStateMongod : public AuthzSessionExternalStateServerCommon { - MONGO_DISALLOW_COPYING(AuthzSessionExternalStateMongod); + AuthzSessionExternalStateMongod(const AuthzSessionExternalStateMongod&) = delete; + AuthzSessionExternalStateMongod& operator=(const AuthzSessionExternalStateMongod&) = delete; public: AuthzSessionExternalStateMongod(AuthorizationManager* authzManager); diff --git a/src/mongo/db/auth/authz_session_external_state_mock.h b/src/mongo/db/auth/authz_session_external_state_mock.h index b616ae19e35..ade50f65f98 100644 --- a/src/mongo/db/auth/authz_session_external_state_mock.h +++ b/src/mongo/db/auth/authz_session_external_state_mock.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/authz_session_external_state.h" diff --git a/src/mongo/db/auth/authz_session_external_state_s.h b/src/mongo/db/auth/authz_session_external_state_s.h index a894d6fe6ae..46046e3bef1 100644 --- a/src/mongo/db/auth/authz_session_external_state_s.h +++ b/src/mongo/db/auth/authz_session_external_state_s.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/authz_session_external_state_server_common.h" @@ -39,7 +38,8 @@ namespace mongo { * The implementation of AuthzSessionExternalState functionality for mongos. */ class AuthzSessionExternalStateMongos : public AuthzSessionExternalStateServerCommon { - MONGO_DISALLOW_COPYING(AuthzSessionExternalStateMongos); + AuthzSessionExternalStateMongos(const AuthzSessionExternalStateMongos&) = delete; + AuthzSessionExternalStateMongos& operator=(const AuthzSessionExternalStateMongos&) = delete; public: AuthzSessionExternalStateMongos(AuthorizationManager* authzManager); diff --git a/src/mongo/db/auth/authz_session_external_state_server_common.h b/src/mongo/db/auth/authz_session_external_state_server_common.h index 110d74f3f26..51dcd1b2bc2 100644 --- a/src/mongo/db/auth/authz_session_external_state_server_common.h +++ b/src/mongo/db/auth/authz_session_external_state_server_common.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/authz_session_external_state.h" @@ -39,7 +38,9 @@ namespace mongo { * The implementation of AuthzSessionExternalState functionality common to mongod and mongos. */ class AuthzSessionExternalStateServerCommon : public AuthzSessionExternalState { - MONGO_DISALLOW_COPYING(AuthzSessionExternalStateServerCommon); + AuthzSessionExternalStateServerCommon(const AuthzSessionExternalStateServerCommon&) = delete; + AuthzSessionExternalStateServerCommon& operator=(const AuthzSessionExternalStateServerCommon&) = + delete; public: virtual ~AuthzSessionExternalStateServerCommon(); diff --git a/src/mongo/db/auth/impersonation_session.h b/src/mongo/db/auth/impersonation_session.h index 603142f2cbf..bab75018f8b 100644 --- a/src/mongo/db/auth/impersonation_session.h +++ b/src/mongo/db/auth/impersonation_session.h @@ -27,7 +27,6 @@ * it in the license file. */ -#include "mongo/base/disallow_copying.h" #include "mongo/rpc/metadata/impersonated_user_metadata.h" namespace mongo { @@ -38,7 +37,8 @@ class OperationContext; * for the duration of the life of this object. */ class ImpersonationSessionGuard { - MONGO_DISALLOW_COPYING(ImpersonationSessionGuard); + ImpersonationSessionGuard(const ImpersonationSessionGuard&) = delete; + ImpersonationSessionGuard& operator=(const ImpersonationSessionGuard&) = delete; public: ImpersonationSessionGuard(OperationContext* opCtx); diff --git a/src/mongo/db/auth/privilege_parser.h b/src/mongo/db/auth/privilege_parser.h index 5c7214ba047..853a371193e 100644 --- a/src/mongo/db/auth/privilege_parser.h +++ b/src/mongo/db/auth/privilege_parser.h @@ -44,7 +44,8 @@ class Privilege; * of privileges granted to roles in the role management commands. */ class ParsedResource { - MONGO_DISALLOW_COPYING(ParsedResource); + ParsedResource(const ParsedResource&) = delete; + ParsedResource& operator=(const ParsedResource&) = delete; public: // @@ -124,7 +125,8 @@ private: * This class is used to parse documents describing privileges in the role managment commands. */ class ParsedPrivilege { - MONGO_DISALLOW_COPYING(ParsedPrivilege); + ParsedPrivilege(const ParsedPrivilege&) = delete; + ParsedPrivilege& operator=(const ParsedPrivilege&) = delete; public: // diff --git a/src/mongo/db/auth/role_name.h b/src/mongo/db/auth/role_name.h index 1f319b4c49f..75aa6202920 100644 --- a/src/mongo/db/auth/role_name.h +++ b/src/mongo/db/auth/role_name.h @@ -35,7 +35,6 @@ #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsonelement.h" #include "mongo/bson/bsonobjbuilder.h" @@ -128,7 +127,8 @@ std::ostream& operator<<(std::ostream& os, const RoleName& name); class RoleNameIterator { public: class Impl { - MONGO_DISALLOW_COPYING(Impl); + Impl(const Impl&) = delete; + Impl& operator=(const Impl&) = delete; public: Impl(){}; @@ -182,7 +182,8 @@ namespace mongo { template <typename ContainerIterator> class RoleNameContainerIteratorImpl : public RoleNameIterator::Impl { - MONGO_DISALLOW_COPYING(RoleNameContainerIteratorImpl); + RoleNameContainerIteratorImpl(const RoleNameContainerIteratorImpl&) = delete; + RoleNameContainerIteratorImpl& operator=(const RoleNameContainerIteratorImpl&) = delete; public: RoleNameContainerIteratorImpl(const ContainerIterator& begin, const ContainerIterator& end) diff --git a/src/mongo/db/auth/sasl_scram_server_conversation.cpp b/src/mongo/db/auth/sasl_scram_server_conversation.cpp index e9f2fbddbce..9415376afe5 100644 --- a/src/mongo/db/auth/sasl_scram_server_conversation.cpp +++ b/src/mongo/db/auth/sasl_scram_server_conversation.cpp @@ -36,7 +36,6 @@ #include <boost/algorithm/string/join.hpp> #include <boost/algorithm/string/replace.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/base/init.h" #include "mongo/base/status.h" #include "mongo/base/string_data.h" diff --git a/src/mongo/db/auth/user.h b/src/mongo/db/auth/user.h index 5b3edfb767f..9ed29c72409 100644 --- a/src/mongo/db/auth/user.h +++ b/src/mongo/db/auth/user.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/crypto/sha1_block.h" #include "mongo/crypto/sha256_block.h" #include "mongo/db/auth/privilege.h" @@ -61,7 +60,8 @@ namespace mongo { * user from the AuthorizationManager. */ class User { - MONGO_DISALLOW_COPYING(User); + User(const User&) = delete; + User& operator=(const User&) = delete; public: template <typename HashBlock> diff --git a/src/mongo/db/auth/user_document_parser.h b/src/mongo/db/auth/user_document_parser.h index 7493ce7d324..4fca54c3739 100644 --- a/src/mongo/db/auth/user_document_parser.h +++ b/src/mongo/db/auth/user_document_parser.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/auth/action_set.h" #include "mongo/db/auth/user.h" @@ -38,7 +37,8 @@ namespace mongo { class V2UserDocumentParser { - MONGO_DISALLOW_COPYING(V2UserDocumentParser); + V2UserDocumentParser(const V2UserDocumentParser&) = delete; + V2UserDocumentParser& operator=(const V2UserDocumentParser&) = delete; public: V2UserDocumentParser() {} diff --git a/src/mongo/db/auth/user_management_commands_parser.h b/src/mongo/db/auth/user_management_commands_parser.h index ba337f132c2..d249871a63b 100644 --- a/src/mongo/db/auth/user_management_commands_parser.h +++ b/src/mongo/db/auth/user_management_commands_parser.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/string_data.h" #include "mongo/db/auth/authorization_manager.h" diff --git a/src/mongo/db/auth/user_name.h b/src/mongo/db/auth/user_name.h index fe9d560a397..fde52bc3297 100644 --- a/src/mongo/db/auth/user_name.h +++ b/src/mongo/db/auth/user_name.h @@ -35,7 +35,6 @@ #include "mongo/base/clonable_ptr.h" -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsonelement.h" diff --git a/src/mongo/db/auth/user_set.cpp b/src/mongo/db/auth/user_set.cpp index 6ca9c2e6b90..52fa1bf164a 100644 --- a/src/mongo/db/auth/user_set.cpp +++ b/src/mongo/db/auth/user_set.cpp @@ -41,7 +41,8 @@ namespace mongo { namespace { class UserSetNameIteratorImpl : public UserNameIterator::Impl { - MONGO_DISALLOW_COPYING(UserSetNameIteratorImpl); + UserSetNameIteratorImpl(const UserSetNameIteratorImpl&) = delete; + UserSetNameIteratorImpl& operator=(const UserSetNameIteratorImpl&) = delete; public: UserSetNameIteratorImpl(const UserSet::const_iterator& begin, diff --git a/src/mongo/db/auth/user_set.h b/src/mongo/db/auth/user_set.h index 91941621984..b4e88f7bbd7 100644 --- a/src/mongo/db/auth/user_set.h +++ b/src/mongo/db/auth/user_set.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/auth/user.h" @@ -47,7 +46,8 @@ namespace mongo { * synchronizing access. */ class UserSet { - MONGO_DISALLOW_COPYING(UserSet); + UserSet(const UserSet&) = delete; + UserSet& operator=(const UserSet&) = delete; public: using iterator = stdx::list<UserHandle>::iterator; diff --git a/src/mongo/db/background.cpp b/src/mongo/db/background.cpp index f499e8a1a2e..156955134ce 100644 --- a/src/mongo/db/background.cpp +++ b/src/mongo/db/background.cpp @@ -34,7 +34,6 @@ #include <iostream> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" #include "mongo/stdx/thread.h" @@ -50,7 +49,8 @@ using std::shared_ptr; namespace { class BgInfo { - MONGO_DISALLOW_COPYING(BgInfo); + BgInfo(const BgInfo&) = delete; + BgInfo& operator=(const BgInfo&) = delete; public: BgInfo() : _opsInProgCount(0) {} diff --git a/src/mongo/db/background.h b/src/mongo/db/background.h index 6aa4a680e03..49bde198a44 100644 --- a/src/mongo/db/background.h +++ b/src/mongo/db/background.h @@ -39,7 +39,6 @@ #include <set> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/db/namespace_string.h" @@ -55,7 +54,8 @@ namespace mongo { anything special in the implementation here to be fast. */ class BackgroundOperation { - MONGO_DISALLOW_COPYING(BackgroundOperation); + BackgroundOperation(const BackgroundOperation&) = delete; + BackgroundOperation& operator=(const BackgroundOperation&) = delete; public: static bool inProgForDb(StringData db); diff --git a/src/mongo/db/catalog/document_validation.h b/src/mongo/db/catalog/document_validation.h index e3b20f2138e..27a7969c6d6 100644 --- a/src/mongo/db/catalog/document_validation.h +++ b/src/mongo/db/catalog/document_validation.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/db/operation_context.h" @@ -54,7 +53,8 @@ inline bool shouldBypassDocumentValidationForCommand(const BSONObj& cmdObj) { * Resets to original value when leaving scope so they are safe to nest. */ class DisableDocumentValidation { - MONGO_DISALLOW_COPYING(DisableDocumentValidation); + DisableDocumentValidation(const DisableDocumentValidation&) = delete; + DisableDocumentValidation& operator=(const DisableDocumentValidation&) = delete; public: DisableDocumentValidation(OperationContext* opCtx) diff --git a/src/mongo/db/catalog/health_log.h b/src/mongo/db/catalog/health_log.h index 31c38522b2a..2b312f741fa 100644 --- a/src/mongo/db/catalog/health_log.h +++ b/src/mongo/db/catalog/health_log.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/concurrency/deferred_writer.h" #include "mongo/db/service_context.h" @@ -45,7 +44,8 @@ class HealthLogEntry; * up on shutdown. */ class HealthLog { - MONGO_DISALLOW_COPYING(HealthLog); + HealthLog(const HealthLog&) = delete; + HealthLog& operator=(const HealthLog&) = delete; public: /** diff --git a/src/mongo/db/catalog/index_builds_manager.h b/src/mongo/db/catalog/index_builds_manager.h index 105241fae6d..d72915f5d19 100644 --- a/src/mongo/db/catalog/index_builds_manager.h +++ b/src/mongo/db/catalog/index_builds_manager.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/catalog/multi_index_block.h" #include "mongo/db/namespace_string.h" #include "mongo/stdx/functional.h" @@ -53,7 +52,8 @@ enum IndexBuildRecoveryState { Building, Verifying, Committing }; * state is set up and then cleaned up by this class. */ class IndexBuildsManager { - MONGO_DISALLOW_COPYING(IndexBuildsManager); + IndexBuildsManager(const IndexBuildsManager&) = delete; + IndexBuildsManager& operator=(const IndexBuildsManager&) = delete; public: /** diff --git a/src/mongo/db/catalog/index_catalog_entry_impl.h b/src/mongo/db/catalog/index_catalog_entry_impl.h index de579d8bd16..eab59dfb287 100644 --- a/src/mongo/db/catalog/index_catalog_entry_impl.h +++ b/src/mongo/db/catalog/index_catalog_entry_impl.h @@ -55,7 +55,8 @@ class MatchExpression; class OperationContext; class IndexCatalogEntryImpl : public IndexCatalogEntry { - MONGO_DISALLOW_COPYING(IndexCatalogEntryImpl); + IndexCatalogEntryImpl(const IndexCatalogEntryImpl&) = delete; + IndexCatalogEntryImpl& operator=(const IndexCatalogEntryImpl&) = delete; public: explicit IndexCatalogEntryImpl( diff --git a/src/mongo/db/catalog/index_catalog_impl.h b/src/mongo/db/catalog/index_catalog_impl.h index d95f557102f..05d790b46b3 100644 --- a/src/mongo/db/catalog/index_catalog_impl.h +++ b/src/mongo/db/catalog/index_catalog_impl.h @@ -251,7 +251,8 @@ public: // --- these probably become private? class IndexBuildBlock : public IndexCatalog::IndexBuildBlockInterface { - MONGO_DISALLOW_COPYING(IndexBuildBlock); + IndexBuildBlock(const IndexBuildBlock&) = delete; + IndexBuildBlock& operator=(const IndexBuildBlock&) = delete; public: IndexBuildBlock(IndexCatalogImpl* catalog, diff --git a/src/mongo/db/catalog/multi_index_block.h b/src/mongo/db/catalog/multi_index_block.h index 2e32dff5026..99a97df59b9 100644 --- a/src/mongo/db/catalog/multi_index_block.h +++ b/src/mongo/db/catalog/multi_index_block.h @@ -35,7 +35,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/base/string_data.h" @@ -70,7 +69,8 @@ class OperationContext; * (as it is itself essentially a form of rollback, you don't want to "rollback the rollback"). */ class MultiIndexBlock { - MONGO_DISALLOW_COPYING(MultiIndexBlock); + MultiIndexBlock(const MultiIndexBlock&) = delete; + MultiIndexBlock& operator=(const MultiIndexBlock&) = delete; public: MultiIndexBlock() = default; diff --git a/src/mongo/db/catalog/namespace_uuid_cache.h b/src/mongo/db/catalog/namespace_uuid_cache.h index d51aa2e89fa..c15466a48a8 100644 --- a/src/mongo/db/catalog/namespace_uuid_cache.h +++ b/src/mongo/db/catalog/namespace_uuid_cache.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/catalog/collection_options.h" #include "mongo/db/operation_context.h" #include "mongo/util/string_map.h" @@ -47,7 +46,8 @@ using CollectionUUID = UUID; class Database; class NamespaceUUIDCache { - MONGO_DISALLOW_COPYING(NamespaceUUIDCache); + NamespaceUUIDCache(const NamespaceUUIDCache&) = delete; + NamespaceUUIDCache& operator=(const NamespaceUUIDCache&) = delete; public: static const OperationContext::Decoration<NamespaceUUIDCache> get; diff --git a/src/mongo/db/catalog/uuid_catalog.h b/src/mongo/db/catalog/uuid_catalog.h index 55d37305e0a..e183b3a850a 100644 --- a/src/mongo/db/catalog/uuid_catalog.h +++ b/src/mongo/db/catalog/uuid_catalog.h @@ -31,7 +31,6 @@ #include <unordered_map> -#include "mongo/base/disallow_copying.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/op_observer.h" #include "mongo/db/service_context.h" @@ -176,7 +175,8 @@ using CollectionUUID = UUID; class Database; class UUIDCatalog { - MONGO_DISALLOW_COPYING(UUIDCatalog); + UUIDCatalog(const UUIDCatalog&) = delete; + UUIDCatalog& operator=(const UUIDCatalog&) = delete; public: class iterator { diff --git a/src/mongo/db/catalog_raii.h b/src/mongo/db/catalog_raii.h index 730ba4614e8..aa18dd23e23 100644 --- a/src/mongo/db/catalog_raii.h +++ b/src/mongo/db/catalog_raii.h @@ -51,7 +51,8 @@ namespace mongo { * the database reference returned by this class should not be retained. */ class AutoGetDb { - MONGO_DISALLOW_COPYING(AutoGetDb); + AutoGetDb(const AutoGetDb&) = delete; + AutoGetDb& operator=(const AutoGetDb&) = delete; public: AutoGetDb(OperationContext* opCtx, @@ -81,7 +82,8 @@ private: * and the collection references returned by this class should not be retained. */ class AutoGetCollection { - MONGO_DISALLOW_COPYING(AutoGetCollection); + AutoGetCollection(const AutoGetCollection&) = delete; + AutoGetCollection& operator=(const AutoGetCollection&) = delete; public: enum ViewMode { kViewsPermitted, kViewsForbidden }; @@ -165,7 +167,8 @@ private: * the database reference returned by this class should not be retained. */ class AutoGetOrCreateDb { - MONGO_DISALLOW_COPYING(AutoGetOrCreateDb); + AutoGetOrCreateDb(const AutoGetOrCreateDb&) = delete; + AutoGetOrCreateDb& operator=(const AutoGetOrCreateDb&) = delete; public: AutoGetOrCreateDb(OperationContext* opCtx, @@ -195,7 +198,8 @@ private: * The caller must hold the global exclusive lock for the life of the instance. */ class ConcealUUIDCatalogChangesBlock { - MONGO_DISALLOW_COPYING(ConcealUUIDCatalogChangesBlock); + ConcealUUIDCatalogChangesBlock(const ConcealUUIDCatalogChangesBlock&) = delete; + ConcealUUIDCatalogChangesBlock& operator=(const ConcealUUIDCatalogChangesBlock&) = delete; public: /** diff --git a/src/mongo/db/client.h b/src/mongo/db/client.h index 7e24368412d..c1b540ac11b 100644 --- a/src/mongo/db/client.h +++ b/src/mongo/db/client.h @@ -39,7 +39,6 @@ #include <boost/optional.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/db/client.h" #include "mongo/db/namespace_string.h" #include "mongo/db/service_context.h" diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h index 56394e8fc0b..92f51255ed5 100644 --- a/src/mongo/db/clientcursor.h +++ b/src/mongo/db/clientcursor.h @@ -137,7 +137,8 @@ struct ClientCursorParams { * of inactivity. */ class ClientCursor { - MONGO_DISALLOW_COPYING(ClientCursor); + ClientCursor(const ClientCursor&) = delete; + ClientCursor& operator=(const ClientCursor&) = delete; public: CursorId cursorid() const { @@ -456,7 +457,8 @@ private: * policy. */ class ClientCursorPin { - MONGO_DISALLOW_COPYING(ClientCursorPin); + ClientCursorPin(const ClientCursorPin&) = delete; + ClientCursorPin& operator=(const ClientCursorPin&) = delete; public: /** diff --git a/src/mongo/db/cloner.h b/src/mongo/db/cloner.h index b674017cb82..25e0af45736 100644 --- a/src/mongo/db/cloner.h +++ b/src/mongo/db/cloner.h @@ -36,7 +36,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/client/dbclient_base.h" #include "mongo/db/catalog/collection_options.h" @@ -49,7 +48,8 @@ class OperationContext; class Cloner { - MONGO_DISALLOW_COPYING(Cloner); + Cloner(const Cloner&) = delete; + Cloner& operator=(const Cloner&) = delete; public: Cloner(); diff --git a/src/mongo/db/collection_index_builds_tracker.h b/src/mongo/db/collection_index_builds_tracker.h index 10b4f833f7c..5a4ab1eb5f9 100644 --- a/src/mongo/db/collection_index_builds_tracker.h +++ b/src/mongo/db/collection_index_builds_tracker.h @@ -32,7 +32,6 @@ #include <map> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl_index_build_state.h" #include "mongo/stdx/condition_variable.h" #include "mongo/util/concurrency/with_lock.h" @@ -53,7 +52,8 @@ class IndexBuildsManager; * This is intended to only be used by the IndexBuildsCoordinator class. */ class CollectionIndexBuildsTracker { - MONGO_DISALLOW_COPYING(CollectionIndexBuildsTracker); + CollectionIndexBuildsTracker(const CollectionIndexBuildsTracker&) = delete; + CollectionIndexBuildsTracker& operator=(const CollectionIndexBuildsTracker&) = delete; public: CollectionIndexBuildsTracker() = default; diff --git a/src/mongo/db/collection_index_usage_tracker.h b/src/mongo/db/collection_index_usage_tracker.h index ed3ee339ccb..62c3b610f41 100644 --- a/src/mongo/db/collection_index_usage_tracker.h +++ b/src/mongo/db/collection_index_usage_tracker.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsonobj.h" #include "mongo/platform/atomic_word.h" @@ -48,7 +47,8 @@ class ClockSource; * Indexes must be registered and deregistered on creation/destruction. */ class CollectionIndexUsageTracker { - MONGO_DISALLOW_COPYING(CollectionIndexUsageTracker); + CollectionIndexUsageTracker(const CollectionIndexUsageTracker&) = delete; + CollectionIndexUsageTracker& operator=(const CollectionIndexUsageTracker&) = delete; public: struct IndexUsageStats { diff --git a/src/mongo/db/commands/current_op.cpp b/src/mongo/db/commands/current_op.cpp index 6a9d12f3c1c..247a2a6761c 100644 --- a/src/mongo/db/commands/current_op.cpp +++ b/src/mongo/db/commands/current_op.cpp @@ -42,7 +42,8 @@ namespace mongo { class CurrentOpCommand final : public CurrentOpCommandBase { - MONGO_DISALLOW_COPYING(CurrentOpCommand); + CurrentOpCommand(const CurrentOpCommand&) = delete; + CurrentOpCommand& operator=(const CurrentOpCommand&) = delete; public: CurrentOpCommand() = default; diff --git a/src/mongo/db/commands/end_sessions_command.cpp b/src/mongo/db/commands/end_sessions_command.cpp index a1f807a4aaf..9822eebd60c 100644 --- a/src/mongo/db/commands/end_sessions_command.cpp +++ b/src/mongo/db/commands/end_sessions_command.cpp @@ -40,7 +40,8 @@ namespace mongo { class EndSessionsCommand final : public BasicCommand { - MONGO_DISALLOW_COPYING(EndSessionsCommand); + EndSessionsCommand(const EndSessionsCommand&) = delete; + EndSessionsCommand& operator=(const EndSessionsCommand&) = delete; public: EndSessionsCommand() : BasicCommand("endSessions") {} diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index e0b710c5fcd..02cef74021d 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -34,7 +34,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/db/auth/authorization_session.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/client.h" diff --git a/src/mongo/db/commands/kill_all_sessions_by_pattern_command.cpp b/src/mongo/db/commands/kill_all_sessions_by_pattern_command.cpp index e7c7170f99f..7c3a18d550b 100644 --- a/src/mongo/db/commands/kill_all_sessions_by_pattern_command.cpp +++ b/src/mongo/db/commands/kill_all_sessions_by_pattern_command.cpp @@ -53,7 +53,8 @@ namespace mongo { class KillAllSessionsByPatternCommand final : public BasicCommand { - MONGO_DISALLOW_COPYING(KillAllSessionsByPatternCommand); + KillAllSessionsByPatternCommand(const KillAllSessionsByPatternCommand&) = delete; + KillAllSessionsByPatternCommand& operator=(const KillAllSessionsByPatternCommand&) = delete; public: KillAllSessionsByPatternCommand() : BasicCommand("killAllSessionsByPattern") {} diff --git a/src/mongo/db/commands/kill_all_sessions_command.cpp b/src/mongo/db/commands/kill_all_sessions_command.cpp index 14471771481..b11513efd55 100644 --- a/src/mongo/db/commands/kill_all_sessions_command.cpp +++ b/src/mongo/db/commands/kill_all_sessions_command.cpp @@ -53,7 +53,8 @@ namespace mongo { class KillAllSessionsCommand final : public BasicCommand { - MONGO_DISALLOW_COPYING(KillAllSessionsCommand); + KillAllSessionsCommand(const KillAllSessionsCommand&) = delete; + KillAllSessionsCommand& operator=(const KillAllSessionsCommand&) = delete; public: KillAllSessionsCommand() : BasicCommand("killAllSessions") {} diff --git a/src/mongo/db/commands/kill_sessions_command.cpp b/src/mongo/db/commands/kill_sessions_command.cpp index f4d46c200f1..afa5d2357e1 100644 --- a/src/mongo/db/commands/kill_sessions_command.cpp +++ b/src/mongo/db/commands/kill_sessions_command.cpp @@ -80,7 +80,8 @@ KillAllSessionsByPatternSet patternsForLoggedInUser(OperationContext* opCtx) { } // namespace class KillSessionsCommand final : public BasicCommand { - MONGO_DISALLOW_COPYING(KillSessionsCommand); + KillSessionsCommand(const KillSessionsCommand&) = delete; + KillSessionsCommand& operator=(const KillSessionsCommand&) = delete; public: KillSessionsCommand() : BasicCommand("killSessions") {} diff --git a/src/mongo/db/commands/killcursors_cmd.cpp b/src/mongo/db/commands/killcursors_cmd.cpp index bda674408c3..a81c59b8702 100644 --- a/src/mongo/db/commands/killcursors_cmd.cpp +++ b/src/mongo/db/commands/killcursors_cmd.cpp @@ -29,7 +29,6 @@ #include "mongo/platform/basic.h" -#include "mongo/base/disallow_copying.h" #include "mongo/db/auth/authorization_session.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/commands/killcursors_common.h" @@ -43,7 +42,8 @@ namespace mongo { class KillCursorsCmd final : public KillCursorsCmdBase { - MONGO_DISALLOW_COPYING(KillCursorsCmd); + KillCursorsCmd(const KillCursorsCmd&) = delete; + KillCursorsCmd& operator=(const KillCursorsCmd&) = delete; public: KillCursorsCmd() = default; diff --git a/src/mongo/db/commands/list_collections_filter.h b/src/mongo/db/commands/list_collections_filter.h index d54775551a2..d355e9647b1 100644 --- a/src/mongo/db/commands/list_collections_filter.h +++ b/src/mongo/db/commands/list_collections_filter.h @@ -29,13 +29,13 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonobj.h" namespace mongo { class ListCollectionsFilter { - MONGO_DISALLOW_COPYING(ListCollectionsFilter); + ListCollectionsFilter(const ListCollectionsFilter&) = delete; + ListCollectionsFilter& operator=(const ListCollectionsFilter&) = delete; public: /** diff --git a/src/mongo/db/commands/mr.h b/src/mongo/db/commands/mr.h index cdb96e18f6d..d9ced2102af 100644 --- a/src/mongo/db/commands/mr.h +++ b/src/mongo/db/commands/mr.h @@ -53,7 +53,8 @@ class State; // ------------ function interfaces ----------- class Mapper { - MONGO_DISALLOW_COPYING(Mapper); + Mapper(const Mapper&) = delete; + Mapper& operator=(const Mapper&) = delete; public: virtual ~Mapper() {} @@ -66,7 +67,8 @@ protected: }; class Finalizer { - MONGO_DISALLOW_COPYING(Finalizer); + Finalizer(const Finalizer&) = delete; + Finalizer& operator=(const Finalizer&) = delete; public: virtual ~Finalizer() {} @@ -82,7 +84,8 @@ protected: }; class Reducer { - MONGO_DISALLOW_COPYING(Reducer); + Reducer(const Reducer&) = delete; + Reducer& operator=(const Reducer&) = delete; public: Reducer() : numReduces(0) {} @@ -103,7 +106,8 @@ public: * visitor like pattern as Scope is gotten from first access */ class JSFunction { - MONGO_DISALLOW_COPYING(JSFunction); + JSFunction(const JSFunction&) = delete; + JSFunction& operator=(const JSFunction&) = delete; public: /** diff --git a/src/mongo/db/commands/reap_logical_session_cache_now.cpp b/src/mongo/db/commands/reap_logical_session_cache_now.cpp index ec68eef7b60..8379169e84e 100644 --- a/src/mongo/db/commands/reap_logical_session_cache_now.cpp +++ b/src/mongo/db/commands/reap_logical_session_cache_now.cpp @@ -41,7 +41,8 @@ namespace mongo { namespace { class ReapLogicalSessionCacheNowCommand final : public BasicCommand { - MONGO_DISALLOW_COPYING(ReapLogicalSessionCacheNowCommand); + ReapLogicalSessionCacheNowCommand(const ReapLogicalSessionCacheNowCommand&) = delete; + ReapLogicalSessionCacheNowCommand& operator=(const ReapLogicalSessionCacheNowCommand&) = delete; public: ReapLogicalSessionCacheNowCommand() : BasicCommand("reapLogicalSessionCacheNow") {} diff --git a/src/mongo/db/commands/refresh_logical_session_cache_now.cpp b/src/mongo/db/commands/refresh_logical_session_cache_now.cpp index 814e8fd6b16..8d09a15f17a 100644 --- a/src/mongo/db/commands/refresh_logical_session_cache_now.cpp +++ b/src/mongo/db/commands/refresh_logical_session_cache_now.cpp @@ -42,7 +42,9 @@ namespace mongo { namespace { class RefreshLogicalSessionCacheNowCommand final : public BasicCommand { - MONGO_DISALLOW_COPYING(RefreshLogicalSessionCacheNowCommand); + RefreshLogicalSessionCacheNowCommand(const RefreshLogicalSessionCacheNowCommand&) = delete; + RefreshLogicalSessionCacheNowCommand& operator=(const RefreshLogicalSessionCacheNowCommand&) = + delete; public: RefreshLogicalSessionCacheNowCommand() : BasicCommand("refreshLogicalSessionCacheNow") {} diff --git a/src/mongo/db/commands/refresh_sessions_command.cpp b/src/mongo/db/commands/refresh_sessions_command.cpp index 6d83fe44e34..229db890078 100644 --- a/src/mongo/db/commands/refresh_sessions_command.cpp +++ b/src/mongo/db/commands/refresh_sessions_command.cpp @@ -42,7 +42,8 @@ namespace mongo { class RefreshSessionsCommand final : public BasicCommand { - MONGO_DISALLOW_COPYING(RefreshSessionsCommand); + RefreshSessionsCommand(const RefreshSessionsCommand&) = delete; + RefreshSessionsCommand& operator=(const RefreshSessionsCommand&) = delete; public: RefreshSessionsCommand() : BasicCommand("refreshSessions") {} diff --git a/src/mongo/db/commands/refresh_sessions_command_internal.cpp b/src/mongo/db/commands/refresh_sessions_command_internal.cpp index be1f8b3f8b6..aa3ebb4b194 100644 --- a/src/mongo/db/commands/refresh_sessions_command_internal.cpp +++ b/src/mongo/db/commands/refresh_sessions_command_internal.cpp @@ -42,7 +42,8 @@ namespace mongo { class RefreshSessionsCommandInternal final : public BasicCommand { - MONGO_DISALLOW_COPYING(RefreshSessionsCommandInternal); + RefreshSessionsCommandInternal(const RefreshSessionsCommandInternal&) = delete; + RefreshSessionsCommandInternal& operator=(const RefreshSessionsCommandInternal&) = delete; public: RefreshSessionsCommandInternal() : BasicCommand("refreshSessionsInternal") {} diff --git a/src/mongo/db/commands/start_session_command.cpp b/src/mongo/db/commands/start_session_command.cpp index cf4aafb551f..a9e64c9d5c4 100644 --- a/src/mongo/db/commands/start_session_command.cpp +++ b/src/mongo/db/commands/start_session_command.cpp @@ -47,7 +47,8 @@ namespace mongo { class StartSessionCommand final : public BasicCommand { - MONGO_DISALLOW_COPYING(StartSessionCommand); + StartSessionCommand(const StartSessionCommand&) = delete; + StartSessionCommand& operator=(const StartSessionCommand&) = delete; public: StartSessionCommand() : BasicCommand("startSession") {} diff --git a/src/mongo/db/concurrency/d_concurrency.h b/src/mongo/db/concurrency/d_concurrency.h index 7f6f52e9c99..e6259e85ca4 100644 --- a/src/mongo/db/concurrency/d_concurrency.h +++ b/src/mongo/db/concurrency/d_concurrency.h @@ -46,7 +46,8 @@ public: * NOTE: DO NOT add any new usages of TempRelease. It is being deprecated/removed. */ class TempRelease { - MONGO_DISALLOW_COPYING(TempRelease); + TempRelease(const TempRelease&) = delete; + TempRelease& operator=(const TempRelease&) = delete; public: explicit TempRelease(Locker* lockState); @@ -72,7 +73,8 @@ public: * resources other than RESOURCE_GLOBAL, RESOURCE_DATABASE and RESOURCE_COLLECTION. */ class ResourceLock { - MONGO_DISALLOW_COPYING(ResourceLock); + ResourceLock(const ResourceLock&) = delete; + ResourceLock& operator=(const ResourceLock&) = delete; public: ResourceLock(Locker* locker, ResourceId rid) @@ -352,7 +354,8 @@ public: * will be upgraded to MODE_S and MODE_IX will be upgraded to MODE_X. */ class CollectionLock { - MONGO_DISALLOW_COPYING(CollectionLock); + CollectionLock(const CollectionLock&) = delete; + CollectionLock& operator=(const CollectionLock&) = delete; public: CollectionLock(Locker* lockState, @@ -379,7 +382,8 @@ public: * dassert(), to not have a suitable database lock when taking this lock. */ class OplogIntentWriteLock { - MONGO_DISALLOW_COPYING(OplogIntentWriteLock); + OplogIntentWriteLock(const OplogIntentWriteLock&) = delete; + OplogIntentWriteLock& operator=(const OplogIntentWriteLock&) = delete; public: explicit OplogIntentWriteLock(Locker* lockState); @@ -398,7 +402,8 @@ public: * writers just call setShouldConflictWithSecondaryBatchApplication(false). */ class ParallelBatchWriterMode { - MONGO_DISALLOW_COPYING(ParallelBatchWriterMode); + ParallelBatchWriterMode(const ParallelBatchWriterMode&) = delete; + ParallelBatchWriterMode& operator=(const ParallelBatchWriterMode&) = delete; public: explicit ParallelBatchWriterMode(Locker* lockState); diff --git a/src/mongo/db/concurrency/deferred_writer.h b/src/mongo/db/concurrency/deferred_writer.h index f855752a570..d573f497851 100644 --- a/src/mongo/db/concurrency/deferred_writer.h +++ b/src/mongo/db/concurrency/deferred_writer.h @@ -57,7 +57,8 @@ class ThreadPool; * improper use of the ctor, `flush` and `shutdown` methods below. */ class DeferredWriter { - MONGO_DISALLOW_COPYING(DeferredWriter); + DeferredWriter(const DeferredWriter&) = delete; + DeferredWriter& operator=(const DeferredWriter&) = delete; public: /** diff --git a/src/mongo/db/concurrency/lock_manager.h b/src/mongo/db/concurrency/lock_manager.h index 737435334bb..ab113b48aad 100644 --- a/src/mongo/db/concurrency/lock_manager.h +++ b/src/mongo/db/concurrency/lock_manager.h @@ -52,7 +52,8 @@ namespace mongo { * instead go through the Locker interface. */ class LockManager { - MONGO_DISALLOW_COPYING(LockManager); + LockManager(const LockManager&) = delete; + LockManager& operator=(const LockManager&) = delete; public: LockManager(); diff --git a/src/mongo/db/concurrency/lock_state.cpp b/src/mongo/db/concurrency/lock_state.cpp index ab49d9f878e..225e563fe6e 100644 --- a/src/mongo/db/concurrency/lock_state.cpp +++ b/src/mongo/db/concurrency/lock_state.cpp @@ -59,7 +59,8 @@ namespace { * Partitioned global lock statistics, so we don't hit the same bucket. */ class PartitionedInstanceWideLockStats { - MONGO_DISALLOW_COPYING(PartitionedInstanceWideLockStats); + PartitionedInstanceWideLockStats(const PartitionedInstanceWideLockStats&) = delete; + PartitionedInstanceWideLockStats& operator=(const PartitionedInstanceWideLockStats&) = delete; public: PartitionedInstanceWideLockStats() {} diff --git a/src/mongo/db/concurrency/lock_state.h b/src/mongo/db/concurrency/lock_state.h index b9ecdc3cbfd..f7659dc9b4b 100644 --- a/src/mongo/db/concurrency/lock_state.h +++ b/src/mongo/db/concurrency/lock_state.h @@ -44,7 +44,8 @@ namespace mongo { * variable, which can be waited on. */ class CondVarLockGrantNotification : public LockGrantNotification { - MONGO_DISALLOW_COPYING(CondVarLockGrantNotification); + CondVarLockGrantNotification(const CondVarLockGrantNotification&) = delete; + CondVarLockGrantNotification& operator=(const CondVarLockGrantNotification&) = delete; public: CondVarLockGrantNotification(); diff --git a/src/mongo/db/concurrency/locker.h b/src/mongo/db/concurrency/locker.h index 158d073ae35..24f9dfbd532 100644 --- a/src/mongo/db/concurrency/locker.h +++ b/src/mongo/db/concurrency/locker.h @@ -46,7 +46,8 @@ namespace mongo { * Lock/unlock methods must always be called from a single thread. */ class Locker { - MONGO_DISALLOW_COPYING(Locker); + Locker(const Locker&) = delete; + Locker& operator=(const Locker&) = delete; friend class UninterruptibleLockGuard; @@ -537,7 +538,10 @@ private: * RAII-style class to opt out of replication's use of ParallelBatchWriterMode. */ class ShouldNotConflictWithSecondaryBatchApplicationBlock { - MONGO_DISALLOW_COPYING(ShouldNotConflictWithSecondaryBatchApplicationBlock); + ShouldNotConflictWithSecondaryBatchApplicationBlock( + const ShouldNotConflictWithSecondaryBatchApplicationBlock&) = delete; + ShouldNotConflictWithSecondaryBatchApplicationBlock& operator=( + const ShouldNotConflictWithSecondaryBatchApplicationBlock&) = delete; public: explicit ShouldNotConflictWithSecondaryBatchApplicationBlock(Locker* lockState) diff --git a/src/mongo/db/concurrency/replication_state_transition_lock_guard.h b/src/mongo/db/concurrency/replication_state_transition_lock_guard.h index cbb23bb8a8d..3dc48de025b 100644 --- a/src/mongo/db/concurrency/replication_state_transition_lock_guard.h +++ b/src/mongo/db/concurrency/replication_state_transition_lock_guard.h @@ -31,7 +31,6 @@ #include <boost/optional.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/db/concurrency/lock_manager_defs.h" #include "mongo/util/time_support.h" @@ -46,7 +45,9 @@ namespace repl { * that need to happen in between enqueuing the RSTL request and waiting for it to be granted. */ class ReplicationStateTransitionLockGuard { - MONGO_DISALLOW_COPYING(ReplicationStateTransitionLockGuard); + ReplicationStateTransitionLockGuard(const ReplicationStateTransitionLockGuard&) = delete; + ReplicationStateTransitionLockGuard& operator=(const ReplicationStateTransitionLockGuard&) = + delete; public: class EnqueueOnly {}; diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index 5208639bc93..cb18faa1337 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -37,7 +37,6 @@ #include <iomanip> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/mutable/document.h" #include "mongo/db/auth/authorization_session.h" #include "mongo/db/client.h" @@ -147,7 +146,8 @@ BSONObj upconvertGetMoreEntry(const NamespaceString& nss, CursorId cursorId, int * The stack itself is represented in the _parent pointers of the CurOp class. */ class CurOp::CurOpStack { - MONGO_DISALLOW_COPYING(CurOpStack); + CurOpStack(const CurOpStack&) = delete; + CurOpStack& operator=(const CurOpStack&) = delete; public: CurOpStack() : _base(nullptr, this) {} diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h index 26b295e45a6..b450928814b 100644 --- a/src/mongo/db/curop.h +++ b/src/mongo/db/curop.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/clientcursor.h" #include "mongo/db/commands.h" #include "mongo/db/cursor_id.h" @@ -221,7 +220,8 @@ public: * any synchronization. */ class CurOp { - MONGO_DISALLOW_COPYING(CurOp); + CurOp(const CurOp&) = delete; + CurOp& operator=(const CurOp&) = delete; public: static CurOp* get(const OperationContext* opCtx); diff --git a/src/mongo/db/database_index_builds_tracker.h b/src/mongo/db/database_index_builds_tracker.h index 000a58d9bde..b91ab826527 100644 --- a/src/mongo/db/database_index_builds_tracker.h +++ b/src/mongo/db/database_index_builds_tracker.h @@ -32,7 +32,6 @@ #include <map> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl_index_build_state.h" #include "mongo/stdx/condition_variable.h" #include "mongo/util/concurrency/with_lock.h" diff --git a/src/mongo/db/db_raii.h b/src/mongo/db/db_raii.h index fbcb12f2bca..e6293022bf7 100644 --- a/src/mongo/db/db_raii.h +++ b/src/mongo/db/db_raii.h @@ -43,7 +43,8 @@ namespace mongo { * desired. */ class AutoStatsTracker { - MONGO_DISALLOW_COPYING(AutoStatsTracker); + AutoStatsTracker(const AutoStatsTracker&) = delete; + AutoStatsTracker& operator=(const AutoStatsTracker&) = delete; public: /** @@ -94,7 +95,8 @@ private: * snapshot to become available. */ class AutoGetCollectionForRead { - MONGO_DISALLOW_COPYING(AutoGetCollectionForRead); + AutoGetCollectionForRead(const AutoGetCollectionForRead&) = delete; + AutoGetCollectionForRead& operator=(const AutoGetCollectionForRead&) = delete; public: AutoGetCollectionForRead( @@ -149,7 +151,8 @@ private: * ensure the CurrentOp object has the right namespace and has started its timer. */ class AutoGetCollectionForReadCommand { - MONGO_DISALLOW_COPYING(AutoGetCollectionForReadCommand); + AutoGetCollectionForReadCommand(const AutoGetCollectionForReadCommand&) = delete; + AutoGetCollectionForReadCommand& operator=(const AutoGetCollectionForReadCommand&) = delete; public: AutoGetCollectionForReadCommand( @@ -185,7 +188,8 @@ private: * current operation. */ class OldClientContext { - MONGO_DISALLOW_COPYING(OldClientContext); + OldClientContext(const OldClientContext&) = delete; + OldClientContext& operator=(const OldClientContext&) = delete; public: OldClientContext(OperationContext* opCtx, const std::string& ns, bool doVersion = true); diff --git a/src/mongo/db/dbdirectclient.cpp b/src/mongo/db/dbdirectclient.cpp index f0609042f37..0b0671b4ecf 100644 --- a/src/mongo/db/dbdirectclient.cpp +++ b/src/mongo/db/dbdirectclient.cpp @@ -54,7 +54,8 @@ using std::string; namespace { class DirectClientScope { - MONGO_DISALLOW_COPYING(DirectClientScope); + DirectClientScope(const DirectClientScope&) = delete; + DirectClientScope& operator=(const DirectClientScope&) = delete; public: explicit DirectClientScope(OperationContext* opCtx) diff --git a/src/mongo/db/dbmessage.h b/src/mongo/db/dbmessage.h index ad203c21ae2..69fdfd7375a 100644 --- a/src/mongo/db/dbmessage.h +++ b/src/mongo/db/dbmessage.h @@ -452,7 +452,8 @@ struct DbResponse { * command responses that don't use the new dbMsg protocol. */ class OpQueryReplyBuilder { - MONGO_DISALLOW_COPYING(OpQueryReplyBuilder); + OpQueryReplyBuilder(const OpQueryReplyBuilder&) = delete; + OpQueryReplyBuilder& operator=(const OpQueryReplyBuilder&) = delete; public: OpQueryReplyBuilder(); diff --git a/src/mongo/db/exec/delete.h b/src/mongo/db/exec/delete.h index b36067d0bd1..139239d9de0 100644 --- a/src/mongo/db/exec/delete.h +++ b/src/mongo/db/exec/delete.h @@ -95,7 +95,8 @@ struct DeleteStageParams { * had the replication coordinator approve the write). */ class DeleteStage final : public RequiresMutableCollectionStage { - MONGO_DISALLOW_COPYING(DeleteStage); + DeleteStage(const DeleteStage&) = delete; + DeleteStage& operator=(const DeleteStage&) = delete; public: DeleteStage(OperationContext* opCtx, diff --git a/src/mongo/db/exec/plan_stats.h b/src/mongo/db/exec/plan_stats.h index fb66bd4431e..da1f5b998d1 100644 --- a/src/mongo/db/exec/plan_stats.h +++ b/src/mongo/db/exec/plan_stats.h @@ -34,7 +34,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/index/multikey_paths.h" #include "mongo/db/jsobj.h" #include "mongo/db/query/stage_types.h" @@ -133,7 +132,8 @@ struct PlanStageStats { std::vector<std::unique_ptr<PlanStageStats>> children; private: - MONGO_DISALLOW_COPYING(PlanStageStats); + PlanStageStats(const PlanStageStats&) = delete; + PlanStageStats& operator=(const PlanStageStats&) = delete; }; struct AndHashStats : public SpecificStats { diff --git a/src/mongo/db/exec/scoped_timer.h b/src/mongo/db/exec/scoped_timer.h index 660bb8d7daa..33ddb192873 100644 --- a/src/mongo/db/exec/scoped_timer.h +++ b/src/mongo/db/exec/scoped_timer.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/util/time_support.h" @@ -42,7 +41,8 @@ class ClockSource; * construction when it goes out of scope. */ class ScopedTimer { - MONGO_DISALLOW_COPYING(ScopedTimer); + ScopedTimer(const ScopedTimer&) = delete; + ScopedTimer& operator=(const ScopedTimer&) = delete; public: ScopedTimer(ClockSource* cs, long long* counter); diff --git a/src/mongo/db/exec/subplan.h b/src/mongo/db/exec/subplan.h index 62ac89d6644..f07d8f5815c 100644 --- a/src/mongo/db/exec/subplan.h +++ b/src/mongo/db/exec/subplan.h @@ -132,7 +132,8 @@ private: * a particular $or branch. */ struct BranchPlanningResult { - MONGO_DISALLOW_COPYING(BranchPlanningResult); + BranchPlanningResult(const BranchPlanningResult&) = delete; + BranchPlanningResult& operator=(const BranchPlanningResult&) = delete; public: BranchPlanningResult() {} diff --git a/src/mongo/db/exec/update_stage.h b/src/mongo/db/exec/update_stage.h index 1a37554bee2..457e9e550d0 100644 --- a/src/mongo/db/exec/update_stage.h +++ b/src/mongo/db/exec/update_stage.h @@ -77,7 +77,8 @@ private: * Callers of doWork() must be holding a write lock. */ class UpdateStage final : public RequiresMutableCollectionStage { - MONGO_DISALLOW_COPYING(UpdateStage); + UpdateStage(const UpdateStage&) = delete; + UpdateStage& operator=(const UpdateStage&) = delete; public: UpdateStage(OperationContext* opCtx, diff --git a/src/mongo/db/exec/working_set.h b/src/mongo/db/exec/working_set.h index 248ab944517..fc6a228036d 100644 --- a/src/mongo/db/exec/working_set.h +++ b/src/mongo/db/exec/working_set.h @@ -32,7 +32,6 @@ #include "boost/optional.hpp" #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/jsobj.h" #include "mongo/db/record_id.h" #include "mongo/db/storage/snapshot.h" @@ -51,7 +50,8 @@ typedef size_t WorkingSetID; * from the working set, or mutate elements in the working set. */ class WorkingSet { - MONGO_DISALLOW_COPYING(WorkingSet); + WorkingSet(const WorkingSet&) = delete; + WorkingSet& operator=(const WorkingSet&) = delete; public: static const WorkingSetID INVALID_ID = WorkingSetID(-1); @@ -208,7 +208,8 @@ enum WorkingSetComputedDataType { * Data that is a computed function of a WSM. */ class WorkingSetComputedData { - MONGO_DISALLOW_COPYING(WorkingSetComputedData); + WorkingSetComputedData(const WorkingSetComputedData&) = delete; + WorkingSetComputedData& operator=(const WorkingSetComputedData&) = delete; public: WorkingSetComputedData(const WorkingSetComputedDataType type) : _type(type) {} @@ -234,7 +235,8 @@ private: * A WorkingSetMember may have any of the data above. */ class WorkingSetMember { - MONGO_DISALLOW_COPYING(WorkingSetMember); + WorkingSetMember(const WorkingSetMember&) = delete; + WorkingSetMember& operator=(const WorkingSetMember&) = delete; public: WorkingSetMember(); diff --git a/src/mongo/db/field_ref_set.h b/src/mongo/db/field_ref_set.h index 795799f70f5..63166acbc89 100644 --- a/src/mongo/db/field_ref_set.h +++ b/src/mongo/db/field_ref_set.h @@ -32,7 +32,6 @@ #include <set> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/owned_pointer_vector.h" #include "mongo/base/status.h" #include "mongo/db/field_ref.h" @@ -50,7 +49,8 @@ namespace mongo { * FieldRefSets do not own the FieldRef paths they contain. */ class FieldRefSet { - MONGO_DISALLOW_COPYING(FieldRefSet); + FieldRefSet(const FieldRefSet&) = delete; + FieldRefSet& operator=(const FieldRefSet&) = delete; struct FieldRefPtrLessThan { bool operator()(const FieldRef* lhs, const FieldRef* rhs) const; diff --git a/src/mongo/db/free_mon/free_mon_op_observer.h b/src/mongo/db/free_mon/free_mon_op_observer.h index 0a2ca1ca1e7..7b17ebd014b 100644 --- a/src/mongo/db/free_mon/free_mon_op_observer.h +++ b/src/mongo/db/free_mon/free_mon_op_observer.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/op_observer.h" namespace mongo { @@ -39,7 +38,8 @@ namespace mongo { * relevant entries for free monitoring. */ class FreeMonOpObserver final : public OpObserver { - MONGO_DISALLOW_COPYING(FreeMonOpObserver); + FreeMonOpObserver(const FreeMonOpObserver&) = delete; + FreeMonOpObserver& operator=(const FreeMonOpObserver&) = delete; public: FreeMonOpObserver(); diff --git a/src/mongo/db/ftdc/block_compressor.h b/src/mongo/db/ftdc/block_compressor.h index 3d1fb8da101..2b2173d09b7 100644 --- a/src/mongo/db/ftdc/block_compressor.h +++ b/src/mongo/db/ftdc/block_compressor.h @@ -33,7 +33,6 @@ #include <vector> #include "mongo/base/data_range.h" -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" namespace mongo { @@ -42,7 +41,8 @@ namespace mongo { * Compesses and uncompresses a block of buffer using zlib. */ class BlockCompressor { - MONGO_DISALLOW_COPYING(BlockCompressor); + BlockCompressor(const BlockCompressor&) = delete; + BlockCompressor& operator=(const BlockCompressor&) = delete; public: BlockCompressor() = default; diff --git a/src/mongo/db/ftdc/collector.h b/src/mongo/db/ftdc/collector.h index 2e56318d588..d422abfc1e8 100644 --- a/src/mongo/db/ftdc/collector.h +++ b/src/mongo/db/ftdc/collector.h @@ -33,7 +33,6 @@ #include <tuple> #include <vector> -#include "mongo/base/disallow_copying.h" namespace mongo { @@ -49,7 +48,8 @@ class OperationContext; * Provides an interface to collect BSONObjs from system providers */ class FTDCCollectorInterface { - MONGO_DISALLOW_COPYING(FTDCCollectorInterface); + FTDCCollectorInterface(const FTDCCollectorInterface&) = delete; + FTDCCollectorInterface& operator=(const FTDCCollectorInterface&) = delete; public: virtual ~FTDCCollectorInterface() = default; @@ -79,7 +79,8 @@ protected: * Not Thread-Safe. Locking is owner's responsibility. */ class FTDCCollectorCollection { - MONGO_DISALLOW_COPYING(FTDCCollectorCollection); + FTDCCollectorCollection(const FTDCCollectorCollection&) = delete; + FTDCCollectorCollection& operator=(const FTDCCollectorCollection&) = delete; public: FTDCCollectorCollection() = default; diff --git a/src/mongo/db/ftdc/compressor.h b/src/mongo/db/ftdc/compressor.h index 400f51f307c..6af25dc20c1 100644 --- a/src/mongo/db/ftdc/compressor.h +++ b/src/mongo/db/ftdc/compressor.h @@ -35,7 +35,6 @@ #include <tuple> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/util/builder.h" #include "mongo/db/ftdc/block_compressor.h" @@ -61,7 +60,8 @@ namespace mongo { * across all documents in the series of documents. */ class FTDCCompressor { - MONGO_DISALLOW_COPYING(FTDCCompressor); + FTDCCompressor(const FTDCCompressor&) = delete; + FTDCCompressor& operator=(const FTDCCompressor&) = delete; public: /** diff --git a/src/mongo/db/ftdc/controller.h b/src/mongo/db/ftdc/controller.h index fafc98cc531..26d76b28ad7 100644 --- a/src/mongo/db/ftdc/controller.h +++ b/src/mongo/db/ftdc/controller.h @@ -33,7 +33,6 @@ #include <cstdint> #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/db/ftdc/collector.h" #include "mongo/db/ftdc/config.h" #include "mongo/db/ftdc/file_manager.h" @@ -53,7 +52,8 @@ class ServiceContext; * Exposes an methods to response to configuration changes in a thread-safe manner. */ class FTDCController { - MONGO_DISALLOW_COPYING(FTDCController); + FTDCController(const FTDCController&) = delete; + FTDCController& operator=(const FTDCController&) = delete; public: FTDCController(const boost::filesystem::path path, FTDCConfig config) diff --git a/src/mongo/db/ftdc/decompressor.h b/src/mongo/db/ftdc/decompressor.h index f8b03aa30bf..7481cf2b4e9 100644 --- a/src/mongo/db/ftdc/decompressor.h +++ b/src/mongo/db/ftdc/decompressor.h @@ -32,7 +32,6 @@ #include <vector> #include "mongo/base/data_range.h" -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/ftdc/block_compressor.h" #include "mongo/db/jsobj.h" @@ -43,7 +42,8 @@ namespace mongo { * Inflates a compressed chunk of metrics into a list of BSON documents */ class FTDCDecompressor { - MONGO_DISALLOW_COPYING(FTDCDecompressor); + FTDCDecompressor(const FTDCDecompressor&) = delete; + FTDCDecompressor& operator=(const FTDCDecompressor&) = delete; public: FTDCDecompressor() = default; diff --git a/src/mongo/db/ftdc/file_manager.h b/src/mongo/db/ftdc/file_manager.h index bf160c69870..ed9a586977e 100644 --- a/src/mongo/db/ftdc/file_manager.h +++ b/src/mongo/db/ftdc/file_manager.h @@ -34,7 +34,6 @@ #include <tuple> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/string_data.h" #include "mongo/db/ftdc/collector.h" @@ -53,7 +52,8 @@ class Client; * Manages file rotation, and directory size management. */ class FTDCFileManager { - MONGO_DISALLOW_COPYING(FTDCFileManager); + FTDCFileManager(const FTDCFileManager&) = delete; + FTDCFileManager& operator=(const FTDCFileManager&) = delete; public: ~FTDCFileManager(); diff --git a/src/mongo/db/ftdc/file_reader.h b/src/mongo/db/ftdc/file_reader.h index b768fcb06ea..caa94bfdc82 100644 --- a/src/mongo/db/ftdc/file_reader.h +++ b/src/mongo/db/ftdc/file_reader.h @@ -35,7 +35,6 @@ #include <stddef.h> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/db/ftdc/decompressor.h" @@ -50,7 +49,8 @@ namespace mongo { * Does not recover interim files into archive files. */ class FTDCFileReader { - MONGO_DISALLOW_COPYING(FTDCFileReader); + FTDCFileReader(const FTDCFileReader&) = delete; + FTDCFileReader& operator=(const FTDCFileReader&) = delete; public: FTDCFileReader() : _state(State::kNeedsDoc) {} diff --git a/src/mongo/db/ftdc/file_writer.h b/src/mongo/db/ftdc/file_writer.h index 5d958e69286..9a7a8fa5e7d 100644 --- a/src/mongo/db/ftdc/file_writer.h +++ b/src/mongo/db/ftdc/file_writer.h @@ -59,7 +59,8 @@ namespace mongo { * File rotation and cleanup is not handled by this class. */ class FTDCFileWriter { - MONGO_DISALLOW_COPYING(FTDCFileWriter); + FTDCFileWriter(const FTDCFileWriter&) = delete; + FTDCFileWriter& operator=(const FTDCFileWriter&) = delete; public: FTDCFileWriter(const FTDCConfig* config) : _config(config), _compressor(_config) {} diff --git a/src/mongo/db/fts/fts_basic_phrase_matcher.h b/src/mongo/db/fts/fts_basic_phrase_matcher.h index 3784b50e616..dfab41a6119 100644 --- a/src/mongo/db/fts/fts_basic_phrase_matcher.h +++ b/src/mongo/db/fts/fts_basic_phrase_matcher.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/fts/fts_phrase_matcher.h" namespace mongo { @@ -41,7 +40,8 @@ namespace fts { * operations are inherently diacritic sensitive. */ class BasicFTSPhraseMatcher final : public FTSPhraseMatcher { - MONGO_DISALLOW_COPYING(BasicFTSPhraseMatcher); + BasicFTSPhraseMatcher(const BasicFTSPhraseMatcher&) = delete; + BasicFTSPhraseMatcher& operator=(const BasicFTSPhraseMatcher&) = delete; public: BasicFTSPhraseMatcher() = default; diff --git a/src/mongo/db/fts/fts_basic_tokenizer.h b/src/mongo/db/fts/fts_basic_tokenizer.h index c9f8f61e0ec..d3f7851034e 100644 --- a/src/mongo/db/fts/fts_basic_tokenizer.h +++ b/src/mongo/db/fts/fts_basic_tokenizer.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/db/fts/fts_tokenizer.h" #include "mongo/db/fts/stemmer.h" @@ -58,7 +57,8 @@ class StopWords; * generated by the BasicFTSTokenizer are ineherently diacritic sensitive. */ class BasicFTSTokenizer final : public FTSTokenizer { - MONGO_DISALLOW_COPYING(BasicFTSTokenizer); + BasicFTSTokenizer(const BasicFTSTokenizer&) = delete; + BasicFTSTokenizer& operator=(const BasicFTSTokenizer&) = delete; public: BasicFTSTokenizer(const FTSLanguage* language); diff --git a/src/mongo/db/fts/fts_language.h b/src/mongo/db/fts/fts_language.h index a15adedb8e1..47a6ab2213d 100644 --- a/src/mongo/db/fts/fts_language.h +++ b/src/mongo/db/fts/fts_language.h @@ -69,7 +69,8 @@ class FTSTokenizer; */ class FTSLanguage { // Use make() instead of copying. - MONGO_DISALLOW_COPYING(FTSLanguage); + FTSLanguage(const FTSLanguage&) = delete; + FTSLanguage& operator=(const FTSLanguage&) = delete; public: /** Create an uninitialized language. */ diff --git a/src/mongo/db/fts/fts_matcher.h b/src/mongo/db/fts/fts_matcher.h index 91eecf0d7e5..5dbcc981109 100644 --- a/src/mongo/db/fts/fts_matcher.h +++ b/src/mongo/db/fts/fts_matcher.h @@ -39,7 +39,8 @@ namespace mongo { namespace fts { class FTSMatcher { - MONGO_DISALLOW_COPYING(FTSMatcher); + FTSMatcher(const FTSMatcher&) = delete; + FTSMatcher& operator=(const FTSMatcher&) = delete; public: FTSMatcher(const FTSQueryImpl& query, const FTSSpec& spec); diff --git a/src/mongo/db/fts/fts_query_parser.h b/src/mongo/db/fts/fts_query_parser.h index f607cef719c..f4bab3e7e1c 100644 --- a/src/mongo/db/fts/fts_query_parser.h +++ b/src/mongo/db/fts/fts_query_parser.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" namespace mongo { @@ -69,7 +68,8 @@ struct QueryToken { * SPECIAL_CHARS = '-' | ' ' | '"' */ class FTSQueryParser { - MONGO_DISALLOW_COPYING(FTSQueryParser); + FTSQueryParser(const FTSQueryParser&) = delete; + FTSQueryParser& operator=(const FTSQueryParser&) = delete; public: FTSQueryParser(StringData str); diff --git a/src/mongo/db/fts/fts_tokenizer.h b/src/mongo/db/fts/fts_tokenizer.h index 8d2c08727a1..cae883b7b09 100644 --- a/src/mongo/db/fts/fts_tokenizer.h +++ b/src/mongo/db/fts/fts_tokenizer.h @@ -32,7 +32,6 @@ #include <cstdint> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" namespace mongo { diff --git a/src/mongo/db/fts/fts_unicode_phrase_matcher.h b/src/mongo/db/fts/fts_unicode_phrase_matcher.h index bf3d16b71aa..de3ad3c11c8 100644 --- a/src/mongo/db/fts/fts_unicode_phrase_matcher.h +++ b/src/mongo/db/fts/fts_unicode_phrase_matcher.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/fts/fts_phrase_matcher.h" #include "mongo/db/fts/unicode/codepoints.h" @@ -48,7 +47,8 @@ class FTSLanguage; * case fold mapping), the phrase matcher will take that into account. */ class UnicodeFTSPhraseMatcher final : public FTSPhraseMatcher { - MONGO_DISALLOW_COPYING(UnicodeFTSPhraseMatcher); + UnicodeFTSPhraseMatcher(const UnicodeFTSPhraseMatcher&) = delete; + UnicodeFTSPhraseMatcher& operator=(const UnicodeFTSPhraseMatcher&) = delete; public: UnicodeFTSPhraseMatcher(const std::string& language); diff --git a/src/mongo/db/fts/fts_unicode_tokenizer.h b/src/mongo/db/fts/fts_unicode_tokenizer.h index cededf1e4b7..0745e11ad07 100644 --- a/src/mongo/db/fts/fts_unicode_tokenizer.h +++ b/src/mongo/db/fts/fts_unicode_tokenizer.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/db/fts/fts_tokenizer.h" #include "mongo/db/fts/stemmer.h" @@ -56,7 +55,8 @@ class StopWords; * Optionally supports returning case sensitive search terms. */ class UnicodeFTSTokenizer final : public FTSTokenizer { - MONGO_DISALLOW_COPYING(UnicodeFTSTokenizer); + UnicodeFTSTokenizer(const UnicodeFTSTokenizer&) = delete; + UnicodeFTSTokenizer& operator=(const UnicodeFTSTokenizer&) = delete; public: UnicodeFTSTokenizer(const FTSLanguage* language); diff --git a/src/mongo/db/fts/stemmer.h b/src/mongo/db/fts/stemmer.h index e5b7d3c1158..a5a15174a94 100644 --- a/src/mongo/db/fts/stemmer.h +++ b/src/mongo/db/fts/stemmer.h @@ -44,7 +44,8 @@ namespace fts { * running/Running -> run/Run */ class Stemmer { - MONGO_DISALLOW_COPYING(Stemmer); + Stemmer(const Stemmer&) = delete; + Stemmer& operator=(const Stemmer&) = delete; public: Stemmer(const FTSLanguage* language); diff --git a/src/mongo/db/fts/stop_words.h b/src/mongo/db/fts/stop_words.h index 81d683aec8d..22835300226 100644 --- a/src/mongo/db/fts/stop_words.h +++ b/src/mongo/db/fts/stop_words.h @@ -41,7 +41,8 @@ namespace mongo { namespace fts { class StopWords { - MONGO_DISALLOW_COPYING(StopWords); + StopWords(const StopWords&) = delete; + StopWords& operator=(const StopWords&) = delete; public: StopWords(); diff --git a/src/mongo/db/fts/tokenizer.h b/src/mongo/db/fts/tokenizer.h index 68b8afb2881..1a0e79d9425 100644 --- a/src/mongo/db/fts/tokenizer.h +++ b/src/mongo/db/fts/tokenizer.h @@ -53,7 +53,8 @@ struct Token { }; class Tokenizer { - MONGO_DISALLOW_COPYING(Tokenizer); + Tokenizer(const Tokenizer&) = delete; + Tokenizer& operator=(const Tokenizer&) = delete; public: Tokenizer(const FTSLanguage* language, StringData str); diff --git a/src/mongo/db/geo/geometry_container.h b/src/mongo/db/geo/geometry_container.h index 0176eb04b18..971b55462ab 100644 --- a/src/mongo/db/geo/geometry_container.h +++ b/src/mongo/db/geo/geometry_container.h @@ -31,14 +31,14 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/db/geo/shapes.h" #include "third_party/s2/s2regionunion.h" namespace mongo { class GeometryContainer { - MONGO_DISALLOW_COPYING(GeometryContainer); + GeometryContainer(const GeometryContainer&) = delete; + GeometryContainer& operator=(const GeometryContainer&) = delete; public: /** diff --git a/src/mongo/db/hasher.cpp b/src/mongo/db/hasher.cpp index 1dbb65a12ae..731500afa40 100644 --- a/src/mongo/db/hasher.cpp +++ b/src/mongo/db/hasher.cpp @@ -47,7 +47,8 @@ namespace { typedef unsigned char HashDigest[16]; class Hasher { - MONGO_DISALLOW_COPYING(Hasher); + Hasher(const Hasher&) = delete; + Hasher& operator=(const Hasher&) = delete; public: explicit Hasher(HashSeed seed); diff --git a/src/mongo/db/hasher.h b/src/mongo/db/hasher.h index cf70b42f154..c35eac19d56 100644 --- a/src/mongo/db/hasher.h +++ b/src/mongo/db/hasher.h @@ -34,7 +34,6 @@ */ -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonelement.h" namespace mongo { @@ -42,7 +41,8 @@ namespace mongo { typedef int HashSeed; class BSONElementHasher { - MONGO_DISALLOW_COPYING(BSONElementHasher); + BSONElementHasher(const BSONElementHasher&) = delete; + BSONElementHasher& operator=(const BSONElementHasher&) = delete; public: /* The hash function we use can be given a seed, to effectively randomize it diff --git a/src/mongo/db/index/duplicate_key_tracker.h b/src/mongo/db/index/duplicate_key_tracker.h index 3879cdb3486..c5399620984 100644 --- a/src/mongo/db/index/duplicate_key_tracker.h +++ b/src/mongo/db/index/duplicate_key_tracker.h @@ -32,7 +32,6 @@ #include <cstdint> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonobj.h" #include "mongo/db/catalog/index_catalog_entry.h" #include "mongo/db/operation_context.h" @@ -47,7 +46,8 @@ class IndexCatalogEntry; * by a temporary table that is created and destroyed by this tracker. */ class DuplicateKeyTracker { - MONGO_DISALLOW_COPYING(DuplicateKeyTracker); + DuplicateKeyTracker(const DuplicateKeyTracker&) = delete; + DuplicateKeyTracker& operator=(const DuplicateKeyTracker&) = delete; public: /** diff --git a/src/mongo/db/index/index_access_method.h b/src/mongo/db/index/index_access_method.h index 079af617fa1..527e73ed146 100644 --- a/src/mongo/db/index/index_access_method.h +++ b/src/mongo/db/index/index_access_method.h @@ -33,7 +33,6 @@ #include <memory> #include <set> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/simple_bsonobj_comparator.h" #include "mongo/db/field_ref.h" #include "mongo/db/index/index_descriptor.h" @@ -65,7 +64,8 @@ bool failIndexKeyTooLongParam(); * */ class IndexAccessMethod { - MONGO_DISALLOW_COPYING(IndexAccessMethod); + IndexAccessMethod(const IndexAccessMethod&) = delete; + IndexAccessMethod& operator=(const IndexAccessMethod&) = delete; public: IndexAccessMethod() = default; @@ -433,7 +433,8 @@ struct InsertDeleteOptions { * dependencies, it is important that IndexAccessMethod remain an interface. */ class AbstractIndexAccessMethod : public IndexAccessMethod { - MONGO_DISALLOW_COPYING(AbstractIndexAccessMethod); + AbstractIndexAccessMethod(const AbstractIndexAccessMethod&) = delete; + AbstractIndexAccessMethod& operator=(const AbstractIndexAccessMethod&) = delete; public: /** diff --git a/src/mongo/db/index_builds_coordinator.h b/src/mongo/db/index_builds_coordinator.h index d49178017da..03dc441d3d7 100644 --- a/src/mongo/db/index_builds_coordinator.h +++ b/src/mongo/db/index_builds_coordinator.h @@ -458,7 +458,8 @@ protected: * builds should be scheduled. */ class ScopedStopNewDatabaseIndexBuilds { - MONGO_DISALLOW_COPYING(ScopedStopNewDatabaseIndexBuilds); + ScopedStopNewDatabaseIndexBuilds(const ScopedStopNewDatabaseIndexBuilds&) = delete; + ScopedStopNewDatabaseIndexBuilds& operator=(const ScopedStopNewDatabaseIndexBuilds&) = delete; public: /** @@ -488,7 +489,9 @@ private: * builds should be scheduled. */ class ScopedStopNewCollectionIndexBuilds { - MONGO_DISALLOW_COPYING(ScopedStopNewCollectionIndexBuilds); + ScopedStopNewCollectionIndexBuilds(const ScopedStopNewCollectionIndexBuilds&) = delete; + ScopedStopNewCollectionIndexBuilds& operator=(const ScopedStopNewCollectionIndexBuilds&) = + delete; public: /** diff --git a/src/mongo/db/index_builds_coordinator_mongod.h b/src/mongo/db/index_builds_coordinator_mongod.h index 109e53eb028..03b5884cce3 100644 --- a/src/mongo/db/index_builds_coordinator_mongod.h +++ b/src/mongo/db/index_builds_coordinator_mongod.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/index_builds_coordinator.h" #include "mongo/util/concurrency/thread_pool.h" @@ -48,7 +47,8 @@ class ServiceContext; * accessible via the ServiceContext. */ class IndexBuildsCoordinatorMongod : public IndexBuildsCoordinator { - MONGO_DISALLOW_COPYING(IndexBuildsCoordinatorMongod); + IndexBuildsCoordinatorMongod(const IndexBuildsCoordinatorMongod&) = delete; + IndexBuildsCoordinatorMongod& operator=(const IndexBuildsCoordinatorMongod&) = delete; public: /** diff --git a/src/mongo/db/matcher/expression.h b/src/mongo/db/matcher/expression.h index 9607dce1963..e3e3d652b4a 100644 --- a/src/mongo/db/matcher/expression.h +++ b/src/mongo/db/matcher/expression.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/bson/bsonobj.h" #include "mongo/bson/bsonobjbuilder.h" @@ -56,7 +55,8 @@ class TreeMatchExpression; typedef StatusWith<std::unique_ptr<MatchExpression>> StatusWithMatchExpression; class MatchExpression { - MONGO_DISALLOW_COPYING(MatchExpression); + MatchExpression(const MatchExpression&) = delete; + MatchExpression& operator=(const MatchExpression&) = delete; public: enum MatchType { diff --git a/src/mongo/db/matcher/expression_geo.h b/src/mongo/db/matcher/expression_geo.h index 37f4727bb1a..6d38f7fe320 100644 --- a/src/mongo/db/matcher/expression_geo.h +++ b/src/mongo/db/matcher/expression_geo.h @@ -42,7 +42,8 @@ class GeometryContainer; // This represents either a $within or a $geoIntersects. class GeoExpression { - MONGO_DISALLOW_COPYING(GeoExpression); + GeoExpression(const GeoExpression&) = delete; + GeoExpression& operator=(const GeoExpression&) = delete; public: GeoExpression(); @@ -123,7 +124,8 @@ private: // TODO: Make a struct, turn parse stuff into something like // static Status parseNearQuery(const BSONObj& obj, NearQuery** out); class GeoNearExpression { - MONGO_DISALLOW_COPYING(GeoNearExpression); + GeoNearExpression(const GeoNearExpression&) = delete; + GeoNearExpression& operator=(const GeoNearExpression&) = delete; public: GeoNearExpression(); diff --git a/src/mongo/db/matcher/matcher.h b/src/mongo/db/matcher/matcher.h index 5f28a70b921..ae39f597bf3 100644 --- a/src/mongo/db/matcher/matcher.h +++ b/src/mongo/db/matcher/matcher.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/bson/bsonobj.h" #include "mongo/db/matcher/expression.h" @@ -47,7 +46,8 @@ class CollatorInterface; * Matcher is a simple wrapper around a BSONObj and the MatchExpression created from it. */ class Matcher { - MONGO_DISALLOW_COPYING(Matcher); + Matcher(const Matcher&) = delete; + Matcher& operator=(const Matcher&) = delete; public: /** diff --git a/src/mongo/db/op_observer.h b/src/mongo/db/op_observer.h index dadbe435cc5..729908a287e 100644 --- a/src/mongo/db/op_observer.h +++ b/src/mongo/db/op_observer.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/simple_bsonobj_comparator.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/collection_options.h" diff --git a/src/mongo/db/op_observer_impl.h b/src/mongo/db/op_observer_impl.h index b2a4d52a223..29b319d77c7 100644 --- a/src/mongo/db/op_observer_impl.h +++ b/src/mongo/db/op_observer_impl.h @@ -34,7 +34,8 @@ namespace mongo { class OpObserverImpl : public OpObserver { - MONGO_DISALLOW_COPYING(OpObserverImpl); + OpObserverImpl(const OpObserverImpl&) = delete; + OpObserverImpl& operator=(const OpObserverImpl&) = delete; public: OpObserverImpl() = default; diff --git a/src/mongo/db/op_observer_registry.h b/src/mongo/db/op_observer_registry.h index d1c0713ab7d..a930b9aa608 100644 --- a/src/mongo/db/op_observer_registry.h +++ b/src/mongo/db/op_observer_registry.h @@ -45,7 +45,8 @@ namespace mongo { * handler with the recovery unit. */ class OpObserverRegistry final : public OpObserver { - MONGO_DISALLOW_COPYING(OpObserverRegistry); + OpObserverRegistry(const OpObserverRegistry&) = delete; + OpObserverRegistry& operator=(const OpObserverRegistry&) = delete; public: OpObserverRegistry() = default; diff --git a/src/mongo/db/operation_context.h b/src/mongo/db/operation_context.h index ffa9678d7a0..07a72c9a03d 100644 --- a/src/mongo/db/operation_context.h +++ b/src/mongo/db/operation_context.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/client.h" #include "mongo/db/concurrency/locker.h" @@ -74,7 +73,8 @@ class UnreplicatedWritesBlock; * RecoveryUnit and to allow better invariant checking. */ class OperationContext : public Interruptible, public Decorable<OperationContext> { - MONGO_DISALLOW_COPYING(OperationContext); + OperationContext(const OperationContext&) = delete; + OperationContext& operator=(const OperationContext&) = delete; public: OperationContext(Client* client, unsigned int opId); @@ -479,7 +479,8 @@ namespace repl { * object is in scope. */ class UnreplicatedWritesBlock { - MONGO_DISALLOW_COPYING(UnreplicatedWritesBlock); + UnreplicatedWritesBlock(const UnreplicatedWritesBlock&) = delete; + UnreplicatedWritesBlock& operator=(const UnreplicatedWritesBlock&) = delete; public: UnreplicatedWritesBlock(OperationContext* opCtx) diff --git a/src/mongo/db/ops/delete_request.h b/src/mongo/db/ops/delete_request.h index 1461bbf36b7..23b3bc81e42 100644 --- a/src/mongo/db/ops/delete_request.h +++ b/src/mongo/db/ops/delete_request.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/db/jsobj.h" #include "mongo/db/namespace_string.h" #include "mongo/db/query/plan_executor.h" @@ -39,7 +38,8 @@ namespace mongo { class DeleteRequest { - MONGO_DISALLOW_COPYING(DeleteRequest); + DeleteRequest(const DeleteRequest&) = delete; + DeleteRequest& operator=(const DeleteRequest&) = delete; public: explicit DeleteRequest(const NamespaceString& nsString) diff --git a/src/mongo/db/ops/parsed_delete.h b/src/mongo/db/ops/parsed_delete.h index ae83fe9a783..73f4bef19e4 100644 --- a/src/mongo/db/ops/parsed_delete.h +++ b/src/mongo/db/ops/parsed_delete.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/query/plan_executor.h" @@ -55,7 +54,8 @@ class OperationContext; * No locks need to be held during parsing. */ class ParsedDelete { - MONGO_DISALLOW_COPYING(ParsedDelete); + ParsedDelete(const ParsedDelete&) = delete; + ParsedDelete& operator=(const ParsedDelete&) = delete; public: /** diff --git a/src/mongo/db/ops/parsed_update.h b/src/mongo/db/ops/parsed_update.h index 77220b5211f..da983db9f1f 100644 --- a/src/mongo/db/ops/parsed_update.h +++ b/src/mongo/db/ops/parsed_update.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/matcher/expression_with_placeholder.h" #include "mongo/db/query/collation/collator_interface.h" @@ -57,7 +56,8 @@ class UpdateRequest; * using the UpdateDriver. */ class ParsedUpdate { - MONGO_DISALLOW_COPYING(ParsedUpdate); + ParsedUpdate(const ParsedUpdate&) = delete; + ParsedUpdate& operator=(const ParsedUpdate&) = delete; public: /** diff --git a/src/mongo/db/pipeline/document.h b/src/mongo/db/pipeline/document.h index 7efd5994ff7..0c64c108329 100644 --- a/src/mongo/db/pipeline/document.h +++ b/src/mongo/db/pipeline/document.h @@ -412,7 +412,8 @@ private: * Documents. */ class MutableDocument { - MONGO_DISALLOW_COPYING(MutableDocument); + MutableDocument(const MutableDocument&) = delete; + MutableDocument& operator=(const MutableDocument&) = delete; public: /** Create a new empty Document. diff --git a/src/mongo/db/pipeline/document_internal.h b/src/mongo/db/pipeline/document_internal.h index 5069927b80e..b5030b77693 100644 --- a/src/mongo/db/pipeline/document_internal.h +++ b/src/mongo/db/pipeline/document_internal.h @@ -76,7 +76,8 @@ private: * Internal class. Consumers shouldn't care about this. */ class ValueElement { - MONGO_DISALLOW_COPYING(ValueElement); + ValueElement(const ValueElement&) = delete; + ValueElement& operator=(const ValueElement&) = delete; public: Value val; diff --git a/src/mongo/db/pipeline/document_source_change_stream_transform.h b/src/mongo/db/pipeline/document_source_change_stream_transform.h index 51049050505..ca1003128fd 100644 --- a/src/mongo/db/pipeline/document_source_change_stream_transform.h +++ b/src/mongo/db/pipeline/document_source_change_stream_transform.h @@ -90,7 +90,8 @@ private: * which was created as part of a transaction. */ struct TransactionContext { - MONGO_DISALLOW_COPYING(TransactionContext); + TransactionContext(const TransactionContext&) = delete; + TransactionContext& operator=(const TransactionContext&) = delete; // The array of oplog entries from an 'applyOps' representing the transaction. Only kept // around so that the underlying memory of 'arr' isn't freed. diff --git a/src/mongo/db/pipeline/sequential_document_cache.h b/src/mongo/db/pipeline/sequential_document_cache.h index d54174aa75e..b59c70412b7 100644 --- a/src/mongo/db/pipeline/sequential_document_cache.h +++ b/src/mongo/db/pipeline/sequential_document_cache.h @@ -44,7 +44,8 @@ namespace mongo { * three states: building, serving, or abandoned. See SequentialDocumentCache::CacheStatus. */ class SequentialDocumentCache { - MONGO_DISALLOW_COPYING(SequentialDocumentCache); + SequentialDocumentCache(const SequentialDocumentCache&) = delete; + SequentialDocumentCache& operator=(const SequentialDocumentCache&) = delete; public: explicit SequentialDocumentCache(size_t maxCacheSizeBytes) : _maxSizeBytes(maxCacheSizeBytes) {} diff --git a/src/mongo/db/query/collation/collation_index_key.cpp b/src/mongo/db/query/collation/collation_index_key.cpp index b2407b58ead..3af408e8abd 100644 --- a/src/mongo/db/query/collation/collation_index_key.cpp +++ b/src/mongo/db/query/collation/collation_index_key.cpp @@ -33,7 +33,6 @@ #include <stack> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonobj.h" #include "mongo/bson/bsonobjbuilder.h" #include "mongo/bson/util/builder.h" @@ -49,7 +48,8 @@ namespace { // holds necessary information for in-progress translations. TranslateContexts are held by a // TranslateStack, which acts like a heap-allocated call stack. class TranslateContext { - MONGO_DISALLOW_COPYING(TranslateContext); + TranslateContext(const TranslateContext&) = delete; + TranslateContext& operator=(const TranslateContext&) = delete; public: TranslateContext(BSONObjIterator&& iter, BufBuilder* buf) diff --git a/src/mongo/db/query/collation/collator_factory_interface.h b/src/mongo/db/query/collation/collator_factory_interface.h index 8c3eef698f9..193e350ed0e 100644 --- a/src/mongo/db/query/collation/collator_factory_interface.h +++ b/src/mongo/db/query/collation/collator_factory_interface.h @@ -31,7 +31,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/db/query/collation/collator_interface.h" namespace mongo { @@ -45,7 +44,8 @@ class StatusWith; * An interface which can be used to retrieve a collator. */ class CollatorFactoryInterface { - MONGO_DISALLOW_COPYING(CollatorFactoryInterface); + CollatorFactoryInterface(const CollatorFactoryInterface&) = delete; + CollatorFactoryInterface& operator=(const CollatorFactoryInterface&) = delete; public: CollatorFactoryInterface() = default; diff --git a/src/mongo/db/query/collation/collator_interface.h b/src/mongo/db/query/collation/collator_interface.h index 6b098340278..7cba6aa2bb1 100644 --- a/src/mongo/db/query/collation/collator_interface.h +++ b/src/mongo/db/query/collation/collator_interface.h @@ -32,7 +32,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/base/string_data_comparator_interface.h" #include "mongo/bson/bsonobj_comparator_interface.h" @@ -49,7 +48,8 @@ namespace mongo { * Does not throw exceptions. */ class CollatorInterface : public StringData::ComparatorInterface { - MONGO_DISALLOW_COPYING(CollatorInterface); + CollatorInterface(const CollatorInterface&) = delete; + CollatorInterface& operator=(const CollatorInterface&) = delete; public: /** diff --git a/src/mongo/db/query/cursor_response.h b/src/mongo/db/query/cursor_response.h index 6412ab38e0b..b44ea0baba4 100644 --- a/src/mongo/db/query/cursor_response.h +++ b/src/mongo/db/query/cursor_response.h @@ -31,7 +31,6 @@ #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" #include "mongo/db/clientcursor.h" @@ -46,7 +45,8 @@ namespace mongo { * command in place. */ class CursorResponseBuilder { - MONGO_DISALLOW_COPYING(CursorResponseBuilder); + CursorResponseBuilder(const CursorResponseBuilder&) = delete; + CursorResponseBuilder& operator=(const CursorResponseBuilder&) = delete; public: /** @@ -162,7 +162,8 @@ class CursorResponse { // TODO SERVER-32467 Remove this ifndef once the compiler has been fixed and the workaround has been // removed. #ifndef __s390x__ - MONGO_DISALLOW_COPYING(CursorResponse); + CursorResponse(const CursorResponse&) = delete; + CursorResponse& operator=(const CursorResponse&) = delete; #endif public: diff --git a/src/mongo/db/query/datetime/date_time_support.h b/src/mongo/db/query/datetime/date_time_support.h index 42697027cac..94ac4c4d08e 100644 --- a/src/mongo/db/query/datetime/date_time_support.h +++ b/src/mongo/db/query/datetime/date_time_support.h @@ -32,7 +32,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/db/service_context.h" #include "mongo/util/string_map.h" #include "mongo/util/time_support.h" @@ -332,7 +331,8 @@ private: * accessed via the global service context. */ class TimeZoneDatabase { - MONGO_DISALLOW_COPYING(TimeZoneDatabase); + TimeZoneDatabase(const TimeZoneDatabase&) = delete; + TimeZoneDatabase& operator=(const TimeZoneDatabase&) = delete; public: /** diff --git a/src/mongo/db/query/plan_cache.h b/src/mongo/db/query/plan_cache.h index 85199403d91..3c904ec3794 100644 --- a/src/mongo/db/query/plan_cache.h +++ b/src/mongo/db/query/plan_cache.h @@ -241,7 +241,8 @@ class PlanCacheEntry; */ class CachedSolution { private: - MONGO_DISALLOW_COPYING(CachedSolution); + CachedSolution(const CachedSolution&) = delete; + CachedSolution& operator=(const CachedSolution&) = delete; public: CachedSolution(const PlanCacheKey& key, const PlanCacheEntry& entry); @@ -275,7 +276,8 @@ public: */ class PlanCacheEntry { private: - MONGO_DISALLOW_COPYING(PlanCacheEntry); + PlanCacheEntry(const PlanCacheEntry&) = delete; + PlanCacheEntry& operator=(const PlanCacheEntry&) = delete; public: /** @@ -354,7 +356,8 @@ public: */ class PlanCache { private: - MONGO_DISALLOW_COPYING(PlanCache); + PlanCache(const PlanCache&) = delete; + PlanCache& operator=(const PlanCache&) = delete; public: // We have three states for a cache entry to be in. Rather than just 'present' or 'not diff --git a/src/mongo/db/query/plan_cache_indexability.h b/src/mongo/db/query/plan_cache_indexability.h index c38c3dd2d05..5c78dabd3d7 100644 --- a/src/mongo/db/query/plan_cache_indexability.h +++ b/src/mongo/db/query/plan_cache_indexability.h @@ -31,7 +31,6 @@ #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/exec/projection_exec_agg.h" #include "mongo/stdx/functional.h" #include "mongo/util/string_map.h" @@ -82,7 +81,8 @@ private: * expressions based on the data values in the expression. */ class PlanCacheIndexabilityState { - MONGO_DISALLOW_COPYING(PlanCacheIndexabilityState); + PlanCacheIndexabilityState(const PlanCacheIndexabilityState&) = delete; + PlanCacheIndexabilityState& operator=(const PlanCacheIndexabilityState&) = delete; public: PlanCacheIndexabilityState() = default; diff --git a/src/mongo/db/query/plan_enumerator.h b/src/mongo/db/query/plan_enumerator.h index d58b0206f41..0ae89741132 100644 --- a/src/mongo/db/query/plan_enumerator.h +++ b/src/mongo/db/query/plan_enumerator.h @@ -31,7 +31,6 @@ #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/query/canonical_query.h" #include "mongo/db/query/index_entry.h" @@ -73,7 +72,8 @@ struct PlanEnumeratorParams { * predicate information to make better decisions about what indices are best. */ class PlanEnumerator { - MONGO_DISALLOW_COPYING(PlanEnumerator); + PlanEnumerator(const PlanEnumerator&) = delete; + PlanEnumerator& operator=(const PlanEnumerator&) = delete; public: /** diff --git a/src/mongo/db/query/plan_executor_impl.h b/src/mongo/db/query/plan_executor_impl.h index 673abf6dc55..1b4dfda3dda 100644 --- a/src/mongo/db/query/plan_executor_impl.h +++ b/src/mongo/db/query/plan_executor_impl.h @@ -32,13 +32,13 @@ #include <boost/optional.hpp> #include <queue> -#include "mongo/base/disallow_copying.h" #include "mongo/db/query/plan_executor.h" namespace mongo { class PlanExecutorImpl : public PlanExecutor { - MONGO_DISALLOW_COPYING(PlanExecutorImpl); + PlanExecutorImpl(const PlanExecutorImpl&) = delete; + PlanExecutorImpl& operator=(const PlanExecutorImpl&) = delete; public: /** diff --git a/src/mongo/db/query/query_settings.h b/src/mongo/db/query/query_settings.h index 4c859b74791..4fac8e39161 100644 --- a/src/mongo/db/query/query_settings.h +++ b/src/mongo/db/query/query_settings.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonobj.h" #include "mongo/bson/simple_bsonobj_comparator.h" #include "mongo/db/query/canonical_query.h" @@ -48,7 +47,8 @@ namespace mongo { */ class AllowedIndicesFilter { private: - MONGO_DISALLOW_COPYING(AllowedIndicesFilter); + AllowedIndicesFilter(const AllowedIndicesFilter&) = delete; + AllowedIndicesFilter& operator=(const AllowedIndicesFilter&) = delete; public: AllowedIndicesFilter(const BSONObjSet& indexKeyPatterns, @@ -107,7 +107,8 @@ public: */ class QuerySettings { private: - MONGO_DISALLOW_COPYING(QuerySettings); + QuerySettings(const QuerySettings&) = delete; + QuerySettings& operator=(const QuerySettings&) = delete; public: QuerySettings() = default; diff --git a/src/mongo/db/query/query_solution.h b/src/mongo/db/query/query_solution.h index 7bff63bf725..04e6cd6d997 100644 --- a/src/mongo/db/query/query_solution.h +++ b/src/mongo/db/query/query_solution.h @@ -188,7 +188,8 @@ protected: void addCommon(mongoutils::str::stream* ss, int indent) const; private: - MONGO_DISALLOW_COPYING(QuerySolutionNode); + QuerySolutionNode(const QuerySolutionNode&) = delete; + QuerySolutionNode& operator=(const QuerySolutionNode&) = delete; }; /** @@ -238,7 +239,8 @@ struct QuerySolution { } private: - MONGO_DISALLOW_COPYING(QuerySolution); + QuerySolution(const QuerySolution&) = delete; + QuerySolution& operator=(const QuerySolution&) = delete; }; struct TextNode : public QuerySolutionNode { diff --git a/src/mongo/db/repl/abstract_async_component.h b/src/mongo/db/repl/abstract_async_component.h index b853efd87f8..8d5e784b591 100644 --- a/src/mongo/db/repl/abstract_async_component.h +++ b/src/mongo/db/repl/abstract_async_component.h @@ -34,7 +34,6 @@ #include <string> #include <type_traits> -#include "mongo/base/disallow_copying.h" #include "mongo/base/static_assert.h" #include "mongo/base/status.h" #include "mongo/executor/task_executor.h" @@ -53,7 +52,8 @@ namespace repl { * _getMutex()). */ class AbstractAsyncComponent { - MONGO_DISALLOW_COPYING(AbstractAsyncComponent); + AbstractAsyncComponent(const AbstractAsyncComponent&) = delete; + AbstractAsyncComponent& operator=(const AbstractAsyncComponent&) = delete; public: AbstractAsyncComponent(executor::TaskExecutor* executor, const std::string& componentName); diff --git a/src/mongo/db/repl/abstract_oplog_fetcher.h b/src/mongo/db/repl/abstract_oplog_fetcher.h index 1420a3ba77d..11d59fd82a8 100644 --- a/src/mongo/db/repl/abstract_oplog_fetcher.h +++ b/src/mongo/db/repl/abstract_oplog_fetcher.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/client/fetcher.h" #include "mongo/db/namespace_string.h" @@ -51,7 +50,8 @@ namespace repl { * fetcher. Subclasses also provide a callback to run on successful batches. */ class AbstractOplogFetcher : public AbstractAsyncComponent { - MONGO_DISALLOW_COPYING(AbstractOplogFetcher); + AbstractOplogFetcher(const AbstractOplogFetcher&) = delete; + AbstractOplogFetcher& operator=(const AbstractOplogFetcher&) = delete; public: /** diff --git a/src/mongo/db/repl/abstract_oplog_fetcher_test.cpp b/src/mongo/db/repl/abstract_oplog_fetcher_test.cpp index f6989555821..92d576daa20 100644 --- a/src/mongo/db/repl/abstract_oplog_fetcher_test.cpp +++ b/src/mongo/db/repl/abstract_oplog_fetcher_test.cpp @@ -511,7 +511,8 @@ TEST_F(AbstractOplogFetcherTest, OplogFetcherTimesOutCorrectlyOnRetriedFindReque bool sharedCallbackStateDestroyed = false; class SharedCallbackState { - MONGO_DISALLOW_COPYING(SharedCallbackState); + SharedCallbackState(const SharedCallbackState&) = delete; + SharedCallbackState& operator=(const SharedCallbackState&) = delete; public: SharedCallbackState() {} diff --git a/src/mongo/db/repl/abstract_oplog_fetcher_test_fixture.h b/src/mongo/db/repl/abstract_oplog_fetcher_test_fixture.h index c4f9163778d..9d1ec170ec8 100644 --- a/src/mongo/db/repl/abstract_oplog_fetcher_test_fixture.h +++ b/src/mongo/db/repl/abstract_oplog_fetcher_test_fixture.h @@ -28,7 +28,6 @@ */ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl/abstract_oplog_fetcher.h" #include "mongo/executor/thread_pool_task_executor_test_fixture.h" #include "mongo/unittest/unittest.h" @@ -40,7 +39,8 @@ namespace repl { * This class represents the state at shutdown of an abstract oplog fetcher. */ class ShutdownState { - MONGO_DISALLOW_COPYING(ShutdownState); + ShutdownState(const ShutdownState&) = delete; + ShutdownState& operator=(const ShutdownState&) = delete; public: ShutdownState(); diff --git a/src/mongo/db/repl/applier_helpers.h b/src/mongo/db/repl/applier_helpers.h index 627bbd7b8a0..94ceffe894d 100644 --- a/src/mongo/db/repl/applier_helpers.h +++ b/src/mongo/db/repl/applier_helpers.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/repl/multiapplier.h" #include "mongo/db/repl/sync_tail.h" @@ -61,7 +60,8 @@ public: * successfully. */ class ApplierHelpers::InsertGroup { - MONGO_DISALLOW_COPYING(InsertGroup); + InsertGroup(const InsertGroup&) = delete; + InsertGroup& operator=(const InsertGroup&) = delete; public: using ConstIterator = OperationPtrs::const_iterator; diff --git a/src/mongo/db/repl/bgsync.h b/src/mongo/db/repl/bgsync.h index 048190ee86a..7e64afae171 100644 --- a/src/mongo/db/repl/bgsync.h +++ b/src/mongo/db/repl/bgsync.h @@ -31,7 +31,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/jsobj.h" #include "mongo/db/repl/data_replicator_external_state.h" @@ -62,7 +61,8 @@ class ReplicationProcess; class StorageInterface; class BackgroundSync { - MONGO_DISALLOW_COPYING(BackgroundSync); + BackgroundSync(const BackgroundSync&) = delete; + BackgroundSync& operator=(const BackgroundSync&) = delete; public: /** diff --git a/src/mongo/db/repl/check_quorum_for_config_change.cpp b/src/mongo/db/repl/check_quorum_for_config_change.cpp index e0caf330bcb..6beca6bb321 100644 --- a/src/mongo/db/repl/check_quorum_for_config_change.cpp +++ b/src/mongo/db/repl/check_quorum_for_config_change.cpp @@ -33,7 +33,6 @@ #include "mongo/db/repl/check_quorum_for_config_change.h" -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/repl/repl_set_config.h" #include "mongo/db/repl/repl_set_heartbeat_args_v1.h" diff --git a/src/mongo/db/repl/check_quorum_for_config_change.h b/src/mongo/db/repl/check_quorum_for_config_change.h index 1117d563d68..4a7cbcb219f 100644 --- a/src/mongo/db/repl/check_quorum_for_config_change.h +++ b/src/mongo/db/repl/check_quorum_for_config_change.h @@ -49,7 +49,8 @@ class ReplSetConfig; * result of the quorum check. */ class QuorumChecker : public ScatterGatherAlgorithm { - MONGO_DISALLOW_COPYING(QuorumChecker); + QuorumChecker(const QuorumChecker&) = delete; + QuorumChecker& operator=(const QuorumChecker&) = delete; public: /** diff --git a/src/mongo/db/repl/collection_bulk_loader_impl.h b/src/mongo/db/repl/collection_bulk_loader_impl.h index 880bcc2d768..5e03fcbda5d 100644 --- a/src/mongo/db/repl/collection_bulk_loader_impl.h +++ b/src/mongo/db/repl/collection_bulk_loader_impl.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" @@ -49,7 +48,8 @@ namespace repl { * Note: Call commit when done inserting documents. */ class CollectionBulkLoaderImpl : public CollectionBulkLoader { - MONGO_DISALLOW_COPYING(CollectionBulkLoaderImpl); + CollectionBulkLoaderImpl(const CollectionBulkLoaderImpl&) = delete; + CollectionBulkLoaderImpl& operator=(const CollectionBulkLoaderImpl&) = delete; public: struct Stats { diff --git a/src/mongo/db/repl/collection_cloner.h b/src/mongo/db/repl/collection_cloner.h index a7fbeca5922..ad14eb34f7f 100644 --- a/src/mongo/db/repl/collection_cloner.h +++ b/src/mongo/db/repl/collection_cloner.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsonobj.h" @@ -61,7 +60,8 @@ namespace repl { class StorageInterface; class CollectionCloner : public BaseCloner { - MONGO_DISALLOW_COPYING(CollectionCloner); + CollectionCloner(const CollectionCloner&) = delete; + CollectionCloner& operator=(const CollectionCloner&) = delete; public: /** diff --git a/src/mongo/db/repl/collection_cloner_test.cpp b/src/mongo/db/repl/collection_cloner_test.cpp index a8ca6efb7c7..c8f06889825 100644 --- a/src/mongo/db/repl/collection_cloner_test.cpp +++ b/src/mongo/db/repl/collection_cloner_test.cpp @@ -179,7 +179,8 @@ private: // RAII class to pause the client; since tests are very exception-heavy this prevents them // from hanging on failure. class MockClientPauser { - MONGO_DISALLOW_COPYING(MockClientPauser); + MockClientPauser(const MockClientPauser&) = delete; + MockClientPauser& operator=(const MockClientPauser&) = delete; public: MockClientPauser(FailableMockDBClientConnection* client) : _client(client) { @@ -1118,7 +1119,8 @@ TEST_F(CollectionClonerTest, CollectionClonerCannotBeRestartedAfterPreviousFailu bool sharedCallbackStateDestroyed = false; class SharedCallbackState { - MONGO_DISALLOW_COPYING(SharedCallbackState); + SharedCallbackState(const SharedCallbackState&) = delete; + SharedCallbackState& operator=(const SharedCallbackState&) = delete; public: SharedCallbackState() {} diff --git a/src/mongo/db/repl/data_replicator_external_state.h b/src/mongo/db/repl/data_replicator_external_state.h index 0cc4feb3bad..6ce205ff898 100644 --- a/src/mongo/db/repl/data_replicator_external_state.h +++ b/src/mongo/db/repl/data_replicator_external_state.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/repl/multiapplier.h" #include "mongo/db/repl/oplog_applier.h" @@ -66,7 +65,8 @@ using OpTimeWithTerm = OpTimeWith<long long>; * InitialSyncer should be moved here. */ class DataReplicatorExternalState { - MONGO_DISALLOW_COPYING(DataReplicatorExternalState); + DataReplicatorExternalState(const DataReplicatorExternalState&) = delete; + DataReplicatorExternalState& operator=(const DataReplicatorExternalState&) = delete; public: DataReplicatorExternalState() = default; diff --git a/src/mongo/db/repl/data_replicator_external_state_mock.cpp b/src/mongo/db/repl/data_replicator_external_state_mock.cpp index 2c164614fc4..96c69326412 100644 --- a/src/mongo/db/repl/data_replicator_external_state_mock.cpp +++ b/src/mongo/db/repl/data_replicator_external_state_mock.cpp @@ -40,7 +40,8 @@ namespace repl { namespace { class OplogApplierMock : public OplogApplier { - MONGO_DISALLOW_COPYING(OplogApplierMock); + OplogApplierMock(const OplogApplierMock&) = delete; + OplogApplierMock& operator=(const OplogApplierMock&) = delete; public: OplogApplierMock(executor::TaskExecutor* executor, diff --git a/src/mongo/db/repl/database_cloner.h b/src/mongo/db/repl/database_cloner.h index f888118d1e0..94b559d8278 100644 --- a/src/mongo/db/repl/database_cloner.h +++ b/src/mongo/db/repl/database_cloner.h @@ -34,7 +34,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/bson/bsonobj.h" #include "mongo/client/fetcher.h" @@ -53,7 +52,8 @@ namespace repl { class StorageInterface; class DatabaseCloner : public BaseCloner { - MONGO_DISALLOW_COPYING(DatabaseCloner); + DatabaseCloner(const DatabaseCloner&) = delete; + DatabaseCloner& operator=(const DatabaseCloner&) = delete; public: struct Stats { diff --git a/src/mongo/db/repl/databases_cloner.h b/src/mongo/db/repl/databases_cloner.h index 179425852c5..8d94afe26fc 100644 --- a/src/mongo/db/repl/databases_cloner.h +++ b/src/mongo/db/repl/databases_cloner.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" diff --git a/src/mongo/db/repl/databases_cloner_test.cpp b/src/mongo/db/repl/databases_cloner_test.cpp index 02cdcd1118d..c4828eca321 100644 --- a/src/mongo/db/repl/databases_cloner_test.cpp +++ b/src/mongo/db/repl/databases_cloner_test.cpp @@ -630,7 +630,8 @@ TEST_F(DBsClonerTest, DatabasesClonerReturnsCallbackCanceledIfShutdownDuringList bool sharedCallbackStateDestroyed = false; class SharedCallbackState { - MONGO_DISALLOW_COPYING(SharedCallbackState); + SharedCallbackState(const SharedCallbackState&) = delete; + SharedCallbackState& operator=(const SharedCallbackState&) = delete; public: SharedCallbackState() {} diff --git a/src/mongo/db/repl/drop_pending_collection_reaper.h b/src/mongo/db/repl/drop_pending_collection_reaper.h index 245ed2d4ca5..be8dd9a77d8 100644 --- a/src/mongo/db/repl/drop_pending_collection_reaper.h +++ b/src/mongo/db/repl/drop_pending_collection_reaper.h @@ -34,7 +34,6 @@ #include <map> #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/db/namespace_string.h" #include "mongo/db/repl/optime.h" #include "mongo/stdx/mutex.h" @@ -60,7 +59,8 @@ class StorageInterface; * dropCollectionsOlderThan() for this purpose. */ class DropPendingCollectionReaper { - MONGO_DISALLOW_COPYING(DropPendingCollectionReaper); + DropPendingCollectionReaper(const DropPendingCollectionReaper&) = delete; + DropPendingCollectionReaper& operator=(const DropPendingCollectionReaper&) = delete; public: // Operation Context binding. diff --git a/src/mongo/db/repl/initial_syncer.h b/src/mongo/db/repl/initial_syncer.h index 658db40d705..31c4790feb7 100644 --- a/src/mongo/db/repl/initial_syncer.h +++ b/src/mongo/db/repl/initial_syncer.h @@ -139,7 +139,8 @@ struct InitialSyncerOptions { * -- startup: Start initial sync. */ class InitialSyncer { - MONGO_DISALLOW_COPYING(InitialSyncer); + InitialSyncer(const InitialSyncer&) = delete; + InitialSyncer& operator=(const InitialSyncer&) = delete; public: /** diff --git a/src/mongo/db/repl/initial_syncer_test.cpp b/src/mongo/db/repl/initial_syncer_test.cpp index a8ed2079d4d..48b134eda45 100644 --- a/src/mongo/db/repl/initial_syncer_test.cpp +++ b/src/mongo/db/repl/initial_syncer_test.cpp @@ -981,7 +981,8 @@ TEST_F(InitialSyncerTest, InitialSyncerTransitionsToCompleteWhenFinishCallbackTh } class SharedCallbackState { - MONGO_DISALLOW_COPYING(SharedCallbackState); + SharedCallbackState(const SharedCallbackState&) = delete; + SharedCallbackState& operator=(const SharedCallbackState&) = delete; public: explicit SharedCallbackState(bool* sharedCallbackStateDestroyed) diff --git a/src/mongo/db/repl/multiapplier.h b/src/mongo/db/repl/multiapplier.h index 5881a082e9b..87d34964c2f 100644 --- a/src/mongo/db/repl/multiapplier.h +++ b/src/mongo/db/repl/multiapplier.h @@ -35,7 +35,6 @@ #include <utility> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/db/jsobj.h" @@ -53,7 +52,8 @@ namespace repl { class OpTime; class MultiApplier { - MONGO_DISALLOW_COPYING(MultiApplier); + MultiApplier(const MultiApplier&) = delete; + MultiApplier& operator=(const MultiApplier&) = delete; public: /** diff --git a/src/mongo/db/repl/multiapplier_test.cpp b/src/mongo/db/repl/multiapplier_test.cpp index 1130fb67f5c..bafa8eef774 100644 --- a/src/mongo/db/repl/multiapplier_test.cpp +++ b/src/mongo/db/repl/multiapplier_test.cpp @@ -265,7 +265,8 @@ TEST_F( } class SharedCallbackState { - MONGO_DISALLOW_COPYING(SharedCallbackState); + SharedCallbackState(const SharedCallbackState&) = delete; + SharedCallbackState& operator=(const SharedCallbackState&) = delete; public: explicit SharedCallbackState(bool* sharedCallbackStateDestroyed) diff --git a/src/mongo/db/repl/noop_writer.cpp b/src/mongo/db/repl/noop_writer.cpp index 90b15f0f4ac..6897acab22c 100644 --- a/src/mongo/db/repl/noop_writer.cpp +++ b/src/mongo/db/repl/noop_writer.cpp @@ -60,7 +60,8 @@ const auto kMsgObj = BSON("msg" * Runs the noopWrite argument with waitTime period until its destroyed. */ class NoopWriter::PeriodicNoopRunner { - MONGO_DISALLOW_COPYING(PeriodicNoopRunner); + PeriodicNoopRunner(const PeriodicNoopRunner&) = delete; + PeriodicNoopRunner& operator=(const PeriodicNoopRunner&) = delete; using NoopWriteFn = stdx::function<void(OperationContext*)>; diff --git a/src/mongo/db/repl/noop_writer.h b/src/mongo/db/repl/noop_writer.h index 1fb713c249d..07f664668d0 100644 --- a/src/mongo/db/repl/noop_writer.h +++ b/src/mongo/db/repl/noop_writer.h @@ -43,7 +43,8 @@ namespace repl { * coordinator's optime has not changed since the last time it did a write. */ class NoopWriter { - MONGO_DISALLOW_COPYING(NoopWriter); + NoopWriter(const NoopWriter&) = delete; + NoopWriter& operator=(const NoopWriter&) = delete; public: NoopWriter(Seconds waitTime); diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index b5a18749096..0aa23a1a07c 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -122,7 +122,8 @@ MONGO_FAIL_POINT_DEFINE(hangBeforeLogOpAdvancesLastApplied); * This structure contains per-service-context state related to the oplog. */ struct LocalOplogInfo { - MONGO_DISALLOW_COPYING(LocalOplogInfo); + LocalOplogInfo(const LocalOplogInfo&) = delete; + LocalOplogInfo& operator=(const LocalOplogInfo&) = delete; LocalOplogInfo() = default; // Name of the oplog collection. diff --git a/src/mongo/db/repl/oplog_applier.h b/src/mongo/db/repl/oplog_applier.h index d613ee0b7d2..9ee0f3d0b28 100644 --- a/src/mongo/db/repl/oplog_applier.h +++ b/src/mongo/db/repl/oplog_applier.h @@ -33,7 +33,6 @@ #include <boost/optional.hpp> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/db/repl/oplog_buffer.h" @@ -52,7 +51,8 @@ namespace repl { * Reads from an OplogBuffer batches of operations that may be applied in parallel. */ class OplogApplier { - MONGO_DISALLOW_COPYING(OplogApplier); + OplogApplier(const OplogApplier&) = delete; + OplogApplier& operator=(const OplogApplier&) = delete; public: /** diff --git a/src/mongo/db/repl/oplog_applier_impl.h b/src/mongo/db/repl/oplog_applier_impl.h index 0cb99b32c05..d6e0e523220 100644 --- a/src/mongo/db/repl/oplog_applier_impl.h +++ b/src/mongo/db/repl/oplog_applier_impl.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl/oplog_applier.h" #include "mongo/db/repl/replication_consistency_markers.h" #include "mongo/db/repl/replication_coordinator.h" @@ -45,7 +44,8 @@ namespace repl { * Reads from an OplogBuffer batches of operations that may be applied in parallel. */ class OplogApplierImpl : public OplogApplier { - MONGO_DISALLOW_COPYING(OplogApplierImpl); + OplogApplierImpl(const OplogApplierImpl&) = delete; + OplogApplierImpl& operator=(const OplogApplierImpl&) = delete; public: /** diff --git a/src/mongo/db/repl/oplog_buffer.h b/src/mongo/db/repl/oplog_buffer.h index 7a35778a479..fe6007dc085 100644 --- a/src/mongo/db/repl/oplog_buffer.h +++ b/src/mongo/db/repl/oplog_buffer.h @@ -34,7 +34,6 @@ #include <vector> #include "mongo/base/counter.h" -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonobj.h" #include "mongo/util/time_support.h" @@ -51,7 +50,8 @@ namespace repl { * Implementations are only required to support one pusher and one popper. */ class OplogBuffer { - MONGO_DISALLOW_COPYING(OplogBuffer); + OplogBuffer(const OplogBuffer&) = delete; + OplogBuffer& operator=(const OplogBuffer&) = delete; public: /** diff --git a/src/mongo/db/repl/oplog_buffer_proxy.h b/src/mongo/db/repl/oplog_buffer_proxy.h index 440d8616142..544b5b6739f 100644 --- a/src/mongo/db/repl/oplog_buffer_proxy.h +++ b/src/mongo/db/repl/oplog_buffer_proxy.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl/oplog_buffer.h" #include "mongo/stdx/mutex.h" @@ -46,7 +45,8 @@ class StorageInterface; * oplog buffer. */ class OplogBufferProxy : public OplogBuffer { - MONGO_DISALLOW_COPYING(OplogBufferProxy); + OplogBufferProxy(const OplogBufferProxy&) = delete; + OplogBufferProxy& operator=(const OplogBufferProxy&) = delete; public: explicit OplogBufferProxy(std::unique_ptr<OplogBuffer> target); diff --git a/src/mongo/db/repl/oplog_buffer_proxy_test.cpp b/src/mongo/db/repl/oplog_buffer_proxy_test.cpp index 95cc39b3b65..33173a8b75a 100644 --- a/src/mongo/db/repl/oplog_buffer_proxy_test.cpp +++ b/src/mongo/db/repl/oplog_buffer_proxy_test.cpp @@ -32,7 +32,6 @@ #include <boost/optional/optional_io.hpp> #include <deque> -#include "mongo/base/disallow_copying.h" #include "mongo/db/jsobj.h" #include "mongo/db/repl/oplog_buffer_proxy.h" #include "mongo/stdx/functional.h" @@ -46,7 +45,8 @@ using namespace mongo; using namespace mongo::repl; class OplogBufferMock : public OplogBuffer { - MONGO_DISALLOW_COPYING(OplogBufferMock); + OplogBufferMock(const OplogBufferMock&) = delete; + OplogBufferMock& operator=(const OplogBufferMock&) = delete; public: OplogBufferMock() = default; diff --git a/src/mongo/db/repl/oplog_fetcher.h b/src/mongo/db/repl/oplog_fetcher.h index cfc11787df5..c42f4a884c0 100644 --- a/src/mongo/db/repl/oplog_fetcher.h +++ b/src/mongo/db/repl/oplog_fetcher.h @@ -31,7 +31,6 @@ #include <cstddef> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/timestamp.h" #include "mongo/client/fetcher.h" @@ -72,7 +71,8 @@ MONGO_FAIL_POINT_DECLARE(stopReplProducer); * `getMore` commands, and handles restarting on errors. */ class OplogFetcher : public AbstractOplogFetcher { - MONGO_DISALLOW_COPYING(OplogFetcher); + OplogFetcher(const OplogFetcher&) = delete; + OplogFetcher& operator=(const OplogFetcher&) = delete; public: static Seconds kDefaultProtocolZeroAwaitDataTimeout; diff --git a/src/mongo/db/repl/oplog_interface.h b/src/mongo/db/repl/oplog_interface.h index 04cfb40f532..710e1b6de6b 100644 --- a/src/mongo/db/repl/oplog_interface.h +++ b/src/mongo/db/repl/oplog_interface.h @@ -33,7 +33,6 @@ #include <string> #include <utility> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" #include "mongo/db/record_id.h" @@ -43,7 +42,8 @@ namespace mongo { namespace repl { class OplogInterface { - MONGO_DISALLOW_COPYING(OplogInterface); + OplogInterface(const OplogInterface&) = delete; + OplogInterface& operator=(const OplogInterface&) = delete; public: class Iterator; @@ -70,7 +70,8 @@ protected: }; class OplogInterface::Iterator { - MONGO_DISALLOW_COPYING(Iterator); + Iterator(const Iterator&) = delete; + Iterator& operator=(const Iterator&) = delete; public: using Value = std::pair<BSONObj, RecordId>; diff --git a/src/mongo/db/repl/oplog_interface_mock.h b/src/mongo/db/repl/oplog_interface_mock.h index 813fda41605..678a0b28c8c 100644 --- a/src/mongo/db/repl/oplog_interface_mock.h +++ b/src/mongo/db/repl/oplog_interface_mock.h @@ -39,7 +39,8 @@ namespace repl { * Simulates oplog for testing rollback functionality. */ class OplogInterfaceMock : public OplogInterface { - MONGO_DISALLOW_COPYING(OplogInterfaceMock); + OplogInterfaceMock(const OplogInterfaceMock&) = delete; + OplogInterfaceMock& operator=(const OplogInterfaceMock&) = delete; public: using Operation = std::pair<BSONObj, RecordId>; diff --git a/src/mongo/db/repl/replication_consistency_markers.h b/src/mongo/db/repl/replication_consistency_markers.h index 82118277986..894aec89f66 100644 --- a/src/mongo/db/repl/replication_consistency_markers.h +++ b/src/mongo/db/repl/replication_consistency_markers.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/namespace_string.h" namespace mongo { @@ -75,7 +74,8 @@ class StorageInterface; * See below for explanations of each field. */ class ReplicationConsistencyMarkers { - MONGO_DISALLOW_COPYING(ReplicationConsistencyMarkers); + ReplicationConsistencyMarkers(const ReplicationConsistencyMarkers&) = delete; + ReplicationConsistencyMarkers& operator=(const ReplicationConsistencyMarkers&) = delete; public: // Constructor and Destructor. diff --git a/src/mongo/db/repl/replication_consistency_markers_impl.h b/src/mongo/db/repl/replication_consistency_markers_impl.h index 5e64762d490..cb3b8ecf6cc 100644 --- a/src/mongo/db/repl/replication_consistency_markers_impl.h +++ b/src/mongo/db/repl/replication_consistency_markers_impl.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/namespace_string.h" #include "mongo/db/repl/replication_consistency_markers.h" #include "mongo/db/repl/replication_consistency_markers_gen.h" @@ -47,7 +46,8 @@ class StorageInterface; struct TimestampedBSONObj; class ReplicationConsistencyMarkersImpl : public ReplicationConsistencyMarkers { - MONGO_DISALLOW_COPYING(ReplicationConsistencyMarkersImpl); + ReplicationConsistencyMarkersImpl(const ReplicationConsistencyMarkersImpl&) = delete; + ReplicationConsistencyMarkersImpl& operator=(const ReplicationConsistencyMarkersImpl&) = delete; public: static constexpr StringData kDefaultMinValidNamespace = "local.replset.minvalid"_sd; diff --git a/src/mongo/db/repl/replication_consistency_markers_mock.h b/src/mongo/db/repl/replication_consistency_markers_mock.h index 165c6185c43..3215264110f 100644 --- a/src/mongo/db/repl/replication_consistency_markers_mock.h +++ b/src/mongo/db/repl/replication_consistency_markers_mock.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl/optime.h" #include "mongo/db/repl/replication_consistency_markers.h" #include "mongo/stdx/mutex.h" @@ -46,7 +45,8 @@ namespace repl { * A mock ReplicationConsistencyMarkers implementation that stores everything in memory. */ class ReplicationConsistencyMarkersMock : public ReplicationConsistencyMarkers { - MONGO_DISALLOW_COPYING(ReplicationConsistencyMarkersMock); + ReplicationConsistencyMarkersMock(const ReplicationConsistencyMarkersMock&) = delete; + ReplicationConsistencyMarkersMock& operator=(const ReplicationConsistencyMarkersMock&) = delete; public: ReplicationConsistencyMarkersMock() = default; diff --git a/src/mongo/db/repl/replication_coordinator.h b/src/mongo/db/repl/replication_coordinator.h index 6b63d156b17..7efc12c9994 100644 --- a/src/mongo/db/repl/replication_coordinator.h +++ b/src/mongo/db/repl/replication_coordinator.h @@ -31,7 +31,6 @@ #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/bson/timestamp.h" @@ -85,7 +84,8 @@ class UpdatePositionArgs; * API that the replication subsystem presents to the rest of the codebase. */ class ReplicationCoordinator : public SyncSourceSelector { - MONGO_DISALLOW_COPYING(ReplicationCoordinator); + ReplicationCoordinator(const ReplicationCoordinator&) = delete; + ReplicationCoordinator& operator=(const ReplicationCoordinator&) = delete; public: static ReplicationCoordinator* get(ServiceContext* service); diff --git a/src/mongo/db/repl/replication_coordinator_external_state.h b/src/mongo/db/repl/replication_coordinator_external_state.h index a7bb4c6bdd0..aa81dc2b6cf 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state.h +++ b/src/mongo/db/repl/replication_coordinator_external_state.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <cstddef> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/timestamp.h" #include "mongo/db/repl/member_state.h" #include "mongo/db/repl/optime.h" @@ -65,7 +64,9 @@ class ReplicationCoordinator; * ReplicationCoordinatorImpl should be moved here. */ class ReplicationCoordinatorExternalState { - MONGO_DISALLOW_COPYING(ReplicationCoordinatorExternalState); + ReplicationCoordinatorExternalState(const ReplicationCoordinatorExternalState&) = delete; + ReplicationCoordinatorExternalState& operator=(const ReplicationCoordinatorExternalState&) = + delete; public: ReplicationCoordinatorExternalState() {} diff --git a/src/mongo/db/repl/replication_coordinator_external_state_impl.h b/src/mongo/db/repl/replication_coordinator_external_state_impl.h index fb6ea07d80f..0cdef723c00 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_impl.h +++ b/src/mongo/db/repl/replication_coordinator_external_state_impl.h @@ -31,7 +31,6 @@ #include <deque> -#include "mongo/base/disallow_copying.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/repl/bgsync.h" #include "mongo/db/repl/oplog_applier.h" @@ -58,7 +57,10 @@ class NoopWriter; class ReplicationCoordinatorExternalStateImpl final : public ReplicationCoordinatorExternalState, public JournalListener { - MONGO_DISALLOW_COPYING(ReplicationCoordinatorExternalStateImpl); + ReplicationCoordinatorExternalStateImpl(const ReplicationCoordinatorExternalStateImpl&) = + delete; + ReplicationCoordinatorExternalStateImpl& operator=( + const ReplicationCoordinatorExternalStateImpl&) = delete; public: ReplicationCoordinatorExternalStateImpl( diff --git a/src/mongo/db/repl/replication_coordinator_external_state_mock.h b/src/mongo/db/repl/replication_coordinator_external_state_mock.h index 6311dd446b1..eeda5419db9 100644 --- a/src/mongo/db/repl/replication_coordinator_external_state_mock.h +++ b/src/mongo/db/repl/replication_coordinator_external_state_mock.h @@ -31,7 +31,6 @@ #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/oid.h" #include "mongo/bson/timestamp.h" @@ -50,7 +49,10 @@ class ServiceContext; namespace repl { class ReplicationCoordinatorExternalStateMock : public ReplicationCoordinatorExternalState { - MONGO_DISALLOW_COPYING(ReplicationCoordinatorExternalStateMock); + ReplicationCoordinatorExternalStateMock(const ReplicationCoordinatorExternalStateMock&) = + delete; + ReplicationCoordinatorExternalStateMock& operator=( + const ReplicationCoordinatorExternalStateMock&) = delete; public: class GlobalSharedLockAcquirer; diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index c0a6e03c39e..674e244acd8 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -129,7 +129,8 @@ const OperationContext::Decoration<bool> alwaysAllowNonLocalWrites = * Resets to original value when leaving scope so it is safe to nest. */ class AllowNonLocalWritesBlock { - MONGO_DISALLOW_COPYING(AllowNonLocalWritesBlock); + AllowNonLocalWritesBlock(const AllowNonLocalWritesBlock&) = delete; + AllowNonLocalWritesBlock& operator=(const AllowNonLocalWritesBlock&) = delete; public: AllowNonLocalWritesBlock(OperationContext* opCtx) diff --git a/src/mongo/db/repl/replication_coordinator_impl.h b/src/mongo/db/repl/replication_coordinator_impl.h index 195e11d799b..52a862292c3 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.h +++ b/src/mongo/db/repl/replication_coordinator_impl.h @@ -82,7 +82,8 @@ class TopologyCoordinator; class VoteRequester; class ReplicationCoordinatorImpl : public ReplicationCoordinator { - MONGO_DISALLOW_COPYING(ReplicationCoordinatorImpl); + ReplicationCoordinatorImpl(const ReplicationCoordinatorImpl&) = delete; + ReplicationCoordinatorImpl& operator=(const ReplicationCoordinatorImpl&) = delete; public: ReplicationCoordinatorImpl(ServiceContext* serviceContext, diff --git a/src/mongo/db/repl/replication_coordinator_impl_elect_v1.cpp b/src/mongo/db/repl/replication_coordinator_impl_elect_v1.cpp index 73fee3bf73e..e8415946dfc 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_elect_v1.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_elect_v1.cpp @@ -33,7 +33,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl/replication_coordinator_impl.h" #include "mongo/db/repl/topology_coordinator.h" #include "mongo/db/repl/vote_requester.h" @@ -45,7 +44,8 @@ namespace mongo { namespace repl { class ReplicationCoordinatorImpl::LoseElectionGuardV1 { - MONGO_DISALLOW_COPYING(LoseElectionGuardV1); + LoseElectionGuardV1(const LoseElectionGuardV1&) = delete; + LoseElectionGuardV1& operator=(const LoseElectionGuardV1&) = delete; public: LoseElectionGuardV1(ReplicationCoordinatorImpl* replCoord) : _replCoord(replCoord) {} @@ -76,7 +76,8 @@ protected: }; class ReplicationCoordinatorImpl::LoseElectionDryRunGuardV1 : public LoseElectionGuardV1 { - MONGO_DISALLOW_COPYING(LoseElectionDryRunGuardV1); + LoseElectionDryRunGuardV1(const LoseElectionDryRunGuardV1&) = delete; + LoseElectionDryRunGuardV1& operator=(const LoseElectionDryRunGuardV1&) = delete; public: LoseElectionDryRunGuardV1(ReplicationCoordinatorImpl* replCoord) diff --git a/src/mongo/db/repl/replication_coordinator_mock.h b/src/mongo/db/repl/replication_coordinator_mock.h index 1fc093a635b..23c1c4080ac 100644 --- a/src/mongo/db/repl/replication_coordinator_mock.h +++ b/src/mongo/db/repl/replication_coordinator_mock.h @@ -50,7 +50,8 @@ namespace repl { * into dbtests. */ class ReplicationCoordinatorMock : public ReplicationCoordinator { - MONGO_DISALLOW_COPYING(ReplicationCoordinatorMock); + ReplicationCoordinatorMock(const ReplicationCoordinatorMock&) = delete; + ReplicationCoordinatorMock& operator=(const ReplicationCoordinatorMock&) = delete; public: ReplicationCoordinatorMock(ServiceContext* service, const ReplSettings& settings); diff --git a/src/mongo/db/repl/replication_process.h b/src/mongo/db/repl/replication_process.h index aae288504c6..849ac7df8c4 100644 --- a/src/mongo/db/repl/replication_process.h +++ b/src/mongo/db/repl/replication_process.h @@ -32,7 +32,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/db/namespace_string.h" @@ -60,7 +59,8 @@ class StorageInterface; * This class DOES NOT hold any information related to the consensus protocol. */ class ReplicationProcess { - MONGO_DISALLOW_COPYING(ReplicationProcess); + ReplicationProcess(const ReplicationProcess&) = delete; + ReplicationProcess& operator=(const ReplicationProcess&) = delete; public: static const int kUninitializedRollbackId = -1; diff --git a/src/mongo/db/repl/replication_recovery.h b/src/mongo/db/repl/replication_recovery.h index 68a86833fcd..a33cb15e51c 100644 --- a/src/mongo/db/repl/replication_recovery.h +++ b/src/mongo/db/repl/replication_recovery.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/repl/optime.h" @@ -59,7 +58,8 @@ public: }; class ReplicationRecoveryImpl : public ReplicationRecovery { - MONGO_DISALLOW_COPYING(ReplicationRecoveryImpl); + ReplicationRecoveryImpl(const ReplicationRecoveryImpl&) = delete; + ReplicationRecoveryImpl& operator=(const ReplicationRecoveryImpl&) = delete; public: ReplicationRecoveryImpl(StorageInterface* storageInterface, diff --git a/src/mongo/db/repl/replication_recovery_mock.h b/src/mongo/db/repl/replication_recovery_mock.h index a908c84de84..77835215ca3 100644 --- a/src/mongo/db/repl/replication_recovery_mock.h +++ b/src/mongo/db/repl/replication_recovery_mock.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl/replication_recovery.h" namespace mongo { @@ -37,7 +36,8 @@ class OperationContext; namespace repl { class ReplicationRecoveryMock : public ReplicationRecovery { - MONGO_DISALLOW_COPYING(ReplicationRecoveryMock); + ReplicationRecoveryMock(const ReplicationRecoveryMock&) = delete; + ReplicationRecoveryMock& operator=(const ReplicationRecoveryMock&) = delete; public: ReplicationRecoveryMock() = default; diff --git a/src/mongo/db/repl/reporter.h b/src/mongo/db/repl/reporter.h index 8a10c2a1a02..f332401ea2e 100644 --- a/src/mongo/db/repl/reporter.h +++ b/src/mongo/db/repl/reporter.h @@ -63,7 +63,8 @@ namespace repl { * keep alive timeout, resetting the keep alive schedule. */ class Reporter { - MONGO_DISALLOW_COPYING(Reporter); + Reporter(const Reporter&) = delete; + Reporter& operator=(const Reporter&) = delete; public: /** diff --git a/src/mongo/db/repl/roll_back_local_operations.h b/src/mongo/db/repl/roll_back_local_operations.h index c1c44578ef2..7d21b2feb74 100644 --- a/src/mongo/db/repl/roll_back_local_operations.h +++ b/src/mongo/db/repl/roll_back_local_operations.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" @@ -52,7 +51,8 @@ MONGO_FAIL_POINT_DECLARE(rollbackHangBeforeFinish); MONGO_FAIL_POINT_DECLARE(rollbackHangThenFailAfterWritingMinValid); class RollBackLocalOperations { - MONGO_DISALLOW_COPYING(RollBackLocalOperations); + RollBackLocalOperations(const RollBackLocalOperations&) = delete; + RollBackLocalOperations& operator=(const RollBackLocalOperations&) = delete; public: class RollbackCommonPoint { diff --git a/src/mongo/db/repl/rollback.h b/src/mongo/db/repl/rollback.h index d7ca747afa3..26af57b79e9 100644 --- a/src/mongo/db/repl/rollback.h +++ b/src/mongo/db/repl/rollback.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/repl/optime.h" #include "mongo/stdx/functional.h" @@ -42,7 +41,8 @@ namespace repl { * interact with the rollback subsystem. */ class Rollback { - MONGO_DISALLOW_COPYING(Rollback); + Rollback(const Rollback&) = delete; + Rollback& operator=(const Rollback&) = delete; public: /** diff --git a/src/mongo/db/repl/rollback_checker.h b/src/mongo/db/repl/rollback_checker.h index c1f3d2fda00..ed589e57c7c 100644 --- a/src/mongo/db/repl/rollback_checker.h +++ b/src/mongo/db/repl/rollback_checker.h @@ -60,7 +60,8 @@ class Mutex; * */ class RollbackChecker { - MONGO_DISALLOW_COPYING(RollbackChecker); + RollbackChecker(const RollbackChecker&) = delete; + RollbackChecker& operator=(const RollbackChecker&) = delete; public: // Rollback checker result - true if rollback occurred; false if rollback IDs diff --git a/src/mongo/db/repl/rollback_source.h b/src/mongo/db/repl/rollback_source.h index e86473e7aef..5d58240b820 100644 --- a/src/mongo/db/repl/rollback_source.h +++ b/src/mongo/db/repl/rollback_source.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/jsobj.h" #include "mongo/util/net/hostandport.h" @@ -48,7 +47,8 @@ class OplogInterface; * Interface for rollback-related operations on the sync source. */ class RollbackSource { - MONGO_DISALLOW_COPYING(RollbackSource); + RollbackSource(const RollbackSource&) = delete; + RollbackSource& operator=(const RollbackSource&) = delete; public: RollbackSource() = default; diff --git a/src/mongo/db/repl/scatter_gather_runner.h b/src/mongo/db/repl/scatter_gather_runner.h index 5fe7f08b894..4d65e417efb 100644 --- a/src/mongo/db/repl/scatter_gather_runner.h +++ b/src/mongo/db/repl/scatter_gather_runner.h @@ -31,7 +31,6 @@ #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/executor/task_executor.h" #include "mongo/stdx/functional.h" #include "mongo/stdx/mutex.h" @@ -49,7 +48,8 @@ class ScatterGatherAlgorithm; * Interface of a scatter-gather behavior. */ class ScatterGatherRunner { - MONGO_DISALLOW_COPYING(ScatterGatherRunner); + ScatterGatherRunner(const ScatterGatherRunner&) = delete; + ScatterGatherRunner& operator=(const ScatterGatherRunner&) = delete; public: /** diff --git a/src/mongo/db/repl/storage_interface.h b/src/mongo/db/repl/storage_interface.h index 6339d31f475..9ea9ee02929 100644 --- a/src/mongo/db/repl/storage_interface.h +++ b/src/mongo/db/repl/storage_interface.h @@ -35,7 +35,6 @@ #include <iosfwd> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/timestamp.h" #include "mongo/db/catalog/collection.h" @@ -71,7 +70,8 @@ struct TimestampedBSONObj { * * Insert documents into a collection */ class StorageInterface { - MONGO_DISALLOW_COPYING(StorageInterface); + StorageInterface(const StorageInterface&) = delete; + StorageInterface& operator=(const StorageInterface&) = delete; public: // Operation Context binding. diff --git a/src/mongo/db/repl/storage_interface_impl.h b/src/mongo/db/repl/storage_interface_impl.h index a62587f9a6c..24538fed00f 100644 --- a/src/mongo/db/repl/storage_interface_impl.h +++ b/src/mongo/db/repl/storage_interface_impl.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/base/string_data.h" @@ -43,7 +42,8 @@ namespace mongo { namespace repl { class StorageInterfaceImpl : public StorageInterface { - MONGO_DISALLOW_COPYING(StorageInterfaceImpl); + StorageInterfaceImpl(const StorageInterfaceImpl&) = delete; + StorageInterfaceImpl& operator=(const StorageInterfaceImpl&) = delete; public: static const char kDefaultRollbackIdNamespace[]; diff --git a/src/mongo/db/repl/storage_interface_mock.h b/src/mongo/db/repl/storage_interface_mock.h index 2dca3362dde..fd1084ccfe9 100644 --- a/src/mongo/db/repl/storage_interface_mock.h +++ b/src/mongo/db/repl/storage_interface_mock.h @@ -36,7 +36,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/base/string_data.h" @@ -56,7 +55,8 @@ struct CollectionMockStats { }; class CollectionBulkLoaderMock : public CollectionBulkLoader { - MONGO_DISALLOW_COPYING(CollectionBulkLoaderMock); + CollectionBulkLoaderMock(const CollectionBulkLoaderMock&) = delete; + CollectionBulkLoaderMock& operator=(const CollectionBulkLoaderMock&) = delete; public: explicit CollectionBulkLoaderMock(std::shared_ptr<CollectionMockStats> collStats) @@ -87,7 +87,8 @@ public: }; class StorageInterfaceMock : public StorageInterface { - MONGO_DISALLOW_COPYING(StorageInterfaceMock); + StorageInterfaceMock(const StorageInterfaceMock&) = delete; + StorageInterfaceMock& operator=(const StorageInterfaceMock&) = delete; public: // Used for testing. diff --git a/src/mongo/db/repl/sync_source_feedback.h b/src/mongo/db/repl/sync_source_feedback.h index 855e10f6523..a75cb23ad64 100644 --- a/src/mongo/db/repl/sync_source_feedback.h +++ b/src/mongo/db/repl/sync_source_feedback.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/repl/replication_coordinator.h" #include "mongo/stdx/condition_variable.h" @@ -49,7 +48,8 @@ class BackgroundSync; class Reporter; class SyncSourceFeedback { - MONGO_DISALLOW_COPYING(SyncSourceFeedback); + SyncSourceFeedback(const SyncSourceFeedback&) = delete; + SyncSourceFeedback& operator=(const SyncSourceFeedback&) = delete; public: SyncSourceFeedback() = default; diff --git a/src/mongo/db/repl/sync_source_selector.h b/src/mongo/db/repl/sync_source_selector.h index 393837727bf..0a620d691a2 100644 --- a/src/mongo/db/repl/sync_source_selector.h +++ b/src/mongo/db/repl/sync_source_selector.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/rpc/metadata/oplog_query_metadata.h" #include "mongo/util/net/hostandport.h" #include "mongo/util/time_support.h" @@ -53,7 +52,8 @@ struct SyncSourceResolverResponse; * Manage list of viable and blocked sync sources that we can replicate from. */ class SyncSourceSelector { - MONGO_DISALLOW_COPYING(SyncSourceSelector); + SyncSourceSelector(const SyncSourceSelector&) = delete; + SyncSourceSelector& operator=(const SyncSourceSelector&) = delete; public: SyncSourceSelector() = default; diff --git a/src/mongo/db/repl/sync_source_selector_mock.h b/src/mongo/db/repl/sync_source_selector_mock.h index a9837bc6f0d..cbf8df0fe9f 100644 --- a/src/mongo/db/repl/sync_source_selector_mock.h +++ b/src/mongo/db/repl/sync_source_selector_mock.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl/optime.h" #include "mongo/db/repl/sync_source_selector.h" #include "mongo/stdx/functional.h" @@ -41,7 +40,8 @@ namespace repl { * Mock implementation of SyncSourceSelector interface for testing. */ class SyncSourceSelectorMock : public SyncSourceSelector { - MONGO_DISALLOW_COPYING(SyncSourceSelectorMock); + SyncSourceSelectorMock(const SyncSourceSelectorMock&) = delete; + SyncSourceSelectorMock& operator=(const SyncSourceSelectorMock&) = delete; public: using ChooseNewSyncSourceHook = stdx::function<void()>; diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index 5870c6e57e9..399bede7329 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -570,7 +570,8 @@ void tryToGoLiveAsASecondary(OperationContext* opCtx, } // namespace class SyncTail::OpQueueBatcher { - MONGO_DISALLOW_COPYING(OpQueueBatcher); + OpQueueBatcher(const OpQueueBatcher&) = delete; + OpQueueBatcher& operator=(const OpQueueBatcher&) = delete; public: OpQueueBatcher(SyncTail* syncTail, StorageInterface* storageInterface, OplogBuffer* oplogBuffer) diff --git a/src/mongo/db/repl/task_runner.h b/src/mongo/db/repl/task_runner.h index 19af9e8fbf8..a63a428177f 100644 --- a/src/mongo/db/repl/task_runner.h +++ b/src/mongo/db/repl/task_runner.h @@ -31,7 +31,6 @@ #include <list> -#include "mongo/base/disallow_copying.h" #include "mongo/db/service_context.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/functional.h" @@ -47,7 +46,8 @@ class OperationContext; namespace repl { class TaskRunner { - MONGO_DISALLOW_COPYING(TaskRunner); + TaskRunner(const TaskRunner&) = delete; + TaskRunner& operator=(const TaskRunner&) = delete; public: /** diff --git a/src/mongo/db/repl/timestamp_block.h b/src/mongo/db/repl/timestamp_block.h index 1f512128d93..4d47ec3146a 100644 --- a/src/mongo/db/repl/timestamp_block.h +++ b/src/mongo/db/repl/timestamp_block.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/bson/timestamp.h" #include "mongo/db/operation_context.h" @@ -41,7 +40,8 @@ namespace mongo { * TimestampBlock is in scope. */ class TimestampBlock { - MONGO_DISALLOW_COPYING(TimestampBlock); + TimestampBlock(const TimestampBlock&) = delete; + TimestampBlock& operator=(const TimestampBlock&) = delete; public: TimestampBlock(OperationContext* opCtx, Timestamp ts); diff --git a/src/mongo/db/repl/topology_coordinator.h b/src/mongo/db/repl/topology_coordinator.h index d84adb67f43..9b89cd0bce7 100644 --- a/src/mongo/db/repl/topology_coordinator.h +++ b/src/mongo/db/repl/topology_coordinator.h @@ -32,7 +32,6 @@ #include <iosfwd> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl/last_vote.h" #include "mongo/db/repl/repl_set_heartbeat_response.h" #include "mongo/db/repl/replication_coordinator.h" @@ -65,7 +64,8 @@ const int kMaxHeartbeatRetries = 2; * Methods of this class should be non-blocking. */ class TopologyCoordinator { - MONGO_DISALLOW_COPYING(TopologyCoordinator); + TopologyCoordinator(const TopologyCoordinator&) = delete; + TopologyCoordinator& operator=(const TopologyCoordinator&) = delete; public: /** diff --git a/src/mongo/db/repl/vote_requester.h b/src/mongo/db/repl/vote_requester.h index 396080834e2..c411065a988 100644 --- a/src/mongo/db/repl/vote_requester.h +++ b/src/mongo/db/repl/vote_requester.h @@ -32,7 +32,6 @@ #include <memory> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/timestamp.h" #include "mongo/db/repl/optime.h" #include "mongo/db/repl/repl_set_config.h" @@ -49,7 +48,8 @@ class Status; namespace repl { class VoteRequester { - MONGO_DISALLOW_COPYING(VoteRequester); + VoteRequester(const VoteRequester&) = delete; + VoteRequester& operator=(const VoteRequester&) = delete; public: enum class Result { kSuccessfullyElected, kStaleTerm, kInsufficientVotes, kPrimaryRespondedNo }; diff --git a/src/mongo/db/retryable_writes_stats.h b/src/mongo/db/retryable_writes_stats.h index 6f7068d5087..f2ba00e5e23 100644 --- a/src/mongo/db/retryable_writes_stats.h +++ b/src/mongo/db/retryable_writes_stats.h @@ -40,7 +40,8 @@ namespace mongo { * Container for retryable writes statistics. */ class RetryableWritesStats { - MONGO_DISALLOW_COPYING(RetryableWritesStats); + RetryableWritesStats(const RetryableWritesStats&) = delete; + RetryableWritesStats& operator=(const RetryableWritesStats&) = delete; public: RetryableWritesStats() = default; diff --git a/src/mongo/db/s/active_migrations_registry.h b/src/mongo/db/s/active_migrations_registry.h index 6c62ab2b30d..d2e3f4b2ad0 100644 --- a/src/mongo/db/s/active_migrations_registry.h +++ b/src/mongo/db/s/active_migrations_registry.h @@ -31,7 +31,6 @@ #include <boost/optional.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/db/s/migration_session_id.h" #include "mongo/s/request_types/move_chunk_request.h" #include "mongo/stdx/memory.h" @@ -51,7 +50,8 @@ class StatusWith; * to only one per shard. There is only one instance of this object per shard. */ class ActiveMigrationsRegistry { - MONGO_DISALLOW_COPYING(ActiveMigrationsRegistry); + ActiveMigrationsRegistry(const ActiveMigrationsRegistry&) = delete; + ActiveMigrationsRegistry& operator=(const ActiveMigrationsRegistry&) = delete; public: ActiveMigrationsRegistry(); @@ -167,7 +167,8 @@ private: * registerDonateChunk method for more details. */ class ScopedDonateChunk { - MONGO_DISALLOW_COPYING(ScopedDonateChunk); + ScopedDonateChunk(const ScopedDonateChunk&) = delete; + ScopedDonateChunk& operator=(const ScopedDonateChunk&) = delete; public: ScopedDonateChunk(ActiveMigrationsRegistry* registry, @@ -220,7 +221,8 @@ private: * registry. */ class ScopedReceiveChunk { - MONGO_DISALLOW_COPYING(ScopedReceiveChunk); + ScopedReceiveChunk(const ScopedReceiveChunk&) = delete; + ScopedReceiveChunk& operator=(const ScopedReceiveChunk&) = delete; public: ScopedReceiveChunk(ActiveMigrationsRegistry* registry); diff --git a/src/mongo/db/s/active_move_primaries_registry.h b/src/mongo/db/s/active_move_primaries_registry.h index 544300ec347..8ddd051478e 100644 --- a/src/mongo/db/s/active_move_primaries_registry.h +++ b/src/mongo/db/s/active_move_primaries_registry.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/s/request_types/move_primary_gen.h" #include "mongo/util/concurrency/notification.h" @@ -43,7 +42,8 @@ class ScopedMovePrimary; */ class ActiveMovePrimariesRegistry { - MONGO_DISALLOW_COPYING(ActiveMovePrimariesRegistry); + ActiveMovePrimariesRegistry(const ActiveMovePrimariesRegistry&) = delete; + ActiveMovePrimariesRegistry& operator=(const ActiveMovePrimariesRegistry&) = delete; public: ActiveMovePrimariesRegistry(); @@ -112,7 +112,8 @@ private: * registerMovePrimary for more details. */ class ScopedMovePrimary { - MONGO_DISALLOW_COPYING(ScopedMovePrimary); + ScopedMovePrimary(const ScopedMovePrimary&) = delete; + ScopedMovePrimary& operator=(const ScopedMovePrimary&) = delete; public: ScopedMovePrimary(ActiveMovePrimariesRegistry* registry, diff --git a/src/mongo/db/s/active_shard_collection_registry.h b/src/mongo/db/s/active_shard_collection_registry.h index 5da43ed446b..cab710b5ee5 100644 --- a/src/mongo/db/s/active_shard_collection_registry.h +++ b/src/mongo/db/s/active_shard_collection_registry.h @@ -31,7 +31,6 @@ #include <boost/optional.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/s/request_types/shard_collection_gen.h" #include "mongo/stdx/memory.h" #include "mongo/stdx/mutex.h" @@ -49,7 +48,8 @@ class StatusWith; * one instance of this object per shard. */ class ActiveShardCollectionRegistry { - MONGO_DISALLOW_COPYING(ActiveShardCollectionRegistry); + ActiveShardCollectionRegistry(const ActiveShardCollectionRegistry&) = delete; + ActiveShardCollectionRegistry& operator=(const ActiveShardCollectionRegistry&) = delete; public: ActiveShardCollectionRegistry(); @@ -119,7 +119,8 @@ private: * registerShardCollection method for more details. */ class ScopedShardCollection { - MONGO_DISALLOW_COPYING(ScopedShardCollection); + ScopedShardCollection(const ScopedShardCollection&) = delete; + ScopedShardCollection& operator=(const ScopedShardCollection&) = delete; public: ScopedShardCollection(std::string nss, diff --git a/src/mongo/db/s/balancer/balancer.h b/src/mongo/db/s/balancer/balancer.h index 91a8e9280b6..2b6738def19 100644 --- a/src/mongo/db/s/balancer/balancer.h +++ b/src/mongo/db/s/balancer/balancer.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/s/balancer/balancer_chunk_selection_policy.h" #include "mongo/db/s/balancer/balancer_random.h" #include "mongo/db/s/balancer/migration_manager.h" @@ -55,7 +54,8 @@ class Status; * loaded shards. It would issue a request for a chunk migration per round, if it found so. */ class Balancer { - MONGO_DISALLOW_COPYING(Balancer); + Balancer(const Balancer&) = delete; + Balancer& operator=(const Balancer&) = delete; public: Balancer(ServiceContext* serviceContext); diff --git a/src/mongo/db/s/balancer/balancer_chunk_selection_policy.h b/src/mongo/db/s/balancer/balancer_chunk_selection_policy.h index eff68e36462..2557cebd602 100644 --- a/src/mongo/db/s/balancer/balancer_chunk_selection_policy.h +++ b/src/mongo/db/s/balancer/balancer_chunk_selection_policy.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/s/balancer/balancer_policy.h" #include "mongo/s/catalog/type_chunk.h" #include "mongo/s/chunk_version.h" @@ -51,7 +50,8 @@ class StatusWith; * 'balanced' means. */ class BalancerChunkSelectionPolicy { - MONGO_DISALLOW_COPYING(BalancerChunkSelectionPolicy); + BalancerChunkSelectionPolicy(const BalancerChunkSelectionPolicy&) = delete; + BalancerChunkSelectionPolicy& operator=(const BalancerChunkSelectionPolicy&) = delete; public: /** diff --git a/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp b/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp index 56dbb896b30..93fdf758f9c 100644 --- a/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp +++ b/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp @@ -117,7 +117,8 @@ StatusWith<DistributionStatus> createCollectionDistributionStatus( * splitting a chunk does not yield the same chunk anymore. */ class SplitCandidatesBuffer { - MONGO_DISALLOW_COPYING(SplitCandidatesBuffer); + SplitCandidatesBuffer(const SplitCandidatesBuffer&) = delete; + SplitCandidatesBuffer& operator=(const SplitCandidatesBuffer&) = delete; public: SplitCandidatesBuffer(NamespaceString nss, ChunkVersion collectionVersion) diff --git a/src/mongo/db/s/balancer/balancer_policy.h b/src/mongo/db/s/balancer/balancer_policy.h index dbeeb6d86cc..28592a34743 100644 --- a/src/mongo/db/s/balancer/balancer_policy.h +++ b/src/mongo/db/s/balancer/balancer_policy.h @@ -32,7 +32,6 @@ #include <set> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonobj.h" #include "mongo/bson/simple_bsonobj_comparator.h" #include "mongo/db/namespace_string.h" @@ -76,7 +75,8 @@ typedef std::map<ShardId, std::vector<ChunkType>> ShardToChunksMap; * query utilization statististics and to decide what to balance. */ class DistributionStatus { - MONGO_DISALLOW_COPYING(DistributionStatus); + DistributionStatus(const DistributionStatus&) = delete; + DistributionStatus& operator=(const DistributionStatus&) = delete; public: DistributionStatus(NamespaceString nss, ShardToChunksMap shardToChunksMap); diff --git a/src/mongo/db/s/balancer/cluster_statistics.h b/src/mongo/db/s/balancer/cluster_statistics.h index 4531d496403..32f6cb9f7c5 100644 --- a/src/mongo/db/s/balancer/cluster_statistics.h +++ b/src/mongo/db/s/balancer/cluster_statistics.h @@ -34,7 +34,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/s/client/shard.h" namespace mongo { @@ -50,7 +49,8 @@ class StatusWith; * the statistics collection. There should be one instance of this object per service context. */ class ClusterStatistics { - MONGO_DISALLOW_COPYING(ClusterStatistics); + ClusterStatistics(const ClusterStatistics&) = delete; + ClusterStatistics& operator=(const ClusterStatistics&) = delete; public: /** diff --git a/src/mongo/db/s/balancer/migration_manager.h b/src/mongo/db/s/balancer/migration_manager.h index 81adb434c33..4f6c1288571 100644 --- a/src/mongo/db/s/balancer/migration_manager.h +++ b/src/mongo/db/s/balancer/migration_manager.h @@ -33,7 +33,6 @@ #include <map> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonobj.h" #include "mongo/db/namespace_string.h" #include "mongo/db/s/balancer/balancer_policy.h" @@ -64,7 +63,8 @@ typedef std::map<MigrationIdentifier, Status> MigrationStatuses; * Manages and executes parallel migrations for the balancer. */ class MigrationManager { - MONGO_DISALLOW_COPYING(MigrationManager); + MigrationManager(const MigrationManager&) = delete; + MigrationManager& operator=(const MigrationManager&) = delete; public: MigrationManager(ServiceContext* serviceContext); diff --git a/src/mongo/db/s/balancer/scoped_migration_request.h b/src/mongo/db/s/balancer/scoped_migration_request.h index ecbb3f4c9ea..bfb58ba103c 100644 --- a/src/mongo/db/s/balancer/scoped_migration_request.h +++ b/src/mongo/db/s/balancer/scoped_migration_request.h @@ -46,7 +46,8 @@ namespace mongo { * This class should only be used by the Balancer! */ class ScopedMigrationRequest { - MONGO_DISALLOW_COPYING(ScopedMigrationRequest); + ScopedMigrationRequest(const ScopedMigrationRequest&) = delete; + ScopedMigrationRequest& operator=(const ScopedMigrationRequest&) = delete; public: /** diff --git a/src/mongo/db/s/catalog_cache_loader_mock.h b/src/mongo/db/s/catalog_cache_loader_mock.h index 9420e4daed6..a325a9574b9 100644 --- a/src/mongo/db/s/catalog_cache_loader_mock.h +++ b/src/mongo/db/s/catalog_cache_loader_mock.h @@ -39,7 +39,8 @@ namespace mongo { * facilitate testing of classes that use a CatalogCacheLoader. */ class CatalogCacheLoaderMock final : public CatalogCacheLoader { - MONGO_DISALLOW_COPYING(CatalogCacheLoaderMock); + CatalogCacheLoaderMock(const CatalogCacheLoaderMock&) = delete; + CatalogCacheLoaderMock& operator=(const CatalogCacheLoaderMock&) = delete; public: CatalogCacheLoaderMock(); diff --git a/src/mongo/db/s/chunk_split_state_driver.h b/src/mongo/db/s/chunk_split_state_driver.h index 711d35696e4..9c65bfb7cf3 100644 --- a/src/mongo/db/s/chunk_split_state_driver.h +++ b/src/mongo/db/s/chunk_split_state_driver.h @@ -33,7 +33,6 @@ #include <boost/optional.hpp> #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/s/chunk_writes_tracker.h" @@ -47,7 +46,8 @@ namespace mongo { * the ChunkSplitter which will drive these state changes. */ class ChunkSplitStateDriver final { - MONGO_DISALLOW_COPYING(ChunkSplitStateDriver); + ChunkSplitStateDriver(const ChunkSplitStateDriver&) = delete; + ChunkSplitStateDriver& operator=(const ChunkSplitStateDriver&) = delete; public: /** diff --git a/src/mongo/db/s/chunk_splitter.h b/src/mongo/db/s/chunk_splitter.h index d942752f126..ef774dc017c 100644 --- a/src/mongo/db/s/chunk_splitter.h +++ b/src/mongo/db/s/chunk_splitter.h @@ -43,7 +43,8 @@ class ChunkSplitStateDriver; * Handles asynchronous auto-splitting of chunks. */ class ChunkSplitter { - MONGO_DISALLOW_COPYING(ChunkSplitter); + ChunkSplitter(const ChunkSplitter&) = delete; + ChunkSplitter& operator=(const ChunkSplitter&) = delete; public: ChunkSplitter(); diff --git a/src/mongo/db/s/collection_range_deleter.h b/src/mongo/db/s/collection_range_deleter.h index cbd67f3fa51..9a084fdcf35 100644 --- a/src/mongo/db/s/collection_range_deleter.h +++ b/src/mongo/db/s/collection_range_deleter.h @@ -30,7 +30,6 @@ #include <list> -#include "mongo/base/disallow_copying.h" #include "mongo/db/namespace_string.h" #include "mongo/executor/task_executor.h" #include "mongo/s/catalog/type_chunk.h" @@ -55,7 +54,8 @@ extern AtomicWord<int> rangeDeleterBatchSize; extern AtomicWord<int> rangeDeleterBatchDelayMS; class CollectionRangeDeleter { - MONGO_DISALLOW_COPYING(CollectionRangeDeleter); + CollectionRangeDeleter(const CollectionRangeDeleter&) = delete; + CollectionRangeDeleter& operator=(const CollectionRangeDeleter&) = delete; public: /** diff --git a/src/mongo/db/s/collection_sharding_runtime.h b/src/mongo/db/s/collection_sharding_runtime.h index 3c14a46db31..d2aefc10ff4 100644 --- a/src/mongo/db/s/collection_sharding_runtime.h +++ b/src/mongo/db/s/collection_sharding_runtime.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/namespace_string.h" #include "mongo/db/s/collection_sharding_state.h" @@ -48,7 +47,8 @@ extern AtomicWord<int> migrationLockAcquisitionMaxWaitMS; */ class CollectionShardingRuntime final : public CollectionShardingState, public Decorable<CollectionShardingRuntime> { - MONGO_DISALLOW_COPYING(CollectionShardingRuntime); + CollectionShardingRuntime(const CollectionShardingRuntime&) = delete; + CollectionShardingRuntime& operator=(const CollectionShardingRuntime&) = delete; public: CollectionShardingRuntime(ServiceContext* sc, @@ -163,7 +163,8 @@ private: * RAII-style class, which obtains a reference to the critical section for the specified collection. */ class CollectionCriticalSection { - MONGO_DISALLOW_COPYING(CollectionCriticalSection); + CollectionCriticalSection(const CollectionCriticalSection&) = delete; + CollectionCriticalSection& operator=(const CollectionCriticalSection&) = delete; public: CollectionCriticalSection(OperationContext* opCtx, NamespaceString ns); diff --git a/src/mongo/db/s/collection_sharding_state.cpp b/src/mongo/db/s/collection_sharding_state.cpp index 1ce7bd0f7b2..7c572a029cd 100644 --- a/src/mongo/db/s/collection_sharding_state.cpp +++ b/src/mongo/db/s/collection_sharding_state.cpp @@ -44,7 +44,8 @@ namespace mongo { namespace { class CollectionShardingStateMap { - MONGO_DISALLOW_COPYING(CollectionShardingStateMap); + CollectionShardingStateMap(const CollectionShardingStateMap&) = delete; + CollectionShardingStateMap& operator=(const CollectionShardingStateMap&) = delete; public: static const ServiceContext::Decoration<boost::optional<CollectionShardingStateMap>> get; diff --git a/src/mongo/db/s/collection_sharding_state.h b/src/mongo/db/s/collection_sharding_state.h index 1f1a0c76e6f..9991a1811ab 100644 --- a/src/mongo/db/s/collection_sharding_state.h +++ b/src/mongo/db/s/collection_sharding_state.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/logical_time.h" #include "mongo/db/namespace_string.h" #include "mongo/db/s/scoped_collection_metadata.h" @@ -53,7 +52,8 @@ namespace mongo { * lock on the respective collection. */ class CollectionShardingState { - MONGO_DISALLOW_COPYING(CollectionShardingState); + CollectionShardingState(const CollectionShardingState&) = delete; + CollectionShardingState& operator=(const CollectionShardingState&) = delete; public: using CSRLock = ShardingStateLock<CollectionShardingState>; @@ -172,7 +172,8 @@ private: * which is running. */ class CollectionShardingStateFactory { - MONGO_DISALLOW_COPYING(CollectionShardingStateFactory); + CollectionShardingStateFactory(const CollectionShardingStateFactory&) = delete; + CollectionShardingStateFactory& operator=(const CollectionShardingStateFactory&) = delete; public: static void set(ServiceContext* service, diff --git a/src/mongo/db/s/config/namespace_serializer.h b/src/mongo/db/s/config/namespace_serializer.h index aecc08f9355..7b7832ebbe7 100644 --- a/src/mongo/db/s/config/namespace_serializer.h +++ b/src/mongo/db/s/config/namespace_serializer.h @@ -44,7 +44,8 @@ namespace mongo { class OperationContext; class NamespaceSerializer { - MONGO_DISALLOW_COPYING(NamespaceSerializer); + NamespaceSerializer(const NamespaceSerializer&) = delete; + NamespaceSerializer& operator=(const NamespaceSerializer&) = delete; public: class ScopedLock { diff --git a/src/mongo/db/s/config/sharding_catalog_manager.h b/src/mongo/db/s/config/sharding_catalog_manager.h index 071085395cc..f60833c490e 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager.h +++ b/src/mongo/db/s/config/sharding_catalog_manager.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/db/repl/optime_with.h" @@ -69,7 +68,8 @@ enum ShardDrainingStatus { * moved out of ShardingCatalogClient and into this class. */ class ShardingCatalogManager { - MONGO_DISALLOW_COPYING(ShardingCatalogManager); + ShardingCatalogManager(const ShardingCatalogManager&) = delete; + ShardingCatalogManager& operator=(const ShardingCatalogManager&) = delete; friend class ConfigSvrShardCollectionCommand; public: diff --git a/src/mongo/db/s/config_server_op_observer.h b/src/mongo/db/s/config_server_op_observer.h index 08e1dfd0cf4..bf804fbf6c4 100644 --- a/src/mongo/db/s/config_server_op_observer.h +++ b/src/mongo/db/s/config_server_op_observer.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/op_observer.h" namespace mongo { @@ -39,7 +38,8 @@ namespace mongo { * server (--configsvr). */ class ConfigServerOpObserver final : public OpObserver { - MONGO_DISALLOW_COPYING(ConfigServerOpObserver); + ConfigServerOpObserver(const ConfigServerOpObserver&) = delete; + ConfigServerOpObserver& operator=(const ConfigServerOpObserver&) = delete; public: ConfigServerOpObserver(); diff --git a/src/mongo/db/s/database_sharding_state.h b/src/mongo/db/s/database_sharding_state.h index 2cd7be76f04..a580e5bf4dc 100644 --- a/src/mongo/db/s/database_sharding_state.h +++ b/src/mongo/db/s/database_sharding_state.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/catalog/database.h" #include "mongo/db/s/sharding_migration_critical_section.h" #include "mongo/db/s/sharding_state_lock.h" @@ -44,7 +43,8 @@ class OperationContext; * Synchronizes access to this shard server's cached database version for Database. */ class DatabaseShardingState { - MONGO_DISALLOW_COPYING(DatabaseShardingState); + DatabaseShardingState(const DatabaseShardingState&) = delete; + DatabaseShardingState& operator=(const DatabaseShardingState&) = delete; public: /** diff --git a/src/mongo/db/s/metadata_manager.h b/src/mongo/db/s/metadata_manager.h index ca5e5f98048..9c7842386a1 100644 --- a/src/mongo/db/s/metadata_manager.h +++ b/src/mongo/db/s/metadata_manager.h @@ -31,7 +31,6 @@ #include <list> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/simple_bsonobj_comparator.h" #include "mongo/db/logical_time.h" #include "mongo/db/namespace_string.h" @@ -50,7 +49,8 @@ namespace mongo { class RangePreserver; class MetadataManager { - MONGO_DISALLOW_COPYING(MetadataManager); + MetadataManager(const MetadataManager&) = delete; + MetadataManager& operator=(const MetadataManager&) = delete; public: using CleanupNotification = CollectionRangeDeleter::DeleteNotification; @@ -152,7 +152,8 @@ private: * point in time along with a counter of how many queries are still using it. */ struct CollectionMetadataTracker { - MONGO_DISALLOW_COPYING(CollectionMetadataTracker); + CollectionMetadataTracker(const CollectionMetadataTracker&) = delete; + CollectionMetadataTracker& operator=(const CollectionMetadataTracker&) = delete; CollectionMetadataTracker(CollectionMetadata inMetadata) : metadata(std::move(inMetadata)) {} diff --git a/src/mongo/db/s/migration_chunk_cloner_source.h b/src/mongo/db/s/migration_chunk_cloner_source.h index 3584c7f60f6..6a734595ba4 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source.h +++ b/src/mongo/db/s/migration_chunk_cloner_source.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/util/time_support.h" namespace mongo { @@ -58,7 +57,8 @@ class OpTime; * kicks off the cloning as soon as possible by calling startClone. */ class MigrationChunkClonerSource { - MONGO_DISALLOW_COPYING(MigrationChunkClonerSource); + MigrationChunkClonerSource(const MigrationChunkClonerSource&) = delete; + MigrationChunkClonerSource& operator=(const MigrationChunkClonerSource&) = delete; public: virtual ~MigrationChunkClonerSource(); diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.h b/src/mongo/db/s/migration_chunk_cloner_source_legacy.h index aa8fda0530c..3874f03e76a 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.h +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.h @@ -55,7 +55,8 @@ class Database; class RecordId; class MigrationChunkClonerSourceLegacy final : public MigrationChunkClonerSource { - MONGO_DISALLOW_COPYING(MigrationChunkClonerSourceLegacy); + MigrationChunkClonerSourceLegacy(const MigrationChunkClonerSourceLegacy&) = delete; + MigrationChunkClonerSourceLegacy& operator=(const MigrationChunkClonerSourceLegacy&) = delete; public: MigrationChunkClonerSourceLegacy(MoveChunkRequest request, diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp index 192551cc5e7..fed421be24d 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp @@ -57,7 +57,8 @@ namespace { * the session ids match. */ class AutoGetActiveCloner { - MONGO_DISALLOW_COPYING(AutoGetActiveCloner); + AutoGetActiveCloner(const AutoGetActiveCloner&) = delete; + AutoGetActiveCloner& operator=(const AutoGetActiveCloner&) = delete; public: AutoGetActiveCloner(OperationContext* opCtx, const MigrationSessionId& migrationSessionId) { diff --git a/src/mongo/db/s/migration_destination_manager.h b/src/mongo/db/s/migration_destination_manager.h index 655546c62bb..dcda2e37bee 100644 --- a/src/mongo/db/s/migration_destination_manager.h +++ b/src/mongo/db/s/migration_destination_manager.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsonobj.h" #include "mongo/bson/bsonobjbuilder.h" @@ -64,7 +63,8 @@ class OpTime; * Drives the receiving side of the MongoD migration process. One instance exists per shard. */ class MigrationDestinationManager { - MONGO_DISALLOW_COPYING(MigrationDestinationManager); + MigrationDestinationManager(const MigrationDestinationManager&) = delete; + MigrationDestinationManager& operator=(const MigrationDestinationManager&) = delete; public: enum State { READY, CLONE, CATCHUP, STEADY, COMMIT_START, DONE, FAIL, ABORT }; diff --git a/src/mongo/db/s/migration_session_id.h b/src/mongo/db/s/migration_session_id.h index 91016f3c8aa..923427822de 100644 --- a/src/mongo/db/s/migration_session_id.h +++ b/src/mongo/db/s/migration_session_id.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" namespace mongo { diff --git a/src/mongo/db/s/migration_source_manager.h b/src/mongo/db/s/migration_source_manager.h index a01185f5269..b567b5ad7ce 100644 --- a/src/mongo/db/s/migration_source_manager.h +++ b/src/mongo/db/s/migration_source_manager.h @@ -31,7 +31,6 @@ #include <boost/optional.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/db/s/collection_sharding_runtime.h" #include "mongo/db/s/migration_chunk_cloner_source.h" #include "mongo/s/request_types/move_chunk_request.h" @@ -68,7 +67,8 @@ struct ShardingStatistics; * is the commitDonateChunk and its comments explain the reasoning. */ class MigrationSourceManager { - MONGO_DISALLOW_COPYING(MigrationSourceManager); + MigrationSourceManager(const MigrationSourceManager&) = delete; + MigrationSourceManager& operator=(const MigrationSourceManager&) = delete; public: /** diff --git a/src/mongo/db/s/move_primary_source_manager.h b/src/mongo/db/s/move_primary_source_manager.h index eba8d63172a..51c78b4f408 100644 --- a/src/mongo/db/s/move_primary_source_manager.h +++ b/src/mongo/db/s/move_primary_source_manager.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/s/database_sharding_state.h" #include "mongo/s/request_types/move_primary_gen.h" #include "mongo/s/shard_id.h" @@ -62,7 +61,8 @@ class Status; * which case the destructor will take care of clean up based on how far we have advanced. */ class MovePrimarySourceManager { - MONGO_DISALLOW_COPYING(MovePrimarySourceManager); + MovePrimarySourceManager(const MovePrimarySourceManager&) = delete; + MovePrimarySourceManager& operator=(const MovePrimarySourceManager&) = delete; public: /** diff --git a/src/mongo/db/s/namespace_metadata_change_notifications.h b/src/mongo/db/s/namespace_metadata_change_notifications.h index f97714135da..ba7c51e86a0 100644 --- a/src/mongo/db/s/namespace_metadata_change_notifications.h +++ b/src/mongo/db/s/namespace_metadata_change_notifications.h @@ -32,7 +32,6 @@ #include <list> #include <map> -#include "mongo/base/disallow_copying.h" #include "mongo/db/namespace_string.h" #include "mongo/stdx/mutex.h" #include "mongo/util/concurrency/notification.h" @@ -45,7 +44,9 @@ class OperationContext; * Map of one-snot notifications for changes to a particular namespace. */ class NamespaceMetadataChangeNotifications { - MONGO_DISALLOW_COPYING(NamespaceMetadataChangeNotifications); + NamespaceMetadataChangeNotifications(const NamespaceMetadataChangeNotifications&) = delete; + NamespaceMetadataChangeNotifications& operator=(const NamespaceMetadataChangeNotifications&) = + delete; struct NotificationToken; @@ -60,7 +61,8 @@ public: * out of scope, if it has not been signalled yet. */ class ScopedNotification { - MONGO_DISALLOW_COPYING(ScopedNotification); + ScopedNotification(const ScopedNotification&) = delete; + ScopedNotification& operator=(const ScopedNotification&) = delete; public: ScopedNotification(NamespaceMetadataChangeNotifications* notifications, diff --git a/src/mongo/db/s/operation_sharding_state.h b/src/mongo/db/s/operation_sharding_state.h index 4358d6c9a21..c24b451e274 100644 --- a/src/mongo/db/s/operation_sharding_state.h +++ b/src/mongo/db/s/operation_sharding_state.h @@ -31,7 +31,6 @@ #include <boost/optional.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/db/namespace_string.h" #include "mongo/s/chunk_version.h" #include "mongo/s/database_version_gen.h" @@ -51,7 +50,8 @@ class OperationContext; * Note: This only supports storing the version for a single namespace. */ class OperationShardingState { - MONGO_DISALLOW_COPYING(OperationShardingState); + OperationShardingState(const OperationShardingState&) = delete; + OperationShardingState& operator=(const OperationShardingState&) = delete; public: OperationShardingState(); diff --git a/src/mongo/db/s/periodic_balancer_config_refresher.h b/src/mongo/db/s/periodic_balancer_config_refresher.h index 5407dd6baf3..96a36202025 100644 --- a/src/mongo/db/s/periodic_balancer_config_refresher.h +++ b/src/mongo/db/s/periodic_balancer_config_refresher.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/util/periodic_runner.h" namespace mongo { @@ -38,7 +37,8 @@ class OperationContext; class ServiceContext; class PeriodicBalancerConfigRefresher final { - MONGO_DISALLOW_COPYING(PeriodicBalancerConfigRefresher); + PeriodicBalancerConfigRefresher(const PeriodicBalancerConfigRefresher&) = delete; + PeriodicBalancerConfigRefresher& operator=(const PeriodicBalancerConfigRefresher&) = delete; public: PeriodicBalancerConfigRefresher() = default; diff --git a/src/mongo/db/s/scoped_operation_completion_sharding_actions.h b/src/mongo/db/s/scoped_operation_completion_sharding_actions.h index 039274b399f..de61f5fbfd2 100644 --- a/src/mongo/db/s/scoped_operation_completion_sharding_actions.h +++ b/src/mongo/db/s/scoped_operation_completion_sharding_actions.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/util/polymorphic_scoped.h" namespace mongo { @@ -42,7 +41,10 @@ namespace mongo { class OperationContext; class ScopedOperationCompletionShardingActions : public PolymorphicScoped { - MONGO_DISALLOW_COPYING(ScopedOperationCompletionShardingActions); + ScopedOperationCompletionShardingActions(const ScopedOperationCompletionShardingActions&) = + delete; + ScopedOperationCompletionShardingActions& operator=( + const ScopedOperationCompletionShardingActions&) = delete; public: ScopedOperationCompletionShardingActions(OperationContext* opCtx); diff --git a/src/mongo/db/s/session_catalog_migration_destination.h b/src/mongo/db/s/session_catalog_migration_destination.h index 821e56bea8e..89c43be2e62 100644 --- a/src/mongo/db/s/session_catalog_migration_destination.h +++ b/src/mongo/db/s/session_catalog_migration_destination.h @@ -32,7 +32,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" #include "mongo/db/repl/oplog_entry.h" @@ -54,7 +53,9 @@ class OperationContext; * the source migration shard. */ class SessionCatalogMigrationDestination { - MONGO_DISALLOW_COPYING(SessionCatalogMigrationDestination); + SessionCatalogMigrationDestination(const SessionCatalogMigrationDestination&) = delete; + SessionCatalogMigrationDestination& operator=(const SessionCatalogMigrationDestination&) = + delete; public: enum class State { diff --git a/src/mongo/db/s/session_catalog_migration_source.h b/src/mongo/db/s/session_catalog_migration_source.h index b866e89e84a..c84bc5fb713 100644 --- a/src/mongo/db/s/session_catalog_migration_source.h +++ b/src/mongo/db/s/session_catalog_migration_source.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/client/dbclient_cursor.h" #include "mongo/db/namespace_string.h" #include "mongo/db/repl/optime.h" @@ -70,7 +69,8 @@ class ServiceContext; * it would be wrong to wait for the highest opTime in this case. */ class SessionCatalogMigrationSource { - MONGO_DISALLOW_COPYING(SessionCatalogMigrationSource); + SessionCatalogMigrationSource(const SessionCatalogMigrationSource&) = delete; + SessionCatalogMigrationSource& operator=(const SessionCatalogMigrationSource&) = delete; public: struct OplogResult { diff --git a/src/mongo/db/s/shard_identity_rollback_notifier.h b/src/mongo/db/s/shard_identity_rollback_notifier.h index b36109abbb0..7a5141f3fc8 100644 --- a/src/mongo/db/s/shard_identity_rollback_notifier.h +++ b/src/mongo/db/s/shard_identity_rollback_notifier.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" namespace mongo { @@ -52,7 +51,8 @@ class ServiceContext; * exiting rollback, and there can only be one of those things happening at any given time. */ class ShardIdentityRollbackNotifier { - MONGO_DISALLOW_COPYING(ShardIdentityRollbackNotifier); + ShardIdentityRollbackNotifier(const ShardIdentityRollbackNotifier&) = delete; + ShardIdentityRollbackNotifier& operator=(const ShardIdentityRollbackNotifier&) = delete; public: ShardIdentityRollbackNotifier(); diff --git a/src/mongo/db/s/shard_server_catalog_cache_loader.h b/src/mongo/db/s/shard_server_catalog_cache_loader.h index c578217a3d5..9e998415793 100644 --- a/src/mongo/db/s/shard_server_catalog_cache_loader.h +++ b/src/mongo/db/s/shard_server_catalog_cache_loader.h @@ -46,7 +46,8 @@ namespace mongo { * retrieves chunk metadata from the shard persisted chunk metadata. */ class ShardServerCatalogCacheLoader : public CatalogCacheLoader { - MONGO_DISALLOW_COPYING(ShardServerCatalogCacheLoader); + ShardServerCatalogCacheLoader(const ShardServerCatalogCacheLoader&) = delete; + ShardServerCatalogCacheLoader& operator=(const ShardServerCatalogCacheLoader&) = delete; public: ShardServerCatalogCacheLoader(std::unique_ptr<CatalogCacheLoader> configServerLoader); @@ -98,7 +99,8 @@ private: * metadata for a specific collection. */ struct collAndChunkTask { - MONGO_DISALLOW_COPYING(collAndChunkTask); + collAndChunkTask(const collAndChunkTask&) = delete; + collAndChunkTask& operator=(const collAndChunkTask&) = delete; collAndChunkTask(collAndChunkTask&&) = default; /** @@ -234,7 +236,8 @@ private: * metadata for a specific database. */ struct DBTask { - MONGO_DISALLOW_COPYING(DBTask); + DBTask(const DBTask&) = delete; + DBTask& operator=(const DBTask&) = delete; DBTask(DBTask&&) = default; /** diff --git a/src/mongo/db/s/shard_server_op_observer.h b/src/mongo/db/s/shard_server_op_observer.h index e39089dbb32..339f5968bf8 100644 --- a/src/mongo/db/s/shard_server_op_observer.h +++ b/src/mongo/db/s/shard_server_op_observer.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/op_observer.h" #include "mongo/db/s/collection_sharding_runtime.h" @@ -40,7 +39,8 @@ namespace mongo { * server (--shardsvr). */ class ShardServerOpObserver final : public OpObserver { - MONGO_DISALLOW_COPYING(ShardServerOpObserver); + ShardServerOpObserver(const ShardServerOpObserver&) = delete; + ShardServerOpObserver& operator=(const ShardServerOpObserver&) = delete; public: ShardServerOpObserver(); diff --git a/src/mongo/db/s/sharded_connection_info.h b/src/mongo/db/s/sharded_connection_info.h index 1587f0be81b..e96cf41e49b 100644 --- a/src/mongo/db/s/sharded_connection_info.h +++ b/src/mongo/db/s/sharded_connection_info.h @@ -33,7 +33,6 @@ #include <map> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/s/chunk_version.h" namespace mongo { @@ -45,7 +44,8 @@ class Client; * namespace. */ class ShardedConnectionInfo { - MONGO_DISALLOW_COPYING(ShardedConnectionInfo); + ShardedConnectionInfo(const ShardedConnectionInfo&) = delete; + ShardedConnectionInfo& operator=(const ShardedConnectionInfo&) = delete; public: ShardedConnectionInfo(); diff --git a/src/mongo/db/s/sharding_initialization_mongod.h b/src/mongo/db/s/sharding_initialization_mongod.h index 4c01387cf16..e26302b4bb2 100644 --- a/src/mongo/db/s/sharding_initialization_mongod.h +++ b/src/mongo/db/s/sharding_initialization_mongod.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/db/s/sharding_state.h" #include "mongo/db/s/type_shard_identity.h" @@ -48,7 +47,8 @@ class ServiceContext; * ShardingState in the initialized state. */ class ShardingInitializationMongoD { - MONGO_DISALLOW_COPYING(ShardingInitializationMongoD); + ShardingInitializationMongoD(const ShardingInitializationMongoD&) = delete; + ShardingInitializationMongoD& operator=(const ShardingInitializationMongoD&) = delete; public: using ShardingEnvironmentInitFunc = stdx::function<void( diff --git a/src/mongo/db/s/sharding_migration_critical_section.h b/src/mongo/db/s/sharding_migration_critical_section.h index 2ab81097ee6..0dbc8fd4df4 100644 --- a/src/mongo/db/s/sharding_migration_critical_section.h +++ b/src/mongo/db/s/sharding_migration_critical_section.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/util/concurrency/notification.h" namespace mongo { @@ -44,7 +43,8 @@ namespace mongo { * transferred to the recipient shard. Databases effectively only support the commit phase. */ class ShardingMigrationCriticalSection { - MONGO_DISALLOW_COPYING(ShardingMigrationCriticalSection); + ShardingMigrationCriticalSection(const ShardingMigrationCriticalSection&) = delete; + ShardingMigrationCriticalSection& operator=(const ShardingMigrationCriticalSection&) = delete; public: ShardingMigrationCriticalSection(); diff --git a/src/mongo/db/s/sharding_state.h b/src/mongo/db/s/sharding_state.h index 1755d33293e..4b78d0bdfb4 100644 --- a/src/mongo/db/s/sharding_state.h +++ b/src/mongo/db/s/sharding_state.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/oid.h" #include "mongo/s/shard_id.h" #include "mongo/stdx/mutex.h" @@ -50,7 +49,8 @@ class ServiceContext; * never gets destroyed or uninitialized. */ class ShardingState { - MONGO_DISALLOW_COPYING(ShardingState); + ShardingState(const ShardingState&) = delete; + ShardingState& operator=(const ShardingState&) = delete; public: ShardingState(); diff --git a/src/mongo/db/s/sharding_state_lock.h b/src/mongo/db/s/sharding_state_lock.h index fc0bae7c4c1..620cd5f53a0 100644 --- a/src/mongo/db/s/sharding_state_lock.h +++ b/src/mongo/db/s/sharding_state_lock.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/concurrency/d_concurrency.h" #include "mongo/stdx/variant.h" diff --git a/src/mongo/db/s/transaction_coordinator.h b/src/mongo/db/s/transaction_coordinator.h index d47a39b9a88..a6bd7642d10 100644 --- a/src/mongo/db/s/transaction_coordinator.h +++ b/src/mongo/db/s/transaction_coordinator.h @@ -45,7 +45,8 @@ namespace mongo { * `onCompletion()`. */ class TransactionCoordinator { - MONGO_DISALLOW_COPYING(TransactionCoordinator); + TransactionCoordinator(const TransactionCoordinator&) = delete; + TransactionCoordinator& operator=(const TransactionCoordinator&) = delete; public: /** diff --git a/src/mongo/db/s/transaction_coordinator_catalog.h b/src/mongo/db/s/transaction_coordinator_catalog.h index 1605dbe8869..bc57f65e633 100644 --- a/src/mongo/db/s/transaction_coordinator_catalog.h +++ b/src/mongo/db/s/transaction_coordinator_catalog.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <map> -#include "mongo/base/disallow_copying.h" #include "mongo/db/s/transaction_coordinator.h" #include "mongo/stdx/condition_variable.h" #include "mongo/util/concurrency/with_lock.h" @@ -44,7 +43,8 @@ namespace mongo { * txnNumber. It supports holding several coordinator objects per session. */ class TransactionCoordinatorCatalog { - MONGO_DISALLOW_COPYING(TransactionCoordinatorCatalog); + TransactionCoordinatorCatalog(const TransactionCoordinatorCatalog&) = delete; + TransactionCoordinatorCatalog& operator=(const TransactionCoordinatorCatalog&) = delete; public: TransactionCoordinatorCatalog(); diff --git a/src/mongo/db/s/transaction_coordinator_driver.h b/src/mongo/db/s/transaction_coordinator_driver.h index bc9bbb825af..d4833562a2c 100644 --- a/src/mongo/db/s/transaction_coordinator_driver.h +++ b/src/mongo/db/s/transaction_coordinator_driver.h @@ -88,7 +88,8 @@ struct PrepareVoteConsensus { * no other operations are allowed until any returned futures are signalled. */ class TransactionCoordinatorDriver { - MONGO_DISALLOW_COPYING(TransactionCoordinatorDriver); + TransactionCoordinatorDriver(const TransactionCoordinatorDriver&) = delete; + TransactionCoordinatorDriver& operator=(const TransactionCoordinatorDriver&) = delete; public: TransactionCoordinatorDriver(ServiceContext* serviceContext, diff --git a/src/mongo/db/s/transaction_coordinator_service.h b/src/mongo/db/s/transaction_coordinator_service.h index 9cfdc68faab..8dfa59213e7 100644 --- a/src/mongo/db/s/transaction_coordinator_service.h +++ b/src/mongo/db/s/transaction_coordinator_service.h @@ -29,13 +29,13 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/s/transaction_coordinator_catalog.h" namespace mongo { class TransactionCoordinatorService { - MONGO_DISALLOW_COPYING(TransactionCoordinatorService); + TransactionCoordinatorService(const TransactionCoordinatorService&) = delete; + TransactionCoordinatorService& operator=(const TransactionCoordinatorService&) = delete; public: TransactionCoordinatorService(); diff --git a/src/mongo/db/s/wait_for_ongoing_chunk_splits_command.cpp b/src/mongo/db/s/wait_for_ongoing_chunk_splits_command.cpp index 06f8b8fa0c4..1ff67ff3257 100644 --- a/src/mongo/db/s/wait_for_ongoing_chunk_splits_command.cpp +++ b/src/mongo/db/s/wait_for_ongoing_chunk_splits_command.cpp @@ -39,7 +39,8 @@ namespace mongo { namespace { class WaitForOngoingChunksSplitsCommand final : public BasicCommand { - MONGO_DISALLOW_COPYING(WaitForOngoingChunksSplitsCommand); + WaitForOngoingChunksSplitsCommand(const WaitForOngoingChunksSplitsCommand&) = delete; + WaitForOngoingChunksSplitsCommand& operator=(const WaitForOngoingChunksSplitsCommand&) = delete; public: WaitForOngoingChunksSplitsCommand() : BasicCommand("waitForOngoingChunkSplits") {} diff --git a/src/mongo/db/server_transactions_metrics.h b/src/mongo/db/server_transactions_metrics.h index c6648bc2b01..035e9ad6ee0 100644 --- a/src/mongo/db/server_transactions_metrics.h +++ b/src/mongo/db/server_transactions_metrics.h @@ -43,7 +43,8 @@ namespace mongo { * Container for server-wide multi-document transaction statistics. */ class ServerTransactionsMetrics { - MONGO_DISALLOW_COPYING(ServerTransactionsMetrics); + ServerTransactionsMetrics(const ServerTransactionsMetrics&) = delete; + ServerTransactionsMetrics& operator=(const ServerTransactionsMetrics&) = delete; public: ServerTransactionsMetrics() = default; diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h index 5e54e8684d9..8a9741bcc42 100644 --- a/src/mongo/db/service_context.h +++ b/src/mongo/db/service_context.h @@ -33,7 +33,6 @@ #include <functional> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/global_initializer_registerer.h" #include "mongo/db/logical_session_id.h" #include "mongo/db/storage/storage_engine.h" @@ -70,7 +69,8 @@ class TransportLayer; * including limitations on the lifetime of registered listeners. */ class KillOpListenerInterface { - MONGO_DISALLOW_COPYING(KillOpListenerInterface); + KillOpListenerInterface(const KillOpListenerInterface&) = delete; + KillOpListenerInterface& operator=(const KillOpListenerInterface&) = delete; public: /** @@ -95,7 +95,8 @@ protected: * zero or more Clients, which in turn each own OperationContexts. */ class ServiceContext final : public Decorable<ServiceContext> { - MONGO_DISALLOW_COPYING(ServiceContext); + ServiceContext(const ServiceContext&) = delete; + ServiceContext& operator=(const ServiceContext&) = delete; public: /** diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp index 279962bb37f..a3077e08a38 100644 --- a/src/mongo/db/service_entry_point_common.cpp +++ b/src/mongo/db/service_entry_point_common.cpp @@ -198,7 +198,8 @@ void generateErrorResponse(OperationContext* opCtx, * elsewhere. */ class MaintenanceModeSetter { - MONGO_DISALLOW_COPYING(MaintenanceModeSetter); + MaintenanceModeSetter(const MaintenanceModeSetter&) = delete; + MaintenanceModeSetter& operator=(const MaintenanceModeSetter&) = delete; public: MaintenanceModeSetter(OperationContext* opCtx) diff --git a/src/mongo/db/service_entry_point_mongod.h b/src/mongo/db/service_entry_point_mongod.h index 9845e7ffdb3..57946da4d0e 100644 --- a/src/mongo/db/service_entry_point_mongod.h +++ b/src/mongo/db/service_entry_point_mongod.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/transport/service_entry_point_impl.h" namespace mongo { @@ -38,7 +37,8 @@ namespace mongo { * The entry point into mongod. Just a wrapper around assembleResponse. */ class ServiceEntryPointMongod final : public ServiceEntryPointImpl { - MONGO_DISALLOW_COPYING(ServiceEntryPointMongod); + ServiceEntryPointMongod(const ServiceEntryPointMongod&) = delete; + ServiceEntryPointMongod& operator=(const ServiceEntryPointMongod&) = delete; public: using ServiceEntryPointImpl::ServiceEntryPointImpl; diff --git a/src/mongo/db/session.h b/src/mongo/db/session.h index bd9d4d0dcbd..635f3fc7167 100644 --- a/src/mongo/db/session.h +++ b/src/mongo/db/session.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/logical_session_id.h" #include "mongo/db/operation_context.h" #include "mongo/util/concurrency/with_lock.h" @@ -42,7 +41,8 @@ namespace mongo { * server. Refer to SessionCatalog for more information on the semantics of sessions. */ class Session : public Decorable<Session> { - MONGO_DISALLOW_COPYING(Session); + Session(const Session&) = delete; + Session& operator=(const Session&) = delete; friend class ObservableSession; friend class SessionCatalog; diff --git a/src/mongo/db/session_catalog.h b/src/mongo/db/session_catalog.h index 23d656579f5..73cfcf40b1a 100644 --- a/src/mongo/db/session_catalog.h +++ b/src/mongo/db/session_catalog.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/client.h" #include "mongo/db/logical_session_id.h" #include "mongo/db/operation_context.h" @@ -51,7 +50,8 @@ class ObservableSession; * Keeps track of the transaction runtime state for every active session on this instance. */ class SessionCatalog { - MONGO_DISALLOW_COPYING(SessionCatalog); + SessionCatalog(const SessionCatalog&) = delete; + SessionCatalog& operator=(const SessionCatalog&) = delete; friend class ObservableSession; friend class OperationContextSession; @@ -295,7 +295,8 @@ private: * at destruction. */ class OperationContextSession { - MONGO_DISALLOW_COPYING(OperationContextSession); + OperationContextSession(const OperationContextSession&) = delete; + OperationContextSession& operator=(const OperationContextSession&) = delete; public: /** diff --git a/src/mongo/db/sorter/sorter.h b/src/mongo/db/sorter/sorter.h index 73e1eedbe92..f504d466ac3 100644 --- a/src/mongo/db/sorter/sorter.h +++ b/src/mongo/db/sorter/sorter.h @@ -36,7 +36,6 @@ #include <utility> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/util/builder.h" /** @@ -134,7 +133,8 @@ struct SortOptions { */ template <typename Key, typename Value> class SortIteratorInterface { - MONGO_DISALLOW_COPYING(SortIteratorInterface); + SortIteratorInterface(const SortIteratorInterface&) = delete; + SortIteratorInterface& operator=(const SortIteratorInterface&) = delete; public: typedef std::pair<Key, Value> Data; @@ -179,7 +179,8 @@ protected: */ template <typename Key, typename Value> class Sorter { - MONGO_DISALLOW_COPYING(Sorter); + Sorter(const Sorter&) = delete; + Sorter& operator=(const Sorter&) = delete; public: typedef std::pair<Key, Value> Data; @@ -219,7 +220,8 @@ protected: */ template <typename Key, typename Value> class SortedFileWriter { - MONGO_DISALLOW_COPYING(SortedFileWriter); + SortedFileWriter(const SortedFileWriter&) = delete; + SortedFileWriter& operator=(const SortedFileWriter&) = delete; public: typedef SortIteratorInterface<Key, Value> Iterator; diff --git a/src/mongo/db/stats/server_read_concern_metrics.h b/src/mongo/db/stats/server_read_concern_metrics.h index c1fb8626d95..1a247f79df6 100644 --- a/src/mongo/db/stats/server_read_concern_metrics.h +++ b/src/mongo/db/stats/server_read_concern_metrics.h @@ -40,7 +40,8 @@ namespace mongo { * Container for server-wide statistics on readConcern levels used by operations. */ class ServerReadConcernMetrics { - MONGO_DISALLOW_COPYING(ServerReadConcernMetrics); + ServerReadConcernMetrics(const ServerReadConcernMetrics&) = delete; + ServerReadConcernMetrics& operator=(const ServerReadConcernMetrics&) = delete; public: ServerReadConcernMetrics() = default; diff --git a/src/mongo/db/stats/server_write_concern_metrics.h b/src/mongo/db/stats/server_write_concern_metrics.h index 2a0c67f911c..e6faaaf1641 100644 --- a/src/mongo/db/stats/server_write_concern_metrics.h +++ b/src/mongo/db/stats/server_write_concern_metrics.h @@ -39,7 +39,8 @@ namespace mongo { * Container for server-wide statistics on writeConcern levels used by operations. */ class ServerWriteConcernMetrics { - MONGO_DISALLOW_COPYING(ServerWriteConcernMetrics); + ServerWriteConcernMetrics(const ServerWriteConcernMetrics&) = delete; + ServerWriteConcernMetrics& operator=(const ServerWriteConcernMetrics&) = delete; public: ServerWriteConcernMetrics() = default; diff --git a/src/mongo/db/storage/biggie/biggie_kv_engine.cpp b/src/mongo/db/storage/biggie/biggie_kv_engine.cpp index ad51f1ca25a..1ece635c229 100644 --- a/src/mongo/db/storage/biggie/biggie_kv_engine.cpp +++ b/src/mongo/db/storage/biggie/biggie_kv_engine.cpp @@ -31,7 +31,6 @@ #include "mongo/platform/basic.h" -#include "mongo/base/disallow_copying.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/snapshot_window_options.h" #include "mongo/db/storage/biggie/biggie_kv_engine.h" diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp index a8f0fac6489..6ae745c5587 100644 --- a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp +++ b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp @@ -31,7 +31,6 @@ #include "mongo/db/storage/devnull/devnull_kv_engine.h" -#include "mongo/base/disallow_copying.h" #include "mongo/db/snapshot_window_options.h" #include "mongo/db/storage/ephemeral_for_test/ephemeral_for_test_record_store.h" #include "mongo/db/storage/record_store.h" @@ -177,7 +176,8 @@ private: }; class DevNullSortedDataBuilderInterface : public SortedDataBuilderInterface { - MONGO_DISALLOW_COPYING(DevNullSortedDataBuilderInterface); + DevNullSortedDataBuilderInterface(const DevNullSortedDataBuilderInterface&) = delete; + DevNullSortedDataBuilderInterface& operator=(const DevNullSortedDataBuilderInterface&) = delete; public: DevNullSortedDataBuilderInterface() {} diff --git a/src/mongo/db/storage/encryption_hooks.h b/src/mongo/db/storage/encryption_hooks.h index 68760531dea..f5a5db60923 100644 --- a/src/mongo/db/storage/encryption_hooks.h +++ b/src/mongo/db/storage/encryption_hooks.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/jsobj.h" namespace boost { diff --git a/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper.h b/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper.h index dfd048ca67d..c249d9af0ba 100644 --- a/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper.h +++ b/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper.h @@ -34,7 +34,6 @@ #include <set> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/timestamp.h" #include "mongo/db/namespace_string.h" @@ -58,7 +57,8 @@ namespace mongo { * dropldentsOlderThan() is provided for this purpose. */ class KVDropPendingIdentReaper { - MONGO_DISALLOW_COPYING(KVDropPendingIdentReaper); + KVDropPendingIdentReaper(const KVDropPendingIdentReaper&) = delete; + KVDropPendingIdentReaper& operator=(const KVDropPendingIdentReaper&) = delete; public: explicit KVDropPendingIdentReaper(KVEngine* engine); diff --git a/src/mongo/db/storage/mobile/mobile_session.h b/src/mongo/db/storage/mobile/mobile_session.h index f4126fe605a..6e48caed880 100644 --- a/src/mongo/db/storage/mobile/mobile_session.h +++ b/src/mongo/db/storage/mobile/mobile_session.h @@ -32,7 +32,6 @@ #include <sqlite3.h> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/db/storage/mobile/mobile_session_pool.h" namespace mongo { @@ -42,7 +41,8 @@ class MobileSessionPool; * This class manages a SQLite database connection object. */ class MobileSession final { - MONGO_DISALLOW_COPYING(MobileSession); + MobileSession(const MobileSession&) = delete; + MobileSession& operator=(const MobileSession&) = delete; public: MobileSession(sqlite3* session, MobileSessionPool* sessionPool); diff --git a/src/mongo/db/storage/mobile/mobile_session_pool.h b/src/mongo/db/storage/mobile/mobile_session_pool.h index 8db3d92ee92..90535091fd8 100644 --- a/src/mongo/db/storage/mobile/mobile_session_pool.h +++ b/src/mongo/db/storage/mobile/mobile_session_pool.h @@ -34,7 +34,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/operation_context.h" #include "mongo/db/storage/mobile/mobile_session.h" #include "mongo/stdx/mutex.h" @@ -46,7 +45,8 @@ class MobileSession; * This class manages a queue of operations delayed for some reason */ class MobileDelayedOpQueue final { - MONGO_DISALLOW_COPYING(MobileDelayedOpQueue); + MobileDelayedOpQueue(const MobileDelayedOpQueue&) = delete; + MobileDelayedOpQueue& operator=(const MobileDelayedOpQueue&) = delete; public: MobileDelayedOpQueue(); @@ -65,7 +65,8 @@ private: * This class manages a pool of open sqlite3* objects. */ class MobileSessionPool final { - MONGO_DISALLOW_COPYING(MobileSessionPool); + MobileSessionPool(const MobileSessionPool&) = delete; + MobileSessionPool& operator=(const MobileSessionPool&) = delete; public: MobileSessionPool(const std::string& path, std::uint64_t maxPoolSize = 80); diff --git a/src/mongo/db/storage/record_store.h b/src/mongo/db/storage/record_store.h index af9faa245d8..5389e8f6439 100644 --- a/src/mongo/db/storage/record_store.h +++ b/src/mongo/db/storage/record_store.h @@ -239,7 +239,8 @@ public: * for MMAPv1 is this class not thread-safe. */ class RecordStore { - MONGO_DISALLOW_COPYING(RecordStore); + RecordStore(const RecordStore&) = delete; + RecordStore& operator=(const RecordStore&) = delete; public: RecordStore(StringData ns) : _ns(ns.toString()) {} diff --git a/src/mongo/db/storage/recovery_unit.h b/src/mongo/db/storage/recovery_unit.h index ce62e0ba29a..6403135fa12 100644 --- a/src/mongo/db/storage/recovery_unit.h +++ b/src/mongo/db/storage/recovery_unit.h @@ -33,7 +33,6 @@ #include <stdlib.h> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/bson/timestamp.h" #include "mongo/db/repl/read_concern_level.h" @@ -50,7 +49,8 @@ class OperationContext; * and an operator to add the statistics values. */ class StorageStats { - MONGO_DISALLOW_COPYING(StorageStats); + StorageStats(const StorageStats&) = delete; + StorageStats& operator=(const StorageStats&) = delete; public: StorageStats() = default; @@ -80,7 +80,8 @@ public: * All on-disk information must be mutated through this interface. */ class RecoveryUnit { - MONGO_DISALLOW_COPYING(RecoveryUnit); + RecoveryUnit(const RecoveryUnit&) = delete; + RecoveryUnit& operator=(const RecoveryUnit&) = delete; public: virtual ~RecoveryUnit() {} diff --git a/src/mongo/db/storage/remove_saver.h b/src/mongo/db/storage/remove_saver.h index d64604ad7a8..0704ddb4d49 100644 --- a/src/mongo/db/storage/remove_saver.h +++ b/src/mongo/db/storage/remove_saver.h @@ -34,7 +34,6 @@ #include <ostream> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/jsobj.h" #include "mongo/db/storage/data_protector.h" @@ -48,7 +47,8 @@ namespace mongo { * deletion, otherwise the document will be lost if the process gets terminated in between. */ class RemoveSaver { - MONGO_DISALLOW_COPYING(RemoveSaver); + RemoveSaver(const RemoveSaver&) = delete; + RemoveSaver& operator=(const RemoveSaver&) = delete; public: RemoveSaver(const std::string& type, const std::string& ns, const std::string& why); diff --git a/src/mongo/db/storage/storage_engine_lock_file.h b/src/mongo/db/storage/storage_engine_lock_file.h index 983b3fa6ab8..14a576aab01 100644 --- a/src/mongo/db/storage/storage_engine_lock_file.h +++ b/src/mongo/db/storage/storage_engine_lock_file.h @@ -33,7 +33,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/service_context.h" @@ -42,7 +41,8 @@ namespace mongo { constexpr StringData kLockFileBasename = "mongod.lock"_sd; class StorageEngineLockFile { - MONGO_DISALLOW_COPYING(StorageEngineLockFile); + StorageEngineLockFile(const StorageEngineLockFile&) = delete; + StorageEngineLockFile& operator=(const StorageEngineLockFile&) = delete; public: static boost::optional<StorageEngineLockFile>& get(ServiceContext* service); diff --git a/src/mongo/db/storage/storage_engine_metadata.h b/src/mongo/db/storage/storage_engine_metadata.h index 188d9365107..e38a6df46ab 100644 --- a/src/mongo/db/storage/storage_engine_metadata.h +++ b/src/mongo/db/storage/storage_engine_metadata.h @@ -34,7 +34,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/db/jsobj.h" @@ -47,7 +46,8 @@ namespace mongo { * Fields other than 'storage.engine' are ignored. */ class StorageEngineMetadata { - MONGO_DISALLOW_COPYING(StorageEngineMetadata); + StorageEngineMetadata(const StorageEngineMetadata&) = delete; + StorageEngineMetadata& operator=(const StorageEngineMetadata&) = delete; public: /** diff --git a/src/mongo/db/storage/storage_repair_observer.h b/src/mongo/db/storage/storage_repair_observer.h index bbb0852747f..6f5a89c4751 100644 --- a/src/mongo/db/storage/storage_repair_observer.h +++ b/src/mongo/db/storage/storage_repair_observer.h @@ -33,7 +33,6 @@ #include <boost/filesystem.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/db/service_context.h" namespace mongo { @@ -45,7 +44,8 @@ namespace mongo { * */ class StorageRepairObserver { public: - MONGO_DISALLOW_COPYING(StorageRepairObserver); + StorageRepairObserver(const StorageRepairObserver&) = delete; + StorageRepairObserver& operator=(const StorageRepairObserver&) = delete; explicit StorageRepairObserver(const std::string& dbpath); ~StorageRepairObserver() = default; diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h index e7066b09965..f71ba7e5214 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/storage/wiredtiger/wiredtiger_record_store.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" @@ -45,7 +44,8 @@ class WiredTigerSessionCache; // Manages oplog visibility, by periodically querying WiredTiger's all_committed timestamp value and // then using that timestamp for all transactions that read the oplog collection. class WiredTigerOplogManager { - MONGO_DISALLOW_COPYING(WiredTigerOplogManager); + WiredTigerOplogManager(const WiredTigerOplogManager&) = delete; + WiredTigerOplogManager& operator=(const WiredTigerOplogManager&) = delete; public: WiredTigerOplogManager() {} diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_snapshot_manager.h b/src/mongo/db/storage/wiredtiger/wiredtiger_snapshot_manager.h index 046256cff1f..9ff2b87497f 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_snapshot_manager.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_snapshot_manager.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <wiredtiger.h> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/timestamp.h" #include "mongo/db/storage/snapshot_manager.h" #include "mongo/db/storage/wiredtiger/wiredtiger_begin_transaction_block.h" @@ -43,7 +42,8 @@ namespace mongo { class WiredTigerOplogManager; class WiredTigerSnapshotManager final : public SnapshotManager { - MONGO_DISALLOW_COPYING(WiredTigerSnapshotManager); + WiredTigerSnapshotManager(const WiredTigerSnapshotManager&) = delete; + WiredTigerSnapshotManager& operator=(const WiredTigerSnapshotManager&) = delete; public: WiredTigerSnapshotManager() = default; diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_util.h b/src/mongo/db/storage/wiredtiger/wiredtiger_util.h index 3a7fb134b50..23015814cf7 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.h @@ -32,7 +32,6 @@ #include <limits> #include <wiredtiger.h> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" @@ -123,7 +122,8 @@ private: }; class WiredTigerUtil { - MONGO_DISALLOW_COPYING(WiredTigerUtil); + WiredTigerUtil(const WiredTigerUtil&) = delete; + WiredTigerUtil& operator=(const WiredTigerUtil&) = delete; private: WiredTigerUtil(); @@ -287,7 +287,8 @@ private: }; class WiredTigerConfigParser { - MONGO_DISALLOW_COPYING(WiredTigerConfigParser); + WiredTigerConfigParser(const WiredTigerConfigParser&) = delete; + WiredTigerConfigParser& operator=(const WiredTigerConfigParser&) = delete; public: WiredTigerConfigParser(StringData config) { diff --git a/src/mongo/db/storage/write_unit_of_work.h b/src/mongo/db/storage/write_unit_of_work.h index 3830aa37286..297d1f65f6e 100644 --- a/src/mongo/db/storage/write_unit_of_work.h +++ b/src/mongo/db/storage/write_unit_of_work.h @@ -31,7 +31,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" namespace mongo { @@ -48,7 +47,8 @@ class OperationContext; * also abort. */ class WriteUnitOfWork { - MONGO_DISALLOW_COPYING(WriteUnitOfWork); + WriteUnitOfWork(const WriteUnitOfWork&) = delete; + WriteUnitOfWork& operator=(const WriteUnitOfWork&) = delete; public: /** diff --git a/src/mongo/db/transaction_participant.h b/src/mongo/db/transaction_participant.h index 974e0e2fa6b..b4d07a1a23e 100644 --- a/src/mongo/db/transaction_participant.h +++ b/src/mongo/db/transaction_participant.h @@ -33,7 +33,6 @@ #include <iostream> #include <map> -#include "mongo/base/disallow_copying.h" #include "mongo/db/commands/txn_cmds_gen.h" #include "mongo/db/concurrency/locker.h" #include "mongo/db/logical_session_id.h" @@ -91,7 +90,8 @@ enum class TerminationCause { * the comments below for more information. */ class TransactionParticipant { - MONGO_DISALLOW_COPYING(TransactionParticipant); + TransactionParticipant(const TransactionParticipant&) = delete; + TransactionParticipant& operator=(const TransactionParticipant&) = delete; struct PrivateState; struct ObservableState; diff --git a/src/mongo/db/views/view_catalog.h b/src/mongo/db/views/view_catalog.h index b2d13f97a26..08ed7c72422 100644 --- a/src/mongo/db/views/view_catalog.h +++ b/src/mongo/db/views/view_catalog.h @@ -60,7 +60,8 @@ class Database; * views catalog collection if necessary, throwing if the refresh fails. */ class ViewCatalog { - MONGO_DISALLOW_COPYING(ViewCatalog); + ViewCatalog(const ViewCatalog&) = delete; + ViewCatalog& operator=(const ViewCatalog&) = delete; public: using ViewMap = StringMap<std::shared_ptr<ViewDefinition>>; diff --git a/src/mongo/db/views/view_graph.h b/src/mongo/db/views/view_graph.h index 1315a928794..cddc0d20c50 100644 --- a/src/mongo/db/views/view_graph.h +++ b/src/mongo/db/views/view_graph.h @@ -50,7 +50,8 @@ class ViewDefinition; * This is owned and managed by the ViewCatalog. */ class ViewGraph { - MONGO_DISALLOW_COPYING(ViewGraph); + ViewGraph(const ViewGraph&) = delete; + ViewGraph& operator=(const ViewGraph&) = delete; public: static const int kMaxViewDepth; diff --git a/src/mongo/db/wire_version.h b/src/mongo/db/wire_version.h index ec55f9478aa..8ecb08fd7dd 100644 --- a/src/mongo/db/wire_version.h +++ b/src/mongo/db/wire_version.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonobjbuilder.h" namespace mongo { @@ -91,7 +90,8 @@ struct WireVersionInfo { }; struct WireSpec { - MONGO_DISALLOW_COPYING(WireSpec); + WireSpec(const WireSpec&) = delete; + WireSpec& operator=(const WireSpec&) = delete; static WireSpec& instance(); diff --git a/src/mongo/dbtests/dbtests.h b/src/mongo/dbtests/dbtests.h index d86948dbd24..e64772a11b7 100644 --- a/src/mongo/dbtests/dbtests.h +++ b/src/mongo/dbtests/dbtests.h @@ -69,7 +69,8 @@ Status createIndexFromSpec(OperationContext* opCtx, StringData ns, const BSONObj * the collection). */ class WriteContextForTests { - MONGO_DISALLOW_COPYING(WriteContextForTests); + WriteContextForTests(const WriteContextForTests&) = delete; + WriteContextForTests& operator=(const WriteContextForTests&) = delete; public: WriteContextForTests(OperationContext* opCtx, StringData ns); diff --git a/src/mongo/embedded/index_builds_coordinator_embedded.h b/src/mongo/embedded/index_builds_coordinator_embedded.h index c1085f543aa..96de739be87 100644 --- a/src/mongo/embedded/index_builds_coordinator_embedded.h +++ b/src/mongo/embedded/index_builds_coordinator_embedded.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/index_builds_coordinator.h" namespace mongo { @@ -46,7 +45,8 @@ class ServiceContext; * accessible via the ServiceContext. */ class IndexBuildsCoordinatorEmbedded : public IndexBuildsCoordinator { - MONGO_DISALLOW_COPYING(IndexBuildsCoordinatorEmbedded); + IndexBuildsCoordinatorEmbedded(const IndexBuildsCoordinatorEmbedded&) = delete; + IndexBuildsCoordinatorEmbedded& operator=(const IndexBuildsCoordinatorEmbedded&) = delete; public: IndexBuildsCoordinatorEmbedded() = default; diff --git a/src/mongo/embedded/periodic_runner_embedded.h b/src/mongo/embedded/periodic_runner_embedded.h index 7458936414d..eca049659f6 100644 --- a/src/mongo/embedded/periodic_runner_embedded.h +++ b/src/mongo/embedded/periodic_runner_embedded.h @@ -62,7 +62,8 @@ public: private: class PeriodicJobImpl { - MONGO_DISALLOW_COPYING(PeriodicJobImpl); + PeriodicJobImpl(const PeriodicJobImpl&) = delete; + PeriodicJobImpl& operator=(const PeriodicJobImpl&) = delete; public: friend class PeriodicRunnerEmbedded; diff --git a/src/mongo/embedded/service_entry_point_embedded.h b/src/mongo/embedded/service_entry_point_embedded.h index a4ccd94113c..0a47fd6bd56 100644 --- a/src/mongo/embedded/service_entry_point_embedded.h +++ b/src/mongo/embedded/service_entry_point_embedded.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/transport/service_entry_point.h" namespace mongo { @@ -38,7 +37,8 @@ namespace mongo { * The entry point into mongod. Just a wrapper around assembleResponse. */ class ServiceEntryPointEmbedded final : public ServiceEntryPoint { - MONGO_DISALLOW_COPYING(ServiceEntryPointEmbedded); + ServiceEntryPointEmbedded(const ServiceEntryPointEmbedded&) = delete; + ServiceEntryPointEmbedded& operator=(const ServiceEntryPointEmbedded&) = delete; public: ServiceEntryPointEmbedded() = default; diff --git a/src/mongo/executor/async_timer_interface.h b/src/mongo/executor/async_timer_interface.h index 76707b65892..d57cac90bf0 100644 --- a/src/mongo/executor/async_timer_interface.h +++ b/src/mongo/executor/async_timer_interface.h @@ -31,7 +31,6 @@ #include <system_error> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/functional.h" #include "mongo/util/time_support.h" @@ -42,7 +41,8 @@ namespace executor { * An asynchronous waitable timer interface. */ class AsyncTimerInterface { - MONGO_DISALLOW_COPYING(AsyncTimerInterface); + AsyncTimerInterface(const AsyncTimerInterface&) = delete; + AsyncTimerInterface& operator=(const AsyncTimerInterface&) = delete; public: virtual ~AsyncTimerInterface() = default; @@ -81,7 +81,8 @@ protected: * A factory for AsyncTimers. */ class AsyncTimerFactoryInterface { - MONGO_DISALLOW_COPYING(AsyncTimerFactoryInterface); + AsyncTimerFactoryInterface(const AsyncTimerFactoryInterface&) = delete; + AsyncTimerFactoryInterface& operator=(const AsyncTimerFactoryInterface&) = delete; public: virtual ~AsyncTimerFactoryInterface() = default; diff --git a/src/mongo/executor/connection_pool.h b/src/mongo/executor/connection_pool.h index f5245b80e56..5903d1b0bda 100644 --- a/src/mongo/executor/connection_pool.h +++ b/src/mongo/executor/connection_pool.h @@ -32,7 +32,6 @@ #include <memory> #include <queue> -#include "mongo/base/disallow_copying.h" #include "mongo/executor/egress_tag_closer.h" #include "mongo/executor/egress_tag_closer_manager.h" #include "mongo/stdx/chrono.h" @@ -188,7 +187,8 @@ private: * Minimal interface sets a timer with a callback and cancels the timer. */ class ConnectionPool::TimerInterface { - MONGO_DISALLOW_COPYING(TimerInterface); + TimerInterface(const TimerInterface&) = delete; + TimerInterface& operator=(const TimerInterface&) = delete; public: TimerInterface() = default; @@ -222,7 +222,8 @@ public: * refresh them (issue some kind of ping) and manage a timer. */ class ConnectionPool::ConnectionInterface : public TimerInterface { - MONGO_DISALLOW_COPYING(ConnectionInterface); + ConnectionInterface(const ConnectionInterface&) = delete; + ConnectionInterface& operator=(const ConnectionInterface&) = delete; friend class ConnectionPool; @@ -325,7 +326,8 @@ private: * connection pool. */ class ConnectionPool::DependentTypeFactoryInterface { - MONGO_DISALLOW_COPYING(DependentTypeFactoryInterface); + DependentTypeFactoryInterface(const DependentTypeFactoryInterface&) = delete; + DependentTypeFactoryInterface& operator=(const DependentTypeFactoryInterface&) = delete; public: DependentTypeFactoryInterface() = default; diff --git a/src/mongo/executor/connection_pool_tl.h b/src/mongo/executor/connection_pool_tl.h index d553156a50a..17f000ffaeb 100644 --- a/src/mongo/executor/connection_pool_tl.h +++ b/src/mongo/executor/connection_pool_tl.h @@ -77,7 +77,8 @@ private: class TLTypeFactory::Type : public std::enable_shared_from_this<TLTypeFactory::Type> { friend class TLTypeFactory; - MONGO_DISALLOW_COPYING(Type); + Type(const Type&) = delete; + Type& operator=(const Type&) = delete; public: explicit Type(const std::shared_ptr<TLTypeFactory>& factory); diff --git a/src/mongo/executor/network_interface.h b/src/mongo/executor/network_interface.h index b4bc72d88b2..0cdd2175118 100644 --- a/src/mongo/executor/network_interface.h +++ b/src/mongo/executor/network_interface.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/executor/task_executor.h" #include "mongo/stdx/functional.h" #include "mongo/transport/baton.h" @@ -50,7 +49,8 @@ MONGO_FAIL_POINT_DECLARE(networkInterfaceDiscardCommandsAfterAcquireConn); * Interface to networking for use by TaskExecutor implementations. */ class NetworkInterface { - MONGO_DISALLOW_COPYING(NetworkInterface); + NetworkInterface(const NetworkInterface&) = delete; + NetworkInterface& operator=(const NetworkInterface&) = delete; public: using Response = RemoteCommandResponse; diff --git a/src/mongo/executor/network_interface_mock.h b/src/mongo/executor/network_interface_mock.h index 6b592abfcb4..498f88abae1 100644 --- a/src/mongo/executor/network_interface_mock.h +++ b/src/mongo/executor/network_interface_mock.h @@ -34,7 +34,6 @@ #include <utility> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/executor/network_interface.h" #include "mongo/rpc/metadata/metadata_hook.h" #include "mongo/stdx/condition_variable.h" @@ -521,7 +520,8 @@ private: * Not thread-safe. */ class NetworkInterfaceMock::InNetworkGuard { - MONGO_DISALLOW_COPYING(InNetworkGuard); + InNetworkGuard(const InNetworkGuard&) = delete; + InNetworkGuard& operator=(const InNetworkGuard&) = delete; public: /** diff --git a/src/mongo/executor/task_executor.h b/src/mongo/executor/task_executor.h index 9dbd7356cd3..22082712da1 100644 --- a/src/mongo/executor/task_executor.h +++ b/src/mongo/executor/task_executor.h @@ -33,7 +33,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/base/string_data.h" @@ -73,7 +72,8 @@ struct ConnectionPoolStats; * blocked in waitForEvent() eventually return. */ class TaskExecutor { - MONGO_DISALLOW_COPYING(TaskExecutor); + TaskExecutor(const TaskExecutor&) = delete; + TaskExecutor& operator=(const TaskExecutor&) = delete; public: struct CallbackArgs; @@ -289,7 +289,8 @@ protected: * Class representing a scheduled callback and providing methods for interacting with it. */ class TaskExecutor::CallbackState { - MONGO_DISALLOW_COPYING(CallbackState); + CallbackState(const CallbackState&) = delete; + CallbackState& operator=(const CallbackState&) = delete; public: virtual ~CallbackState(); @@ -358,7 +359,8 @@ private: * Class representing a scheduled event and providing methods for interacting with it. */ class TaskExecutor::EventState { - MONGO_DISALLOW_COPYING(EventState); + EventState(const EventState&) = delete; + EventState& operator=(const EventState&) = delete; public: virtual ~EventState(); diff --git a/src/mongo/executor/task_executor_test_common.cpp b/src/mongo/executor/task_executor_test_common.cpp index f2d8be464cf..9f886247e98 100644 --- a/src/mongo/executor/task_executor_test_common.cpp +++ b/src/mongo/executor/task_executor_test_common.cpp @@ -35,7 +35,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/db/operation_context.h" #include "mongo/executor/network_interface.h" #include "mongo/executor/network_interface_mock.h" @@ -80,7 +79,8 @@ static ExecutorTestCaseMap& executorTestCaseRegistry() { } class CetRegistrationAgent { - MONGO_DISALLOW_COPYING(CetRegistrationAgent); + CetRegistrationAgent(const CetRegistrationAgent&) = delete; + CetRegistrationAgent& operator=(const CetRegistrationAgent&) = delete; public: CetRegistrationAgent(const std::string& name, ExecutorTestCaseFactory makeTest) { @@ -207,7 +207,8 @@ COMMON_EXECUTOR_TEST(OneSchedulesAnother) { } class EventChainAndWaitingTest { - MONGO_DISALLOW_COPYING(EventChainAndWaitingTest); + EventChainAndWaitingTest(const EventChainAndWaitingTest&) = delete; + EventChainAndWaitingTest& operator=(const EventChainAndWaitingTest&) = delete; public: EventChainAndWaitingTest(TaskExecutor* exec, NetworkInterfaceMock* network); diff --git a/src/mongo/executor/thread_pool_task_executor.cpp b/src/mongo/executor/thread_pool_task_executor.cpp index c7d7301ca21..fefecf9a04e 100644 --- a/src/mongo/executor/thread_pool_task_executor.cpp +++ b/src/mongo/executor/thread_pool_task_executor.cpp @@ -38,7 +38,6 @@ #include <utility> #include "mongo/base/checked_cast.h" -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/operation_context.h" #include "mongo/executor/connection_pool_stats.h" @@ -61,7 +60,8 @@ MONGO_FAIL_POINT_DEFINE(scheduleIntoPoolSpinsUntilThreadPoolShutsDown); } class ThreadPoolTaskExecutor::CallbackState : public TaskExecutor::CallbackState { - MONGO_DISALLOW_COPYING(CallbackState); + CallbackState(const CallbackState&) = delete; + CallbackState& operator=(const CallbackState&) = delete; public: static std::shared_ptr<CallbackState> make(CallbackFn&& cb, @@ -106,7 +106,8 @@ public: }; class ThreadPoolTaskExecutor::EventState : public TaskExecutor::EventState { - MONGO_DISALLOW_COPYING(EventState); + EventState(const EventState&) = delete; + EventState& operator=(const EventState&) = delete; public: static std::shared_ptr<EventState> make() { diff --git a/src/mongo/executor/thread_pool_task_executor.h b/src/mongo/executor/thread_pool_task_executor.h index 80b53a3a688..74a0d8bf46d 100644 --- a/src/mongo/executor/thread_pool_task_executor.h +++ b/src/mongo/executor/thread_pool_task_executor.h @@ -31,7 +31,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/executor/task_executor.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/list.h" @@ -55,7 +54,8 @@ class NetworkInterface; * Implementation of a TaskExecutor that uses a pool of threads to execute work items. */ class ThreadPoolTaskExecutor final : public TaskExecutor { - MONGO_DISALLOW_COPYING(ThreadPoolTaskExecutor); + ThreadPoolTaskExecutor(const ThreadPoolTaskExecutor&) = delete; + ThreadPoolTaskExecutor& operator=(const ThreadPoolTaskExecutor&) = delete; public: /** diff --git a/src/mongo/executor/thread_pool_task_executor_test.cpp b/src/mongo/executor/thread_pool_task_executor_test.cpp index e8244e7b5e9..3544f72ffe4 100644 --- a/src/mongo/executor/thread_pool_task_executor_test.cpp +++ b/src/mongo/executor/thread_pool_task_executor_test.cpp @@ -77,7 +77,8 @@ TEST_F(ThreadPoolExecutorTest, TimelyCancelationOfScheduleWorkAt) { bool sharedCallbackStateDestroyed = false; class SharedCallbackState { - MONGO_DISALLOW_COPYING(SharedCallbackState); + SharedCallbackState(const SharedCallbackState&) = delete; + SharedCallbackState& operator=(const SharedCallbackState&) = delete; public: SharedCallbackState() {} diff --git a/src/mongo/idl/idl_parser.h b/src/mongo/idl/idl_parser.h index d13b6b62052..b250c22f551 100644 --- a/src/mongo/idl/idl_parser.h +++ b/src/mongo/idl/idl_parser.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsonelement.h" #include "mongo/bson/bsontypes.h" @@ -51,7 +50,8 @@ namespace mongo { * and provide utility methods like checking a BSON type or set of BSON types. */ class IDLParserErrorContext { - MONGO_DISALLOW_COPYING(IDLParserErrorContext); + IDLParserErrorContext(const IDLParserErrorContext&) = delete; + IDLParserErrorContext& operator=(const IDLParserErrorContext&) = delete; template <typename T> friend void throwComparisonError(IDLParserErrorContext& ctxt, diff --git a/src/mongo/logger/component_message_log_domain.h b/src/mongo/logger/component_message_log_domain.h index 8bfb85c419c..7cd2858090b 100644 --- a/src/mongo/logger/component_message_log_domain.h +++ b/src/mongo/logger/component_message_log_domain.h @@ -39,7 +39,8 @@ namespace logger { * Logging domain for ephemeral messages with minimum severity. */ class ComponentMessageLogDomain : public MessageLogDomain { - MONGO_DISALLOW_COPYING(ComponentMessageLogDomain); + ComponentMessageLogDomain(const ComponentMessageLogDomain&) = delete; + ComponentMessageLogDomain& operator=(const ComponentMessageLogDomain&) = delete; public: ComponentMessageLogDomain(); diff --git a/src/mongo/logger/console_appender.h b/src/mongo/logger/console_appender.h index 358079c81ac..26a75ede2c5 100644 --- a/src/mongo/logger/console_appender.h +++ b/src/mongo/logger/console_appender.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/logger/appender.h" #include "mongo/logger/console.h" @@ -44,7 +43,8 @@ namespace logger { */ template <typename Event, typename ConsoleType = Console> class ConsoleAppender : public Appender<Event> { - MONGO_DISALLOW_COPYING(ConsoleAppender); + ConsoleAppender(const ConsoleAppender&) = delete; + ConsoleAppender& operator=(const ConsoleAppender&) = delete; public: typedef Encoder<Event> EventEncoder; diff --git a/src/mongo/logger/log_component_settings.h b/src/mongo/logger/log_component_settings.h index d945b9e7a71..23440129d54 100644 --- a/src/mongo/logger/log_component_settings.h +++ b/src/mongo/logger/log_component_settings.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/logger/log_component.h" #include "mongo/logger/log_severity.h" #include "mongo/platform/atomic_word.h" @@ -44,7 +43,8 @@ namespace logger { * provide log severities for the other components (up to but not including kNumLogComponents). */ class LogComponentSettings { - MONGO_DISALLOW_COPYING(LogComponentSettings); + LogComponentSettings(const LogComponentSettings&) = delete; + LogComponentSettings& operator=(const LogComponentSettings&) = delete; public: LogComponentSettings(); diff --git a/src/mongo/logger/log_domain.h b/src/mongo/logger/log_domain.h index c4d3bea4ee3..01f0d35a80e 100644 --- a/src/mongo/logger/log_domain.h +++ b/src/mongo/logger/log_domain.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/logger/appender.h" #include "mongo/logger/log_severity.h" @@ -61,7 +60,8 @@ namespace logger { */ template <typename E> class LogDomain { - MONGO_DISALLOW_COPYING(LogDomain); + LogDomain(const LogDomain&) = delete; + LogDomain& operator=(const LogDomain&) = delete; public: typedef E Event; diff --git a/src/mongo/logger/log_manager.h b/src/mongo/logger/log_manager.h index c8bc6b05f53..6cf7565c5c4 100644 --- a/src/mongo/logger/log_manager.h +++ b/src/mongo/logger/log_manager.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/logger/component_message_log_domain.h" #include "mongo/logger/rotatable_file_writer.h" #include "mongo/stdx/unordered_map.h" @@ -45,7 +44,8 @@ namespace logger { * Use this while setting up the logging system, before launching any threads. */ class LogManager { - MONGO_DISALLOW_COPYING(LogManager); + LogManager(const LogManager&) = delete; + LogManager& operator=(const LogManager&) = delete; public: LogManager(); diff --git a/src/mongo/logger/ramlog.h b/src/mongo/logger/ramlog.h index 12365944879..15ad0d8526e 100644 --- a/src/mongo/logger/ramlog.h +++ b/src/mongo/logger/ramlog.h @@ -34,7 +34,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/string_data.h" #include "mongo/logger/appender.h" @@ -57,7 +56,8 @@ namespace mongo { * To read a RamLog, instantiate a RamLog::LineIterator, documented below. */ class RamLog : public logger::Tee { - MONGO_DISALLOW_COPYING(RamLog); + RamLog(const RamLog&) = delete; + RamLog& operator=(const RamLog&) = delete; public: class LineIterator; @@ -134,7 +134,8 @@ private: * and so should not be kept around. */ class RamLog::LineIterator { - MONGO_DISALLOW_COPYING(LineIterator); + LineIterator(const LineIterator&) = delete; + LineIterator& operator=(const LineIterator&) = delete; public: explicit LineIterator(RamLog* ramlog); diff --git a/src/mongo/logger/rotatable_file_appender.h b/src/mongo/logger/rotatable_file_appender.h index 5a6ce672c27..72f5a6fae94 100644 --- a/src/mongo/logger/rotatable_file_appender.h +++ b/src/mongo/logger/rotatable_file_appender.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/logger/appender.h" #include "mongo/logger/encoder.h" @@ -44,7 +43,8 @@ namespace logger { */ template <typename Event> class RotatableFileAppender : public Appender<Event> { - MONGO_DISALLOW_COPYING(RotatableFileAppender); + RotatableFileAppender(const RotatableFileAppender&) = delete; + RotatableFileAppender& operator=(const RotatableFileAppender&) = delete; public: typedef Encoder<Event> EventEncoder; diff --git a/src/mongo/logger/rotatable_file_manager.h b/src/mongo/logger/rotatable_file_manager.h index e8bb178310c..79b5f97a7c1 100644 --- a/src/mongo/logger/rotatable_file_manager.h +++ b/src/mongo/logger/rotatable_file_manager.h @@ -33,7 +33,6 @@ #include <utility> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/logger/rotatable_file_writer.h" @@ -50,7 +49,8 @@ typedef StatusWith<RotatableFileWriter*> StatusWithRotatableFileWriter; * Unlike RotatableFileWriter, this type leaves synchronization to its consumers. */ class RotatableFileManager { - MONGO_DISALLOW_COPYING(RotatableFileManager); + RotatableFileManager(const RotatableFileManager&) = delete; + RotatableFileManager& operator=(const RotatableFileManager&) = delete; public: typedef std::pair<std::string, Status> FileNameStatusPair; diff --git a/src/mongo/logger/rotatable_file_writer.cpp b/src/mongo/logger/rotatable_file_writer.cpp index ef864a3c6b2..de59a408d63 100644 --- a/src/mongo/logger/rotatable_file_writer.cpp +++ b/src/mongo/logger/rotatable_file_writer.cpp @@ -84,7 +84,8 @@ std::wstring utf8ToWide(StringData utf8Str) { * (2) Opening files with non-ASCII characters in their names. */ class Win32FileStreambuf : public std::streambuf { - MONGO_DISALLOW_COPYING(Win32FileStreambuf); + Win32FileStreambuf(const Win32FileStreambuf&) = delete; + Win32FileStreambuf& operator=(const Win32FileStreambuf&) = delete; public: Win32FileStreambuf(); @@ -106,7 +107,8 @@ private: * Minimal implementation of a stream to Win32 files. */ class Win32FileOStream : public std::ostream { - MONGO_DISALLOW_COPYING(Win32FileOStream); + Win32FileOStream(const Win32FileOStream&) = delete; + Win32FileOStream& operator=(const Win32FileOStream&) = delete; public: /** diff --git a/src/mongo/logger/rotatable_file_writer.h b/src/mongo/logger/rotatable_file_writer.h index 2cd159b36d2..83fe4716c9a 100644 --- a/src/mongo/logger/rotatable_file_writer.h +++ b/src/mongo/logger/rotatable_file_writer.h @@ -33,7 +33,6 @@ #include <ostream> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/stdx/mutex.h" @@ -53,14 +52,16 @@ namespace logger { * same value for their fileName. */ class RotatableFileWriter { - MONGO_DISALLOW_COPYING(RotatableFileWriter); + RotatableFileWriter(const RotatableFileWriter&) = delete; + RotatableFileWriter& operator=(const RotatableFileWriter&) = delete; public: /** * Guard class representing synchronous use of an instance of RotatableFileWriter. */ class Use { - MONGO_DISALLOW_COPYING(Use); + Use(const Use&) = delete; + Use& operator=(const Use&) = delete; public: /** diff --git a/src/mongo/logger/syslog_appender.h b/src/mongo/logger/syslog_appender.h index b7a8fc47a4b..61cdc329f60 100644 --- a/src/mongo/logger/syslog_appender.h +++ b/src/mongo/logger/syslog_appender.h @@ -34,7 +34,6 @@ #include <sstream> #include <syslog.h> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/logger/appender.h" #include "mongo/logger/encoder.h" @@ -47,7 +46,8 @@ namespace logger { */ template <typename Event> class SyslogAppender : public Appender<Event> { - MONGO_DISALLOW_COPYING(SyslogAppender); + SyslogAppender(const SyslogAppender&) = delete; + SyslogAppender& operator=(const SyslogAppender&) = delete; public: typedef Encoder<Event> EventEncoder; diff --git a/src/mongo/rpc/metadata/client_metadata.h b/src/mongo/rpc/metadata/client_metadata.h index c0efab46319..eb467caab6a 100644 --- a/src/mongo/rpc/metadata/client_metadata.h +++ b/src/mongo/rpc/metadata/client_metadata.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/base/string_data.h" @@ -84,7 +83,8 @@ constexpr auto kMetadataDocumentName = "client"_sd; * See Driver Specification: "MongoDB Handshake" for more information. */ class ClientMetadata { - MONGO_DISALLOW_COPYING(ClientMetadata); + ClientMetadata(const ClientMetadata&) = delete; + ClientMetadata& operator=(const ClientMetadata&) = delete; public: ClientMetadata(ClientMetadata&&) = default; diff --git a/src/mongo/rpc/metadata/client_metadata_ismaster.h b/src/mongo/rpc/metadata/client_metadata_ismaster.h index 27c81a3a5e5..91214a8ccab 100644 --- a/src/mongo/rpc/metadata/client_metadata_ismaster.h +++ b/src/mongo/rpc/metadata/client_metadata_ismaster.h @@ -33,7 +33,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/rpc/metadata/client_metadata.h" namespace mongo { @@ -45,7 +44,8 @@ class Client; * been received by the specified Client object. */ class ClientMetadataIsMasterState { - MONGO_DISALLOW_COPYING(ClientMetadataIsMasterState); + ClientMetadataIsMasterState(const ClientMetadataIsMasterState&) = delete; + ClientMetadataIsMasterState& operator=(const ClientMetadataIsMasterState&) = delete; public: ClientMetadataIsMasterState() = default; diff --git a/src/mongo/rpc/op_msg.h b/src/mongo/rpc/op_msg.h index 763b674ec50..86bfa8d130e 100644 --- a/src/mongo/rpc/op_msg.h +++ b/src/mongo/rpc/op_msg.h @@ -160,7 +160,8 @@ struct OpMsgRequest : public OpMsg { * sent. */ class OpMsgBuilder { - MONGO_DISALLOW_COPYING(OpMsgBuilder); + OpMsgBuilder(const OpMsgBuilder&) = delete; + OpMsgBuilder& operator=(const OpMsgBuilder&) = delete; public: OpMsgBuilder() { @@ -282,7 +283,8 @@ private: * docSeq.done(); // Or just let it go out of scope. */ class OpMsgBuilder::DocSequenceBuilder { - MONGO_DISALLOW_COPYING(DocSequenceBuilder); + DocSequenceBuilder(const DocSequenceBuilder&) = delete; + DocSequenceBuilder& operator=(const DocSequenceBuilder&) = delete; public: DocSequenceBuilder(DocSequenceBuilder&& other) diff --git a/src/mongo/rpc/reply_builder_interface.h b/src/mongo/rpc/reply_builder_interface.h index 8cc520cb24d..d7eb747fa30 100644 --- a/src/mongo/rpc/reply_builder_interface.h +++ b/src/mongo/rpc/reply_builder_interface.h @@ -31,7 +31,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/bson/util/builder.h" #include "mongo/rpc/op_msg.h" @@ -48,7 +47,8 @@ namespace rpc { * Constructs an RPC Reply. */ class ReplyBuilderInterface { - MONGO_DISALLOW_COPYING(ReplyBuilderInterface); + ReplyBuilderInterface(const ReplyBuilderInterface&) = delete; + ReplyBuilderInterface& operator=(const ReplyBuilderInterface&) = delete; public: virtual ~ReplyBuilderInterface() = default; diff --git a/src/mongo/rpc/reply_interface.h b/src/mongo/rpc/reply_interface.h index d4d7c650756..13380051d9b 100644 --- a/src/mongo/rpc/reply_interface.h +++ b/src/mongo/rpc/reply_interface.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/rpc/protocol.h" namespace mongo { @@ -42,7 +41,8 @@ namespace rpc { * An immutable view of an RPC Reply. */ class ReplyInterface { - MONGO_DISALLOW_COPYING(ReplyInterface); + ReplyInterface(const ReplyInterface&) = delete; + ReplyInterface& operator=(const ReplyInterface&) = delete; public: virtual ~ReplyInterface() = default; diff --git a/src/mongo/rpc/unique_message.h b/src/mongo/rpc/unique_message.h index e9245e1dc84..8cc59bddae2 100644 --- a/src/mongo/rpc/unique_message.h +++ b/src/mongo/rpc/unique_message.h @@ -32,7 +32,6 @@ #include <memory> #include <utility> -#include "mongo/base/disallow_copying.h" #include "mongo/rpc/message.h" #include "mongo/rpc/reply_interface.h" @@ -44,7 +43,8 @@ namespace rpc { */ template <typename MessageViewType> class UniqueMessage { - MONGO_DISALLOW_COPYING(UniqueMessage); + UniqueMessage(const UniqueMessage&) = delete; + UniqueMessage& operator=(const UniqueMessage&) = delete; public: UniqueMessage(Message message, std::unique_ptr<MessageViewType> view) diff --git a/src/mongo/s/async_requests_sender.h b/src/mongo/s/async_requests_sender.h index 81c13cf2135..bfd06834972 100644 --- a/src/mongo/s/async_requests_sender.h +++ b/src/mongo/s/async_requests_sender.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" #include "mongo/client/read_preference.h" @@ -81,7 +80,8 @@ namespace mongo { * Does not throw exceptions. */ class AsyncRequestsSender { - MONGO_DISALLOW_COPYING(AsyncRequestsSender); + AsyncRequestsSender(const AsyncRequestsSender&) = delete; + AsyncRequestsSender& operator=(const AsyncRequestsSender&) = delete; public: /** diff --git a/src/mongo/s/balancer_configuration.h b/src/mongo/s/balancer_configuration.h index f6f81006968..c62d91a380d 100644 --- a/src/mongo/s/balancer_configuration.h +++ b/src/mongo/s/balancer_configuration.h @@ -33,7 +33,6 @@ #include <boost/optional.hpp> #include <cstdint> -#include "mongo/base/disallow_copying.h" #include "mongo/platform/atomic_word.h" #include "mongo/s/request_types/migration_secondary_throttle_options.h" #include "mongo/stdx/mutex.h" @@ -196,7 +195,8 @@ private: * Contains settings, which control the behaviour of the balancer. */ class BalancerConfiguration { - MONGO_DISALLOW_COPYING(BalancerConfiguration); + BalancerConfiguration(const BalancerConfiguration&) = delete; + BalancerConfiguration& operator=(const BalancerConfiguration&) = delete; public: /** diff --git a/src/mongo/s/catalog/dist_lock_catalog.h b/src/mongo/s/catalog/dist_lock_catalog.h index a3d596b26ac..7f774915b66 100644 --- a/src/mongo/s/catalog/dist_lock_catalog.h +++ b/src/mongo/s/catalog/dist_lock_catalog.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/oid.h" #include "mongo/db/write_concern_options.h" @@ -48,7 +47,8 @@ class StatusWith; * Interface for the distributed lock operations. */ class DistLockCatalog { - MONGO_DISALLOW_COPYING(DistLockCatalog); + DistLockCatalog(const DistLockCatalog&) = delete; + DistLockCatalog& operator=(const DistLockCatalog&) = delete; public: static const WriteConcernOptions kLocalWriteConcern; diff --git a/src/mongo/s/catalog/dist_lock_manager.h b/src/mongo/s/catalog/dist_lock_manager.h index 58941efeb1c..97a63a8f096 100644 --- a/src/mongo/s/catalog/dist_lock_manager.h +++ b/src/mongo/s/catalog/dist_lock_manager.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/oid.h" #include "mongo/stdx/chrono.h" @@ -74,7 +73,8 @@ public: * RAII type for distributed lock. Not meant to be shared across multiple threads. */ class ScopedDistLock { - MONGO_DISALLOW_COPYING(ScopedDistLock); + ScopedDistLock(const ScopedDistLock&) = delete; + ScopedDistLock& operator=(const ScopedDistLock&) = delete; public: ScopedDistLock(OperationContext* opCtx, diff --git a/src/mongo/s/catalog/sharding_catalog_client.h b/src/mongo/s/catalog/sharding_catalog_client.h index 84b541198f2..cb16b5d26f9 100644 --- a/src/mongo/s/catalog/sharding_catalog_client.h +++ b/src/mongo/s/catalog/sharding_catalog_client.h @@ -34,7 +34,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/keys_collection_document.h" #include "mongo/db/repl/optime_with.h" #include "mongo/db/write_concern_options.h" @@ -83,7 +82,8 @@ struct ConnectionPoolStats; * move to be run on the config server primary. */ class ShardingCatalogClient { - MONGO_DISALLOW_COPYING(ShardingCatalogClient); + ShardingCatalogClient(const ShardingCatalogClient&) = delete; + ShardingCatalogClient& operator=(const ShardingCatalogClient&) = delete; // Allows ShardingCatalogManager to access _exhaustiveFindOnConfig friend class ShardingCatalogManager; diff --git a/src/mongo/s/catalog_cache.h b/src/mongo/s/catalog_cache.h index b2032e2d44a..e2d67ff68cd 100644 --- a/src/mongo/s/catalog_cache.h +++ b/src/mongo/s/catalog_cache.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/platform/atomic_word.h" #include "mongo/s/catalog/type_database.h" @@ -118,7 +117,8 @@ private: * writes happen through the ShardingCatalogManager and the cache hierarchy needs to be invalidated. */ class CatalogCache { - MONGO_DISALLOW_COPYING(CatalogCache); + CatalogCache(const CatalogCache&) = delete; + CatalogCache& operator=(const CatalogCache&) = delete; public: CatalogCache(CatalogCacheLoader& cacheLoader); diff --git a/src/mongo/s/catalog_cache_loader.h b/src/mongo/s/catalog_cache_loader.h index a0a8857dc68..cb00ae17bac 100644 --- a/src/mongo/s/catalog_cache_loader.h +++ b/src/mongo/s/catalog_cache_loader.h @@ -31,7 +31,6 @@ #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/base/string_data.h" #include "mongo/s/catalog/type_chunk.h" diff --git a/src/mongo/s/chunk_manager.h b/src/mongo/s/chunk_manager.h index 8277adc3bff..8544eccf878 100644 --- a/src/mongo/s/chunk_manager.h +++ b/src/mongo/s/chunk_manager.h @@ -34,7 +34,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/namespace_string.h" #include "mongo/db/query/collation/collator_interface.h" #include "mongo/s/chunk.h" @@ -61,7 +60,8 @@ using ShardVersionMap = std::map<ShardId, ChunkVersion>; * in time. */ class RoutingTableHistory : public std::enable_shared_from_this<RoutingTableHistory> { - MONGO_DISALLOW_COPYING(RoutingTableHistory); + RoutingTableHistory(const RoutingTableHistory&) = delete; + RoutingTableHistory& operator=(const RoutingTableHistory&) = delete; public: /** @@ -204,7 +204,8 @@ private: // This will be renamed to RoutingTableHistory and the original RoutingTableHistory will be // ChunkHistoryMap class ChunkManager : public std::enable_shared_from_this<ChunkManager> { - MONGO_DISALLOW_COPYING(ChunkManager); + ChunkManager(const ChunkManager&) = delete; + ChunkManager& operator=(const ChunkManager&) = delete; public: class ConstChunkIterator { diff --git a/src/mongo/s/chunk_writes_tracker.h b/src/mongo/s/chunk_writes_tracker.h index df847bcfc39..141879375c4 100644 --- a/src/mongo/s/chunk_writes_tracker.h +++ b/src/mongo/s/chunk_writes_tracker.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/platform/atomic_word.h" #include "mongo/stdx/mutex.h" diff --git a/src/mongo/s/client/rs_local_client.h b/src/mongo/s/client/rs_local_client.h index d12b443b868..7bba5c7eaa0 100644 --- a/src/mongo/s/client/rs_local_client.h +++ b/src/mongo/s/client/rs_local_client.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/db/repl/optime.h" #include "mongo/s/client/shard.h" #include "mongo/stdx/mutex.h" @@ -41,7 +40,8 @@ namespace mongo { * in the scenarios where causal consistency is not available yet. */ class RSLocalClient { - MONGO_DISALLOW_COPYING(RSLocalClient); + RSLocalClient(const RSLocalClient&) = delete; + RSLocalClient& operator=(const RSLocalClient&) = delete; public: explicit RSLocalClient() = default; diff --git a/src/mongo/s/client/shard_connection.cpp b/src/mongo/s/client/shard_connection.cpp index 710248cc611..5ac9fe97bd0 100644 --- a/src/mongo/s/client/shard_connection.cpp +++ b/src/mongo/s/client/shard_connection.cpp @@ -85,7 +85,8 @@ private: * to be thread safe. */ class ClientConnections { - MONGO_DISALLOW_COPYING(ClientConnections); + ClientConnections(const ClientConnections&) = delete; + ClientConnections& operator=(const ClientConnections&) = delete; public: struct Status { diff --git a/src/mongo/s/client/shard_factory.h b/src/mongo/s/client/shard_factory.h index f55bc90a751..c830a470fda 100644 --- a/src/mongo/s/client/shard_factory.h +++ b/src/mongo/s/client/shard_factory.h @@ -34,7 +34,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/client/connection_string.h" #include "mongo/client/remote_command_targeter_factory.h" @@ -47,7 +46,8 @@ namespace mongo { * An object factory for creating Shard instances via calling registered builders. */ class ShardFactory { - MONGO_DISALLOW_COPYING(ShardFactory); + ShardFactory(const ShardFactory&) = delete; + ShardFactory& operator=(const ShardFactory&) = delete; public: using BuilderCallable = diff --git a/src/mongo/s/client/shard_local.h b/src/mongo/s/client/shard_local.h index 17b67378658..7a2ed6d1c78 100644 --- a/src/mongo/s/client/shard_local.h +++ b/src/mongo/s/client/shard_local.h @@ -29,14 +29,14 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/s/client/rs_local_client.h" #include "mongo/s/client/shard.h" namespace mongo { class ShardLocal : public Shard { - MONGO_DISALLOW_COPYING(ShardLocal); + ShardLocal(const ShardLocal&) = delete; + ShardLocal& operator=(const ShardLocal&) = delete; public: explicit ShardLocal(const ShardId& id); diff --git a/src/mongo/s/client/shard_registry.h b/src/mongo/s/client/shard_registry.h index df119bfeeb2..87ad1cc0523 100644 --- a/src/mongo/s/client/shard_registry.h +++ b/src/mongo/s/client/shard_registry.h @@ -34,7 +34,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/db/jsobj.h" #include "mongo/executor/task_executor.h" #include "mongo/s/client/shard.h" @@ -138,7 +137,8 @@ private: * errors automatically as well. */ class ShardRegistry { - MONGO_DISALLOW_COPYING(ShardRegistry); + ShardRegistry(const ShardRegistry&) = delete; + ShardRegistry& operator=(const ShardRegistry&) = delete; public: /** diff --git a/src/mongo/s/client/shard_remote.h b/src/mongo/s/client/shard_remote.h index b5d9b4a7c2e..e58ec0a8809 100644 --- a/src/mongo/s/client/shard_remote.h +++ b/src/mongo/s/client/shard_remote.h @@ -33,7 +33,6 @@ #include "mongo/s/client/shard.h" -#include "mongo/base/disallow_copying.h" #include "mongo/executor/task_executor.h" #include "mongo/stdx/mutex.h" @@ -44,7 +43,8 @@ namespace mongo { * the shard (if replica set). */ class ShardRemote : public Shard { - MONGO_DISALLOW_COPYING(ShardRemote); + ShardRemote(const ShardRemote&) = delete; + ShardRemote& operator=(const ShardRemote&) = delete; public: /** diff --git a/src/mongo/s/cluster_identity_loader.h b/src/mongo/s/cluster_identity_loader.h index dbbf086d71e..b5ee563d253 100644 --- a/src/mongo/s/cluster_identity_loader.h +++ b/src/mongo/s/cluster_identity_loader.h @@ -31,7 +31,6 @@ #include <boost/optional.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/bson/oid.h" #include "mongo/db/repl/read_concern_args.h" #include "mongo/stdx/condition_variable.h" @@ -48,7 +47,8 @@ class StatusWith; * Decoration on ServiceContext used by any process in a sharded cluster to access the cluster ID. */ class ClusterIdentityLoader { - MONGO_DISALLOW_COPYING(ClusterIdentityLoader); + ClusterIdentityLoader(const ClusterIdentityLoader&) = delete; + ClusterIdentityLoader& operator=(const ClusterIdentityLoader&) = delete; public: ClusterIdentityLoader() = default; diff --git a/src/mongo/s/commands/cluster_current_op.cpp b/src/mongo/s/commands/cluster_current_op.cpp index 8108201bcb0..2d72bd1f96d 100644 --- a/src/mongo/s/commands/cluster_current_op.cpp +++ b/src/mongo/s/commands/cluster_current_op.cpp @@ -44,7 +44,8 @@ namespace mongo { namespace { class ClusterCurrentOpCommand final : public CurrentOpCommandBase { - MONGO_DISALLOW_COPYING(ClusterCurrentOpCommand); + ClusterCurrentOpCommand(const ClusterCurrentOpCommand&) = delete; + ClusterCurrentOpCommand& operator=(const ClusterCurrentOpCommand&) = delete; public: ClusterCurrentOpCommand() = default; diff --git a/src/mongo/s/commands/cluster_index_filter_cmd.cpp b/src/mongo/s/commands/cluster_index_filter_cmd.cpp index 158ebaa9e91..57de3734343 100644 --- a/src/mongo/s/commands/cluster_index_filter_cmd.cpp +++ b/src/mongo/s/commands/cluster_index_filter_cmd.cpp @@ -43,7 +43,8 @@ namespace { * than forwarding the commands to all shards and combining the results. */ class ClusterIndexFilterCmd : public BasicCommand { - MONGO_DISALLOW_COPYING(ClusterIndexFilterCmd); + ClusterIndexFilterCmd(const ClusterIndexFilterCmd&) = delete; + ClusterIndexFilterCmd& operator=(const ClusterIndexFilterCmd&) = delete; public: /** diff --git a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp index 55f7de06db8..79a77f5b956 100644 --- a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp +++ b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp @@ -50,7 +50,8 @@ using std::vector; * forwarding the commands to all shards and combining the results. */ class ClusterPlanCacheCmd : public BasicCommand { - MONGO_DISALLOW_COPYING(ClusterPlanCacheCmd); + ClusterPlanCacheCmd(const ClusterPlanCacheCmd&) = delete; + ClusterPlanCacheCmd& operator=(const ClusterPlanCacheCmd&) = delete; public: virtual ~ClusterPlanCacheCmd() {} diff --git a/src/mongo/s/query/async_results_merger.h b/src/mongo/s/query/async_results_merger.h index 889a0bb5d7f..92cf05e66f5 100644 --- a/src/mongo/s/query/async_results_merger.h +++ b/src/mongo/s/query/async_results_merger.h @@ -33,7 +33,6 @@ #include <queue> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" #include "mongo/db/cursor_id.h" @@ -73,7 +72,8 @@ class CursorResponse; * Does not throw exceptions. */ class AsyncResultsMerger { - MONGO_DISALLOW_COPYING(AsyncResultsMerger); + AsyncResultsMerger(const AsyncResultsMerger&) = delete; + AsyncResultsMerger& operator=(const AsyncResultsMerger&) = delete; public: // When mongos has to do a merge in order to return results to the client in the correct sort diff --git a/src/mongo/s/query/cluster_client_cursor_impl.h b/src/mongo/s/query/cluster_client_cursor_impl.h index b6374ff4f33..50d36853cf8 100644 --- a/src/mongo/s/query/cluster_client_cursor_impl.h +++ b/src/mongo/s/query/cluster_client_cursor_impl.h @@ -48,7 +48,8 @@ class RouterStageMock; * released. */ class ClusterClientCursorGuard final { - MONGO_DISALLOW_COPYING(ClusterClientCursorGuard); + ClusterClientCursorGuard(const ClusterClientCursorGuard&) = delete; + ClusterClientCursorGuard& operator=(const ClusterClientCursorGuard&) = delete; public: ClusterClientCursorGuard(OperationContext* opCtx, std::unique_ptr<ClusterClientCursor> ccc); @@ -80,7 +81,8 @@ private: }; class ClusterClientCursorImpl final : public ClusterClientCursor { - MONGO_DISALLOW_COPYING(ClusterClientCursorImpl); + ClusterClientCursorImpl(const ClusterClientCursorImpl&) = delete; + ClusterClientCursorImpl& operator=(const ClusterClientCursorImpl&) = delete; public: /** diff --git a/src/mongo/s/query/cluster_client_cursor_mock.h b/src/mongo/s/query/cluster_client_cursor_mock.h index 6dd23c81553..f99d2e77b94 100644 --- a/src/mongo/s/query/cluster_client_cursor_mock.h +++ b/src/mongo/s/query/cluster_client_cursor_mock.h @@ -40,7 +40,8 @@ namespace mongo { class ClusterClientCursorMock final : public ClusterClientCursor { - MONGO_DISALLOW_COPYING(ClusterClientCursorMock); + ClusterClientCursorMock(const ClusterClientCursorMock&) = delete; + ClusterClientCursorMock& operator=(const ClusterClientCursorMock&) = delete; public: ClusterClientCursorMock(boost::optional<LogicalSessionId> lsid, diff --git a/src/mongo/s/query/cluster_cursor_manager.h b/src/mongo/s/query/cluster_cursor_manager.h index fa129d26d02..3d0afe5db94 100644 --- a/src/mongo/s/query/cluster_cursor_manager.h +++ b/src/mongo/s/query/cluster_cursor_manager.h @@ -70,7 +70,8 @@ class StatusWith; * No public methods throw exceptions, and all public methods are thread-safe. */ class ClusterCursorManager { - MONGO_DISALLOW_COPYING(ClusterCursorManager); + ClusterCursorManager(const ClusterCursorManager&) = delete; + ClusterCursorManager& operator=(const ClusterCursorManager&) = delete; public: // @@ -131,7 +132,8 @@ public: * current OperationContext, and return the cursor. */ class PinnedCursor { - MONGO_DISALLOW_COPYING(PinnedCursor); + PinnedCursor(const PinnedCursor&) = delete; + PinnedCursor& operator=(const PinnedCursor&) = delete; public: /** @@ -550,7 +552,8 @@ private: * CursorEntry is a moveable, non-copyable container for a single cursor. */ class CursorEntry { - MONGO_DISALLOW_COPYING(CursorEntry); + CursorEntry(const CursorEntry&) = delete; + CursorEntry& operator=(const CursorEntry&) = delete; public: CursorEntry() = default; @@ -661,7 +664,8 @@ private: * contained cursors share the same 32-bit prefix of their cursor id. */ struct CursorEntryContainer { - MONGO_DISALLOW_COPYING(CursorEntryContainer); + CursorEntryContainer(const CursorEntryContainer&) = delete; + CursorEntryContainer& operator=(const CursorEntryContainer&) = delete; CursorEntryContainer(uint32_t containerPrefix) : containerPrefix(containerPrefix) {} diff --git a/src/mongo/s/query/establish_cursors.h b/src/mongo/s/query/establish_cursors.h index b75a62eba9b..be7eac8d869 100644 --- a/src/mongo/s/query/establish_cursors.h +++ b/src/mongo/s/query/establish_cursors.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" #include "mongo/db/cursor_id.h" diff --git a/src/mongo/s/query/owned_remote_cursor.h b/src/mongo/s/query/owned_remote_cursor.h index 540e2173abc..473196e4de5 100644 --- a/src/mongo/s/query/owned_remote_cursor.h +++ b/src/mongo/s/query/owned_remote_cursor.h @@ -42,7 +42,8 @@ namespace mongo { */ class OwnedRemoteCursor { public: - MONGO_DISALLOW_COPYING(OwnedRemoteCursor); + OwnedRemoteCursor(const OwnedRemoteCursor&) = delete; + OwnedRemoteCursor& operator=(const OwnedRemoteCursor&) = delete; OwnedRemoteCursor(OperationContext* opCtx, RemoteCursor&& cursor, NamespaceString nss) : _opCtx(opCtx), _remoteCursor(std::move(cursor)), _nss(std::move(nss)) {} diff --git a/src/mongo/s/service_entry_point_mongos.h b/src/mongo/s/service_entry_point_mongos.h index a6d8e03963c..085b5991d5c 100644 --- a/src/mongo/s/service_entry_point_mongos.h +++ b/src/mongo/s/service_entry_point_mongos.h @@ -31,7 +31,6 @@ #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/transport/service_entry_point_impl.h" namespace mongo { @@ -40,7 +39,8 @@ namespace mongo { * The entry point from the TransportLayer into Mongos. */ class ServiceEntryPointMongos final : public ServiceEntryPointImpl { - MONGO_DISALLOW_COPYING(ServiceEntryPointMongos); + ServiceEntryPointMongos(const ServiceEntryPointMongos&) = delete; + ServiceEntryPointMongos& operator=(const ServiceEntryPointMongos&) = delete; public: using ServiceEntryPointImpl::ServiceEntryPointImpl; diff --git a/src/mongo/s/session_catalog_router.h b/src/mongo/s/session_catalog_router.h index ca2b662a13a..10ddcc51ede 100644 --- a/src/mongo/s/session_catalog_router.h +++ b/src/mongo/s/session_catalog_router.h @@ -39,7 +39,8 @@ namespace mongo { * at destruction. This can only be used for multi-statement transactions. */ class RouterOperationContextSession { - MONGO_DISALLOW_COPYING(RouterOperationContextSession); + RouterOperationContextSession(const RouterOperationContextSession&) = delete; + RouterOperationContextSession& operator=(const RouterOperationContextSession&) = delete; public: RouterOperationContextSession(OperationContext* opCtx); diff --git a/src/mongo/s/sharding_task_executor.cpp b/src/mongo/s/sharding_task_executor.cpp index 70bba12918f..1f723c2b1d5 100644 --- a/src/mongo/s/sharding_task_executor.cpp +++ b/src/mongo/s/sharding_task_executor.cpp @@ -33,7 +33,6 @@ #include "mongo/s/sharding_task_executor.h" -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/bson/timestamp.h" #include "mongo/db/logical_time.h" diff --git a/src/mongo/s/sharding_task_executor.h b/src/mongo/s/sharding_task_executor.h index 1c4d9ed3104..b9d879070c6 100644 --- a/src/mongo/s/sharding_task_executor.h +++ b/src/mongo/s/sharding_task_executor.h @@ -31,7 +31,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/executor/task_executor.h" #include "mongo/stdx/condition_variable.h" @@ -49,7 +48,8 @@ class ThreadPoolTaskExecutor; * override methods if needed. */ class ShardingTaskExecutor final : public TaskExecutor { - MONGO_DISALLOW_COPYING(ShardingTaskExecutor); + ShardingTaskExecutor(const ShardingTaskExecutor&) = delete; + ShardingTaskExecutor& operator=(const ShardingTaskExecutor&) = delete; public: ShardingTaskExecutor(std::unique_ptr<ThreadPoolTaskExecutor> executor); diff --git a/src/mongo/s/sharding_uptime_reporter.h b/src/mongo/s/sharding_uptime_reporter.h index 98fa36693b2..8cbdcec0c32 100644 --- a/src/mongo/s/sharding_uptime_reporter.h +++ b/src/mongo/s/sharding_uptime_reporter.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/thread.h" #include "mongo/util/timer.h" @@ -46,7 +45,8 @@ class OperationContext; * NOTE: Not thread-safe, so it should not be used from more than one thread at a time. */ class ShardingUptimeReporter { - MONGO_DISALLOW_COPYING(ShardingUptimeReporter); + ShardingUptimeReporter(const ShardingUptimeReporter&) = delete; + ShardingUptimeReporter& operator=(const ShardingUptimeReporter&) = delete; public: ShardingUptimeReporter(); diff --git a/src/mongo/s/transaction_router.h b/src/mongo/s/transaction_router.h index b096971b1e9..5f248029551 100644 --- a/src/mongo/s/transaction_router.h +++ b/src/mongo/s/transaction_router.h @@ -32,7 +32,6 @@ #include <boost/optional.hpp> #include <map> -#include "mongo/base/disallow_copying.h" #include "mongo/db/commands/txn_cmds_gen.h" #include "mongo/db/logical_session_id.h" #include "mongo/db/operation_context.h" diff --git a/src/mongo/s/write_ops/batch_write_op.h b/src/mongo/s/write_ops/batch_write_op.h index a0ce02117dc..894c184aa52 100644 --- a/src/mongo/s/write_ops/batch_write_op.h +++ b/src/mongo/s/write_ops/batch_write_op.h @@ -33,7 +33,6 @@ #include <set> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/owned_pointer_vector.h" #include "mongo/base/status.h" #include "mongo/db/logical_session_id.h" @@ -116,7 +115,8 @@ using TargetedBatchMap = std::map<const ShardEndpoint*, TargetedWriteBatch*, End * */ class BatchWriteOp { - MONGO_DISALLOW_COPYING(BatchWriteOp); + BatchWriteOp(const BatchWriteOp&) = delete; + BatchWriteOp& operator=(const BatchWriteOp&) = delete; public: BatchWriteOp(OperationContext* opCtx, const BatchedCommandRequest& clientRequest); @@ -244,7 +244,8 @@ private: * efficiently be registered for reporting. */ class TargetedWriteBatch { - MONGO_DISALLOW_COPYING(TargetedWriteBatch); + TargetedWriteBatch(const TargetedWriteBatch&) = delete; + TargetedWriteBatch& operator=(const TargetedWriteBatch&) = delete; public: TargetedWriteBatch(const ShardEndpoint& endpoint) : _endpoint(endpoint) {} diff --git a/src/mongo/s/write_ops/batched_command_response.h b/src/mongo/s/write_ops/batched_command_response.h index e1a5b7e5a42..f5022320ab6 100644 --- a/src/mongo/s/write_ops/batched_command_response.h +++ b/src/mongo/s/write_ops/batched_command_response.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/db/jsobj.h" #include "mongo/db/repl/optime.h" @@ -47,7 +46,8 @@ namespace mongo { * the response side. */ class BatchedCommandResponse { - MONGO_DISALLOW_COPYING(BatchedCommandResponse); + BatchedCommandResponse(const BatchedCommandResponse&) = delete; + BatchedCommandResponse& operator=(const BatchedCommandResponse&) = delete; public: // diff --git a/src/mongo/s/write_ops/batched_upsert_detail.h b/src/mongo/s/write_ops/batched_upsert_detail.h index 6226c581b60..c4eb49868f9 100644 --- a/src/mongo/s/write_ops/batched_upsert_detail.h +++ b/src/mongo/s/write_ops/batched_upsert_detail.h @@ -40,7 +40,8 @@ namespace mongo { * of a write command's response (see batched_command_response.h) */ class BatchedUpsertDetail { - MONGO_DISALLOW_COPYING(BatchedUpsertDetail); + BatchedUpsertDetail(const BatchedUpsertDetail&) = delete; + BatchedUpsertDetail& operator=(const BatchedUpsertDetail&) = delete; public: // diff --git a/src/mongo/scripting/bson_template_evaluator.h b/src/mongo/scripting/bson_template_evaluator.h index 9835a7d04b8..6d2f0565790 100644 --- a/src/mongo/scripting/bson_template_evaluator.h +++ b/src/mongo/scripting/bson_template_evaluator.h @@ -74,7 +74,8 @@ namespace mongo { * */ class BsonTemplateEvaluator { - MONGO_DISALLOW_COPYING(BsonTemplateEvaluator); + BsonTemplateEvaluator(const BsonTemplateEvaluator&) = delete; + BsonTemplateEvaluator& operator=(const BsonTemplateEvaluator&) = delete; public: /* Status of template evaluation. Logically the the status are "success", "bad operator" diff --git a/src/mongo/scripting/deadline_monitor.h b/src/mongo/scripting/deadline_monitor.h index 2d33f1740de..03abfcbdac6 100644 --- a/src/mongo/scripting/deadline_monitor.h +++ b/src/mongo/scripting/deadline_monitor.h @@ -30,7 +30,6 @@ #include <cstdint> -#include "mongo/base/disallow_copying.h" #include "mongo/platform/atomic_word.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" @@ -70,7 +69,8 @@ int getScriptingEngineInterruptInterval(); */ template <typename _Task> class DeadlineMonitor { - MONGO_DISALLOW_COPYING(DeadlineMonitor); + DeadlineMonitor(const DeadlineMonitor&) = delete; + DeadlineMonitor& operator=(const DeadlineMonitor&) = delete; public: DeadlineMonitor() { diff --git a/src/mongo/scripting/engine.h b/src/mongo/scripting/engine.h index 9f2dd08e7b4..f5a85d44f3e 100644 --- a/src/mongo/scripting/engine.h +++ b/src/mongo/scripting/engine.h @@ -47,7 +47,8 @@ struct JSFile { }; class Scope { - MONGO_DISALLOW_COPYING(Scope); + Scope(const Scope&) = delete; + Scope& operator=(const Scope&) = delete; public: Scope(); @@ -204,7 +205,8 @@ protected: }; class ScriptEngine : public KillOpListenerInterface { - MONGO_DISALLOW_COPYING(ScriptEngine); + ScriptEngine(const ScriptEngine&) = delete; + ScriptEngine& operator=(const ScriptEngine&) = delete; public: ScriptEngine(); diff --git a/src/mongo/scripting/mozjs/implscope.h b/src/mongo/scripting/mozjs/implscope.h index 36ff29f9678..b0eb7c55c14 100644 --- a/src/mongo/scripting/mozjs/implscope.h +++ b/src/mongo/scripting/mozjs/implscope.h @@ -84,7 +84,8 @@ namespace mozjs { * For more information about overriden fields, see mongo::Scope */ class MozJSImplScope final : public Scope { - MONGO_DISALLOW_COPYING(MozJSImplScope); + MozJSImplScope(const MozJSImplScope&) = delete; + MozJSImplScope& operator=(const MozJSImplScope&) = delete; public: explicit MozJSImplScope(MozJSScriptEngine* engine); diff --git a/src/mongo/scripting/mozjs/proxyscope.h b/src/mongo/scripting/mozjs/proxyscope.h index ddaa9c815ec..9d11a857923 100644 --- a/src/mongo/scripting/mozjs/proxyscope.h +++ b/src/mongo/scripting/mozjs/proxyscope.h @@ -63,7 +63,8 @@ class MozJSImplScope; * */ class MozJSProxyScope final : public Scope { - MONGO_DISALLOW_COPYING(MozJSProxyScope); + MozJSProxyScope(const MozJSProxyScope&) = delete; + MozJSProxyScope& operator=(const MozJSProxyScope&) = delete; /** * The FSM is fairly tight: diff --git a/src/mongo/shell/bench.cpp b/src/mongo/shell/bench.cpp index f6d2169a44d..0770131246f 100644 --- a/src/mongo/shell/bench.cpp +++ b/src/mongo/shell/bench.cpp @@ -75,7 +75,8 @@ const BSONObj readConcernSnapshot = BSON("level" << "snapshot"); class BenchRunWorkerStateGuard { - MONGO_DISALLOW_COPYING(BenchRunWorkerStateGuard); + BenchRunWorkerStateGuard(const BenchRunWorkerStateGuard&) = delete; + BenchRunWorkerStateGuard& operator=(const BenchRunWorkerStateGuard&) = delete; public: explicit BenchRunWorkerStateGuard(BenchRunState& brState) : _brState(brState) { diff --git a/src/mongo/shell/bench.h b/src/mongo/shell/bench.h index 37e0a0b90af..7683ad4b089 100644 --- a/src/mongo/shell/bench.h +++ b/src/mongo/shell/bench.h @@ -146,7 +146,8 @@ struct BenchRunOp { * Configuration object describing a bench run activity. */ class BenchRunConfig { - MONGO_DISALLOW_COPYING(BenchRunConfig); + BenchRunConfig(const BenchRunConfig&) = delete; + BenchRunConfig& operator=(const BenchRunConfig&) = delete; public: /** @@ -314,7 +315,8 @@ private: * In all cases, the counter objects must outlive the trace object. */ class BenchRunEventTrace { - MONGO_DISALLOW_COPYING(BenchRunEventTrace); + BenchRunEventTrace(const BenchRunEventTrace&) = delete; + BenchRunEventTrace& operator=(const BenchRunEventTrace&) = delete; public: explicit BenchRunEventTrace(BenchRunEventCounter* eventCounter) { @@ -381,7 +383,8 @@ struct BenchRunStats { * Logically, the states are "starting up", "running" and "finished." */ class BenchRunState { - MONGO_DISALLOW_COPYING(BenchRunState); + BenchRunState(const BenchRunState&) = delete; + BenchRunState& operator=(const BenchRunState&) = delete; public: enum State { BRS_STARTING_UP, BRS_RUNNING, BRS_FINISHED }; @@ -462,7 +465,8 @@ private: * Represents the behavior of one thread working in a bench run activity. */ class BenchRunWorker { - MONGO_DISALLOW_COPYING(BenchRunWorker); + BenchRunWorker(const BenchRunWorker&) = delete; + BenchRunWorker& operator=(const BenchRunWorker&) = delete; public: /** @@ -526,7 +530,8 @@ private: * Object representing a "bench run" activity. */ class BenchRunner { - MONGO_DISALLOW_COPYING(BenchRunner); + BenchRunner(const BenchRunner&) = delete; + BenchRunner& operator=(const BenchRunner&) = delete; public: /** diff --git a/src/mongo/transport/message_compressor_base.h b/src/mongo/transport/message_compressor_base.h index 910e7e41d3c..1ac7543bac9 100644 --- a/src/mongo/transport/message_compressor_base.h +++ b/src/mongo/transport/message_compressor_base.h @@ -49,7 +49,8 @@ StringData getMessageCompressorName(MessageCompressor id); using MessageCompressorId = std::underlying_type<MessageCompressor>::type; class MessageCompressorBase { - MONGO_DISALLOW_COPYING(MessageCompressorBase); + MessageCompressorBase(const MessageCompressorBase&) = delete; + MessageCompressorBase& operator=(const MessageCompressorBase&) = delete; public: virtual ~MessageCompressorBase() = default; diff --git a/src/mongo/transport/message_compressor_manager.h b/src/mongo/transport/message_compressor_manager.h index f616cee6275..467d942b4c4 100644 --- a/src/mongo/transport/message_compressor_manager.h +++ b/src/mongo/transport/message_compressor_manager.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/transport/message_compressor_base.h" #include "mongo/transport/session.h" @@ -44,7 +43,8 @@ class Message; class MessageCompressorRegistry; class MessageCompressorManager { - MONGO_DISALLOW_COPYING(MessageCompressorManager); + MessageCompressorManager(const MessageCompressorManager&) = delete; + MessageCompressorManager& operator=(const MessageCompressorManager&) = delete; public: /* diff --git a/src/mongo/transport/message_compressor_registry.h b/src/mongo/transport/message_compressor_registry.h index d3413aa207f..160475675ae 100644 --- a/src/mongo/transport/message_compressor_registry.h +++ b/src/mongo/transport/message_compressor_registry.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/transport/message_compressor_base.h" #include "mongo/util/string_map.h" @@ -54,7 +53,8 @@ namespace moe = mongo::optionenvironment; * The MessageCompressorRegistry holds the global registrations of compressors for a process. */ class MessageCompressorRegistry { - MONGO_DISALLOW_COPYING(MessageCompressorRegistry); + MessageCompressorRegistry(const MessageCompressorRegistry&) = delete; + MessageCompressorRegistry& operator=(const MessageCompressorRegistry&) = delete; public: MessageCompressorRegistry() = default; diff --git a/src/mongo/transport/mock_session.h b/src/mongo/transport/mock_session.h index 7448f9d1ddb..f9922a4f7af 100644 --- a/src/mongo/transport/mock_session.h +++ b/src/mongo/transport/mock_session.h @@ -38,7 +38,8 @@ namespace mongo { namespace transport { class MockSession : public Session { - MONGO_DISALLOW_COPYING(MockSession); + MockSession(const MockSession&) = delete; + MockSession& operator=(const MockSession&) = delete; public: static std::shared_ptr<MockSession> create(TransportLayer* tl) { diff --git a/src/mongo/transport/service_entry_point.h b/src/mongo/transport/service_entry_point.h index 63822aa0486..3faa834ea97 100644 --- a/src/mongo/transport/service_entry_point.h +++ b/src/mongo/transport/service_entry_point.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/bson/bsonobjbuilder.h" #include "mongo/db/dbmessage.h" #include "mongo/transport/session.h" @@ -44,7 +43,8 @@ namespace mongo { * reply-with-Message loop. It may not do this on the TransportLayer’s thread. */ class ServiceEntryPoint { - MONGO_DISALLOW_COPYING(ServiceEntryPoint); + ServiceEntryPoint(const ServiceEntryPoint&) = delete; + ServiceEntryPoint& operator=(const ServiceEntryPoint&) = delete; public: virtual ~ServiceEntryPoint() = default; diff --git a/src/mongo/transport/service_entry_point_impl.h b/src/mongo/transport/service_entry_point_impl.h index 1a9cbd5f762..87a8d815c91 100644 --- a/src/mongo/transport/service_entry_point_impl.h +++ b/src/mongo/transport/service_entry_point_impl.h @@ -30,7 +30,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/platform/atomic_word.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/list.h" @@ -56,7 +55,8 @@ class Session; * (transport::Session). */ class ServiceEntryPointImpl : public ServiceEntryPoint { - MONGO_DISALLOW_COPYING(ServiceEntryPointImpl); + ServiceEntryPointImpl(const ServiceEntryPointImpl&) = delete; + ServiceEntryPointImpl& operator=(const ServiceEntryPointImpl&) = delete; public: explicit ServiceEntryPointImpl(ServiceContext* svcCtx); diff --git a/src/mongo/transport/session.h b/src/mongo/transport/session.h index 58bb90bf18c..b2a9b2ba1a6 100644 --- a/src/mongo/transport/session.h +++ b/src/mongo/transport/session.h @@ -31,7 +31,6 @@ #include <memory> -#include "mongo/base/disallow_copying.h" #include "mongo/db/baton.h" #include "mongo/platform/atomic_word.h" #include "mongo/rpc/message.h" @@ -55,7 +54,8 @@ using ConstSessionHandle = std::shared_ptr<const Session>; * (on the transport side) and Messages with Client objects (on the database side). */ class Session : public std::enable_shared_from_this<Session>, public Decorable<Session> { - MONGO_DISALLOW_COPYING(Session); + Session(const Session&) = delete; + Session& operator=(const Session&) = delete; public: /** diff --git a/src/mongo/transport/session_asio.h b/src/mongo/transport/session_asio.h index b766b33a9e6..f2113dc29e5 100644 --- a/src/mongo/transport/session_asio.h +++ b/src/mongo/transport/session_asio.h @@ -74,7 +74,8 @@ Future<void> futurize(const std::error_code& ec) { using GenericSocket = asio::generic::stream_protocol::socket; class TransportLayerASIO::ASIOSession final : public Session { - MONGO_DISALLOW_COPYING(ASIOSession); + ASIOSession(const ASIOSession&) = delete; + ASIOSession& operator=(const ASIOSession&) = delete; public: // If the socket is disconnected while any of these options are being set, this constructor diff --git a/src/mongo/transport/transport_layer.h b/src/mongo/transport/transport_layer.h index 8e98aa15caa..6d6027e7d83 100644 --- a/src/mongo/transport/transport_layer.h +++ b/src/mongo/transport/transport_layer.h @@ -65,7 +65,8 @@ using ReactorHandle = std::shared_ptr<Reactor>; * References to the TransportLayer should be stored on service context objects. */ class TransportLayer { - MONGO_DISALLOW_COPYING(TransportLayer); + TransportLayer(const TransportLayer&) = delete; + TransportLayer& operator=(const TransportLayer&) = delete; public: static const Status SessionUnknownStatus; diff --git a/src/mongo/transport/transport_layer_asio.h b/src/mongo/transport/transport_layer_asio.h index 31a0be0d6b9..e37f72c40aa 100644 --- a/src/mongo/transport/transport_layer_asio.h +++ b/src/mongo/transport/transport_layer_asio.h @@ -79,7 +79,8 @@ MONGO_FAIL_POINT_DECLARE(transportLayerASIOasyncConnectTimesOut); * A TransportLayer implementation based on ASIO networking primitives. */ class TransportLayerASIO final : public TransportLayer { - MONGO_DISALLOW_COPYING(TransportLayerASIO); + TransportLayerASIO(const TransportLayerASIO&) = delete; + TransportLayerASIO& operator=(const TransportLayerASIO&) = delete; public: struct Options { diff --git a/src/mongo/transport/transport_layer_manager.h b/src/mongo/transport/transport_layer_manager.h index e6159d730c4..1dd5ef38527 100644 --- a/src/mongo/transport/transport_layer_manager.h +++ b/src/mongo/transport/transport_layer_manager.h @@ -50,7 +50,8 @@ namespace transport { * underneath. */ class TransportLayerManager final : public TransportLayer { - MONGO_DISALLOW_COPYING(TransportLayerManager); + TransportLayerManager(const TransportLayerManager&) = delete; + TransportLayerManager& operator=(const TransportLayerManager&) = delete; public: TransportLayerManager(std::vector<std::unique_ptr<TransportLayer>> tls) diff --git a/src/mongo/transport/transport_layer_mock.h b/src/mongo/transport/transport_layer_mock.h index a2ade4a1a6f..eb095b1e65e 100644 --- a/src/mongo/transport/transport_layer_mock.h +++ b/src/mongo/transport/transport_layer_mock.h @@ -43,7 +43,8 @@ namespace transport { * This TransportLayerMock is a noop TransportLayer implementation. */ class TransportLayerMock : public TransportLayer { - MONGO_DISALLOW_COPYING(TransportLayerMock); + TransportLayerMock(const TransportLayerMock&) = delete; + TransportLayerMock& operator=(const TransportLayerMock&) = delete; public: TransportLayerMock(); diff --git a/src/mongo/unittest/barrier.h b/src/mongo/unittest/barrier.h index 4003df90d9b..6b3d102fc6f 100644 --- a/src/mongo/unittest/barrier.h +++ b/src/mongo/unittest/barrier.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" @@ -42,7 +41,8 @@ namespace unittest { * All threads are unblocked when the counter reaches zero and the counter is reset. */ class Barrier { - MONGO_DISALLOW_COPYING(Barrier); + Barrier(const Barrier&) = delete; + Barrier& operator=(const Barrier&) = delete; public: /** diff --git a/src/mongo/unittest/death_test.h b/src/mongo/unittest/death_test.h index 7cbcdb1f768..c6bdb1a937a 100644 --- a/src/mongo/unittest/death_test.h +++ b/src/mongo/unittest/death_test.h @@ -32,7 +32,6 @@ #include <memory> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/memory.h" #include "mongo/unittest/unittest.h" @@ -90,7 +89,8 @@ namespace mongo { namespace unittest { class DeathTestImpl : public Test { - MONGO_DISALLOW_COPYING(DeathTestImpl); + DeathTestImpl(const DeathTestImpl&) = delete; + DeathTestImpl& operator=(const DeathTestImpl&) = delete; protected: explicit DeathTestImpl(stdx::function<std::unique_ptr<Test>()> makeTest); diff --git a/src/mongo/unittest/task_executor_proxy.h b/src/mongo/unittest/task_executor_proxy.h index f4860692f38..436c3a72216 100644 --- a/src/mongo/unittest/task_executor_proxy.h +++ b/src/mongo/unittest/task_executor_proxy.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/executor/task_executor.h" namespace mongo { @@ -39,7 +38,8 @@ namespace unittest { * Proxy for the executor::TaskExecutor interface used for testing. */ class TaskExecutorProxy : public executor::TaskExecutor { - MONGO_DISALLOW_COPYING(TaskExecutorProxy); + TaskExecutorProxy(const TaskExecutorProxy&) = delete; + TaskExecutorProxy& operator=(const TaskExecutorProxy&) = delete; public: /** diff --git a/src/mongo/unittest/temp_dir.h b/src/mongo/unittest/temp_dir.h index f12673159c7..17fbc82e1e5 100644 --- a/src/mongo/unittest/temp_dir.h +++ b/src/mongo/unittest/temp_dir.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" namespace mongo { namespace unittest { @@ -40,7 +39,8 @@ namespace unittest { * An RAII temporary directory that deletes itself and all contents files on scope exit. */ class TempDir { - MONGO_DISALLOW_COPYING(TempDir); + TempDir(const TempDir&) = delete; + TempDir& operator=(const TempDir&) = delete; public: /** diff --git a/src/mongo/unittest/unittest.h b/src/mongo/unittest/unittest.h index 7144944389a..204443b9708 100644 --- a/src/mongo/unittest/unittest.h +++ b/src/mongo/unittest/unittest.h @@ -290,7 +290,8 @@ typedef stdx::function<void(void)> TestFunction; * contain lists of these. */ class TestHolder { - MONGO_DISALLOW_COPYING(TestHolder); + TestHolder(const TestHolder&) = delete; + TestHolder& operator=(const TestHolder&) = delete; public: TestHolder(const std::string& name, const TestFunction& fn) : _name(name), _fn(fn) {} @@ -313,7 +314,8 @@ private: * by the TEST() macro. */ class Test { - MONGO_DISALLOW_COPYING(Test); + Test(const Test&) = delete; + Test& operator=(const Test&) = delete; public: Test(); @@ -337,7 +339,8 @@ protected: */ template <typename T> class RegistrationAgent { - MONGO_DISALLOW_COPYING(RegistrationAgent); + RegistrationAgent(const RegistrationAgent&) = delete; + RegistrationAgent& operator=(const RegistrationAgent&) = delete; public: RegistrationAgent(const std::string& suiteName, const std::string& testName); @@ -409,7 +412,8 @@ private: * approach is deprecated. */ class Suite { - MONGO_DISALLOW_COPYING(Suite); + Suite(const Suite&) = delete; + Suite& operator=(const Suite&) = delete; public: Suite(const std::string& name); diff --git a/src/mongo/util/background.h b/src/mongo/util/background.h index aab4099b483..81c5ecb07c4 100644 --- a/src/mongo/util/background.h +++ b/src/mongo/util/background.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" namespace mongo { @@ -55,7 +54,8 @@ namespace mongo { */ class BackgroundJob { - MONGO_DISALLOW_COPYING(BackgroundJob); + BackgroundJob(const BackgroundJob&) = delete; + BackgroundJob& operator=(const BackgroundJob&) = delete; protected: /** diff --git a/src/mongo/util/background_thread_clock_source.h b/src/mongo/util/background_thread_clock_source.h index a70b21028d8..4b2d13324c2 100644 --- a/src/mongo/util/background_thread_clock_source.h +++ b/src/mongo/util/background_thread_clock_source.h @@ -32,7 +32,6 @@ #include <chrono> #include <thread> -#include "mongo/base/disallow_copying.h" #include "mongo/platform/atomic_word.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/memory.h" @@ -52,7 +51,8 @@ namespace mongo { * sleeps for the background thread. */ class BackgroundThreadClockSource final : public ClockSource { - MONGO_DISALLOW_COPYING(BackgroundThreadClockSource); + BackgroundThreadClockSource(const BackgroundThreadClockSource&) = delete; + BackgroundThreadClockSource& operator=(const BackgroundThreadClockSource&) = delete; public: BackgroundThreadClockSource(std::unique_ptr<ClockSource> clockSource, Milliseconds granularity); diff --git a/src/mongo/util/bufreader.h b/src/mongo/util/bufreader.h index ac070e0c70b..42ff79af60c 100644 --- a/src/mongo/util/bufreader.h +++ b/src/mongo/util/bufreader.h @@ -38,7 +38,6 @@ #include "mongo/base/data_range.h" #include "mongo/base/data_range_cursor.h" #include "mongo/base/data_type_terminated.h" -#include "mongo/base/disallow_copying.h" #include "mongo/bson/util/builder.h" #include "mongo/platform/strnlen.h" #include "mongo/util/assert_util.h" @@ -50,7 +49,8 @@ namespace mongo { buffer with which we are working. */ class BufReader { - MONGO_DISALLOW_COPYING(BufReader); + BufReader(const BufReader&) = delete; + BufReader& operator=(const BufReader&) = delete; public: BufReader(const void* p, unsigned len) diff --git a/src/mongo/util/concurrency/idle_thread_block.h b/src/mongo/util/concurrency/idle_thread_block.h index a395012d30a..ae1fcb96ff2 100644 --- a/src/mongo/util/concurrency/idle_thread_block.h +++ b/src/mongo/util/concurrency/idle_thread_block.h @@ -31,7 +31,6 @@ #include <boost/preprocessor/stringize.hpp> -#include "mongo/base/disallow_copying.h" namespace mongo { @@ -44,7 +43,8 @@ namespace mongo { * idle. */ class IdleThreadBlock { - MONGO_DISALLOW_COPYING(IdleThreadBlock); + IdleThreadBlock(const IdleThreadBlock&) = delete; + IdleThreadBlock& operator=(const IdleThreadBlock&) = delete; public: IdleThreadBlock(const char* location) { diff --git a/src/mongo/util/concurrency/mutex.h b/src/mongo/util/concurrency/mutex.h index 4e47c4e6df6..8674fe269a4 100644 --- a/src/mongo/util/concurrency/mutex.h +++ b/src/mongo/util/concurrency/mutex.h @@ -35,7 +35,6 @@ #include <pthread.h> #endif -#include "mongo/base/disallow_copying.h" #include "mongo/util/assert_util.h" namespace mongo { @@ -49,7 +48,8 @@ namespace mongo { #if defined(_WIN32) class SimpleMutex { - MONGO_DISALLOW_COPYING(SimpleMutex); + SimpleMutex(const SimpleMutex&) = delete; + SimpleMutex& operator=(const SimpleMutex&) = delete; public: SimpleMutex() { @@ -74,7 +74,8 @@ private: #else class SimpleMutex { - MONGO_DISALLOW_COPYING(SimpleMutex); + SimpleMutex(const SimpleMutex&) = delete; + SimpleMutex& operator=(const SimpleMutex&) = delete; public: SimpleMutex() { diff --git a/src/mongo/util/concurrency/spin_lock.h b/src/mongo/util/concurrency/spin_lock.h index 38854fef457..7f237dc3175 100644 --- a/src/mongo/util/concurrency/spin_lock.h +++ b/src/mongo/util/concurrency/spin_lock.h @@ -35,7 +35,6 @@ #include <atomic> #endif -#include "mongo/base/disallow_copying.h" #include "mongo/config.h" #include "mongo/platform/compiler.h" #include "mongo/stdx/mutex.h" @@ -44,7 +43,8 @@ namespace mongo { #if defined(_WIN32) class SpinLock { - MONGO_DISALLOW_COPYING(SpinLock); + SpinLock(const SpinLock&) = delete; + SpinLock& operator=(const SpinLock&) = delete; public: SpinLock() { @@ -71,7 +71,8 @@ private: #if MONGO_CONFIG_DEBUG_BUILD class SpinLock { - MONGO_DISALLOW_COPYING(SpinLock); + SpinLock(const SpinLock&) = delete; + SpinLock& operator=(const SpinLock&) = delete; public: SpinLock() = default; @@ -91,7 +92,8 @@ private: #else class SpinLock { - MONGO_DISALLOW_COPYING(SpinLock); + SpinLock(const SpinLock&) = delete; + SpinLock& operator=(const SpinLock&) = delete; public: SpinLock() = default; diff --git a/src/mongo/util/concurrency/thread_pool.h b/src/mongo/util/concurrency/thread_pool.h index b95956c4832..370de65056e 100644 --- a/src/mongo/util/concurrency/thread_pool.h +++ b/src/mongo/util/concurrency/thread_pool.h @@ -33,7 +33,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/functional.h" #include "mongo/stdx/mutex.h" @@ -51,7 +50,8 @@ class Status; * See the Options struct for information about how to configure an instance. */ class ThreadPool final : public ThreadPoolInterface { - MONGO_DISALLOW_COPYING(ThreadPool); + ThreadPool(const ThreadPool&) = delete; + ThreadPool& operator=(const ThreadPool&) = delete; public: /** diff --git a/src/mongo/util/concurrency/thread_pool_interface.h b/src/mongo/util/concurrency/thread_pool_interface.h index dde15644cb2..847dfe0506b 100644 --- a/src/mongo/util/concurrency/thread_pool_interface.h +++ b/src/mongo/util/concurrency/thread_pool_interface.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/util/functional.h" namespace mongo { @@ -40,7 +39,8 @@ class Status; * Interface for a thread pool. */ class ThreadPoolInterface { - MONGO_DISALLOW_COPYING(ThreadPoolInterface); + ThreadPoolInterface(const ThreadPoolInterface&) = delete; + ThreadPoolInterface& operator=(const ThreadPoolInterface&) = delete; public: using Task = unique_function<void()>; diff --git a/src/mongo/util/concurrency/thread_pool_test_common.cpp b/src/mongo/util/concurrency/thread_pool_test_common.cpp index 5df135ac19c..a03da59cd49 100644 --- a/src/mongo/util/concurrency/thread_pool_test_common.cpp +++ b/src/mongo/util/concurrency/thread_pool_test_common.cpp @@ -70,7 +70,8 @@ static ThreadPoolTestCaseMap& threadPoolTestCaseRegistry() { } class TptRegistrationAgent { - MONGO_DISALLOW_COPYING(TptRegistrationAgent); + TptRegistrationAgent(const TptRegistrationAgent&) = delete; + TptRegistrationAgent& operator=(const TptRegistrationAgent&) = delete; public: TptRegistrationAgent(const std::string& name, ThreadPoolTestCaseFactory makeTest) { @@ -85,7 +86,8 @@ public: template <typename T> class TptDeathRegistrationAgent { - MONGO_DISALLOW_COPYING(TptDeathRegistrationAgent); + TptDeathRegistrationAgent(const TptDeathRegistrationAgent&) = delete; + TptDeathRegistrationAgent& operator=(const TptDeathRegistrationAgent&) = delete; public: TptDeathRegistrationAgent(const std::string& name, ThreadPoolTestCaseFactory makeTest) { diff --git a/src/mongo/util/concurrency/ticketholder.h b/src/mongo/util/concurrency/ticketholder.h index 53a70e8f914..51c232bc5d1 100644 --- a/src/mongo/util/concurrency/ticketholder.h +++ b/src/mongo/util/concurrency/ticketholder.h @@ -32,7 +32,6 @@ #include <semaphore.h> #endif -#include "mongo/base/disallow_copying.h" #include "mongo/db/operation_context.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" @@ -42,7 +41,8 @@ namespace mongo { class TicketHolder { - MONGO_DISALLOW_COPYING(TicketHolder); + TicketHolder(const TicketHolder&) = delete; + TicketHolder& operator=(const TicketHolder&) = delete; public: explicit TicketHolder(int num); @@ -113,7 +113,8 @@ private: }; class TicketHolderReleaser { - MONGO_DISALLOW_COPYING(TicketHolderReleaser); + TicketHolderReleaser(const TicketHolderReleaser&) = delete; + TicketHolderReleaser& operator=(const TicketHolderReleaser&) = delete; public: TicketHolderReleaser() { diff --git a/src/mongo/util/decoration_registry.h b/src/mongo/util/decoration_registry.h index e06b96b22c6..721d2a4077c 100644 --- a/src/mongo/util/decoration_registry.h +++ b/src/mongo/util/decoration_registry.h @@ -35,7 +35,6 @@ #include <type_traits> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/static_assert.h" #include "mongo/stdx/functional.h" #include "mongo/util/decoration_container.h" @@ -53,7 +52,8 @@ namespace mongo { */ template <typename DecoratedType> class DecorationRegistry { - MONGO_DISALLOW_COPYING(DecorationRegistry); + DecorationRegistry(const DecorationRegistry&) = delete; + DecorationRegistry& operator=(const DecorationRegistry&) = delete; public: DecorationRegistry() = default; diff --git a/src/mongo/util/fail_point.h b/src/mongo/util/fail_point.h index 57269fa8bc0..367eeab3632 100644 --- a/src/mongo/util/fail_point.h +++ b/src/mongo/util/fail_point.h @@ -29,7 +29,6 @@ #pragma once -#include "mongo/base/disallow_copying.h" #include "mongo/base/status_with.h" #include "mongo/db/jsobj.h" #include "mongo/db/operation_context.h" @@ -69,7 +68,8 @@ namespace mongo { * 2. Client visible fail point states are read-only when active. */ class FailPoint { - MONGO_DISALLOW_COPYING(FailPoint); + FailPoint(const FailPoint&) = delete; + FailPoint& operator=(const FailPoint&) = delete; public: typedef unsigned ValType; @@ -213,7 +213,8 @@ private: * MONGO_FAIL_POINT_BLOCK macro. */ class ScopedFailPoint { - MONGO_DISALLOW_COPYING(ScopedFailPoint); + ScopedFailPoint(const ScopedFailPoint&) = delete; + ScopedFailPoint& operator=(const ScopedFailPoint&) = delete; public: template <typename Callable = std::nullptr_t> diff --git a/src/mongo/util/heap_profiler.cpp b/src/mongo/util/heap_profiler.cpp index be7910856a2..3edb8717f79 100644 --- a/src/mongo/util/heap_profiler.cpp +++ b/src/mongo/util/heap_profiler.cpp @@ -151,7 +151,8 @@ using Hash = uint32_t; template <class Key, class Value> class HashTable { - MONGO_DISALLOW_COPYING(HashTable); + HashTable(const HashTable&) = delete; + HashTable& operator=(const HashTable&) = delete; private: struct Entry { diff --git a/src/mongo/util/intrusive_counter.h b/src/mongo/util/intrusive_counter.h index 1ca640e5a4b..448214ab965 100644 --- a/src/mongo/util/intrusive_counter.h +++ b/src/mongo/util/intrusive_counter.h @@ -32,7 +32,6 @@ #include <boost/intrusive_ptr.hpp> #include <stdlib.h> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/platform/atomic_word.h" #include "mongo/util/allocator.h" @@ -41,7 +40,8 @@ namespace mongo { /// This is an alternative base class to the above ones (will replace them eventually) class RefCountable { - MONGO_DISALLOW_COPYING(RefCountable); + RefCountable(const RefCountable&) = delete; + RefCountable& operator=(const RefCountable&) = delete; public: /// If false you have exclusive access to this object. This is useful for implementing COW. diff --git a/src/mongo/util/itoa.h b/src/mongo/util/itoa.h index 60cda13e676..37451847a95 100644 --- a/src/mongo/util/itoa.h +++ b/src/mongo/util/itoa.h @@ -32,7 +32,6 @@ #include <cstdint> #include <limits> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" namespace mongo { @@ -42,7 +41,8 @@ namespace mongo { * and only really should be used in hot code paths. */ class ItoA { - MONGO_DISALLOW_COPYING(ItoA); + ItoA(const ItoA&) = delete; + ItoA& operator=(const ItoA&) = delete; public: static constexpr size_t kBufSize = std::numeric_limits<uint64_t>::digits10 // diff --git a/src/mongo/util/lru_cache.h b/src/mongo/util/lru_cache.h index d09aa6f7c84..bfe3ba19bf4 100644 --- a/src/mongo/util/lru_cache.h +++ b/src/mongo/util/lru_cache.h @@ -35,7 +35,6 @@ #include <boost/optional.hpp> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/unordered_map.h" namespace mongo { @@ -57,7 +56,8 @@ template <typename K, typename Hash = typename stdx::unordered_map<K, V>::hasher, typename KeyEqual = typename stdx::unordered_map<K, V, Hash>::key_equal> class LRUCache { - MONGO_DISALLOW_COPYING(LRUCache); + LRUCache(const LRUCache&) = delete; + LRUCache& operator=(const LRUCache&) = delete; public: explicit LRUCache(std::size_t maxSize) : _maxSize(maxSize) {} diff --git a/src/mongo/util/net/sock.h b/src/mongo/util/net/sock.h index 071cd2a7ced..8079ab00acb 100644 --- a/src/mongo/util/net/sock.h +++ b/src/mongo/util/net/sock.h @@ -50,7 +50,6 @@ #include <utility> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/config.h" #include "mongo/logger/log_severity.h" #include "mongo/platform/compiler.h" @@ -83,7 +82,8 @@ typedef int SOCKET; * todo: ssl */ class Socket { - MONGO_DISALLOW_COPYING(Socket); + Socket(const Socket&) = delete; + Socket& operator=(const Socket&) = delete; public: static const int errorPollIntervalSecs; diff --git a/src/mongo/util/net/ssl_manager.h b/src/mongo/util/net/ssl_manager.h index 7a8f5889d1b..de77d2951ae 100644 --- a/src/mongo/util/net/ssl_manager.h +++ b/src/mongo/util/net/ssl_manager.h @@ -37,7 +37,6 @@ #ifdef MONGO_CONFIG_SSL -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/bson/bsonobj.h" #include "mongo/db/service_context.h" diff --git a/src/mongo/util/perfctr_collect.h b/src/mongo/util/perfctr_collect.h index 31a1028c41c..95d9222b434 100644 --- a/src/mongo/util/perfctr_collect.h +++ b/src/mongo/util/perfctr_collect.h @@ -36,7 +36,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/base/string_data.h" @@ -53,7 +52,8 @@ class BSONObjBuilder; * instance name. */ class PerfCounterCollection { - MONGO_DISALLOW_COPYING(PerfCounterCollection); + PerfCounterCollection(const PerfCounterCollection&) = delete; + PerfCounterCollection& operator=(const PerfCounterCollection&) = delete; friend class PerfCounterCollector; @@ -136,7 +136,8 @@ private: * output the raw counter values to BSONObjBuilder. */ class PerfCounterCollector { - MONGO_DISALLOW_COPYING(PerfCounterCollector); + PerfCounterCollector(const PerfCounterCollector&) = delete; + PerfCounterCollector& operator=(const PerfCounterCollector&) = delete; public: ~PerfCounterCollector(); diff --git a/src/mongo/util/periodic_runner.h b/src/mongo/util/periodic_runner.h index 59829584a51..561775a5302 100644 --- a/src/mongo/util/periodic_runner.h +++ b/src/mongo/util/periodic_runner.h @@ -31,7 +31,6 @@ #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/functional.h" #include "mongo/util/time_support.h" diff --git a/src/mongo/util/periodic_runner_impl.h b/src/mongo/util/periodic_runner_impl.h index 97e9467a436..b27b9ef09f2 100644 --- a/src/mongo/util/periodic_runner_impl.h +++ b/src/mongo/util/periodic_runner_impl.h @@ -61,7 +61,8 @@ public: private: class PeriodicJobImpl { - MONGO_DISALLOW_COPYING(PeriodicJobImpl); + PeriodicJobImpl(const PeriodicJobImpl&) = delete; + PeriodicJobImpl& operator=(const PeriodicJobImpl&) = delete; public: friend class PeriodicRunnerImpl; diff --git a/src/mongo/util/progress_meter.h b/src/mongo/util/progress_meter.h index 3e1e1ac70e1..c666c0e90a2 100644 --- a/src/mongo/util/progress_meter.h +++ b/src/mongo/util/progress_meter.h @@ -36,7 +36,8 @@ namespace mongo { class ProgressMeter { - MONGO_DISALLOW_COPYING(ProgressMeter); + ProgressMeter(const ProgressMeter&) = delete; + ProgressMeter& operator=(const ProgressMeter&) = delete; public: ProgressMeter(unsigned long long total, @@ -130,7 +131,8 @@ private: * underlying ProgressMeter, which is owned by CurOp. */ class ProgressMeterHolder { - MONGO_DISALLOW_COPYING(ProgressMeterHolder); + ProgressMeterHolder(const ProgressMeterHolder&) = delete; + ProgressMeterHolder& operator=(const ProgressMeterHolder&) = delete; public: ProgressMeterHolder() : _pm(nullptr) {} diff --git a/src/mongo/util/queue.h b/src/mongo/util/queue.h index c503f74808a..6cc79d5d47f 100644 --- a/src/mongo/util/queue.h +++ b/src/mongo/util/queue.h @@ -33,7 +33,6 @@ #include <limits> #include <queue> -#include "mongo/base/disallow_copying.h" #include "mongo/stdx/chrono.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/functional.h" @@ -51,7 +50,8 @@ namespace mongo { */ template <typename T> class BlockingQueue { - MONGO_DISALLOW_COPYING(BlockingQueue); + BlockingQueue(const BlockingQueue&) = delete; + BlockingQueue& operator=(const BlockingQueue&) = delete; public: using GetSizeFn = stdx::function<size_t(const T&)>; diff --git a/src/mongo/util/signal_handlers_synchronous.cpp b/src/mongo/util/signal_handlers_synchronous.cpp index 99b70b03340..90b758d40fc 100644 --- a/src/mongo/util/signal_handlers_synchronous.cpp +++ b/src/mongo/util/signal_handlers_synchronous.cpp @@ -42,7 +42,6 @@ #include <streambuf> #include <typeinfo> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/logger/log_domain.h" #include "mongo/logger/logger.h" @@ -94,7 +93,8 @@ void endProcessWithSignal(int signalNum) { // This should only be used with MallocFreeOSteam class MallocFreeStreambuf : public std::streambuf { - MONGO_DISALLOW_COPYING(MallocFreeStreambuf); + MallocFreeStreambuf(const MallocFreeStreambuf&) = delete; + MallocFreeStreambuf& operator=(const MallocFreeStreambuf&) = delete; public: MallocFreeStreambuf() { @@ -114,7 +114,8 @@ private: }; class MallocFreeOStream : public std::ostream { - MONGO_DISALLOW_COPYING(MallocFreeOStream); + MallocFreeOStream(const MallocFreeOStream&) = delete; + MallocFreeOStream& operator=(const MallocFreeOStream&) = delete; public: MallocFreeOStream() : std::ostream(&_buf) {} diff --git a/src/mongo/util/stacktrace_windows.cpp b/src/mongo/util/stacktrace_windows.cpp index 0e7eacf40d7..bf98e1f0646 100644 --- a/src/mongo/util/stacktrace_windows.cpp +++ b/src/mongo/util/stacktrace_windows.cpp @@ -48,7 +48,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/init.h" #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" @@ -65,7 +64,8 @@ const auto kPathBufferSize = 1024; // symbol handler. Because access to the symbol handler API is not thread-safe, it also provides // a lock/unlock method so the whole symbol handler can be used with a stdx::lock_guard. class SymbolHandler { - MONGO_DISALLOW_COPYING(SymbolHandler); + SymbolHandler(const SymbolHandler&) = delete; + SymbolHandler& operator=(const SymbolHandler&) = delete; public: SymbolHandler() { diff --git a/src/mongo/util/tcmalloc_set_parameter.cpp b/src/mongo/util/tcmalloc_set_parameter.cpp index 07eb2ba7ef0..179d717fafa 100644 --- a/src/mongo/util/tcmalloc_set_parameter.cpp +++ b/src/mongo/util/tcmalloc_set_parameter.cpp @@ -37,7 +37,6 @@ #include <gperftools/malloc_extension.h> #include <valgrind/valgrind.h> -#include "mongo/base/disallow_copying.h" #include "mongo/base/init.h" #include "mongo/base/parse_number.h" #include "mongo/base/status.h" diff --git a/src/mongo/util/text.h b/src/mongo/util/text.h index 06c4a1de126..76309541d0c 100644 --- a/src/mongo/util/text.h +++ b/src/mongo/util/text.h @@ -32,7 +32,6 @@ #include <string> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/config.h" @@ -93,7 +92,8 @@ inline std::wstring toNativeString(const char* s) { #endif class WindowsCommandLine { - MONGO_DISALLOW_COPYING(WindowsCommandLine); + WindowsCommandLine(const WindowsCommandLine&) = delete; + WindowsCommandLine& operator=(const WindowsCommandLine&) = delete; char** _argv; char** _envp; diff --git a/src/mongo/util/thread_safe_string.h b/src/mongo/util/thread_safe_string.h index baf00eea527..606d0144f7f 100644 --- a/src/mongo/util/thread_safe_string.h +++ b/src/mongo/util/thread_safe_string.h @@ -33,7 +33,6 @@ #include <iosfwd> #include <string> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" namespace mongo { @@ -43,7 +42,8 @@ namespace mongo { * you will never get a bad pointer, though data may be mungedd */ class ThreadSafeString { - MONGO_DISALLOW_COPYING(ThreadSafeString); + ThreadSafeString(const ThreadSafeString&) = delete; + ThreadSafeString& operator=(const ThreadSafeString&) = delete; public: ThreadSafeString(size_t size = 256) : _size(size), _buf(new char[size]) { diff --git a/src/mongo/util/version.h b/src/mongo/util/version.h index 4a587e65e5d..e6726132ced 100644 --- a/src/mongo/util/version.h +++ b/src/mongo/util/version.h @@ -34,7 +34,6 @@ #include <tuple> #include <vector> -#include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" namespace mongo { @@ -47,7 +46,8 @@ class BSONObjBuilder; * able to access version information. */ class VersionInfoInterface { - MONGO_DISALLOW_COPYING(VersionInfoInterface); + VersionInfoInterface(const VersionInfoInterface&) = delete; + VersionInfoInterface& operator=(const VersionInfoInterface&) = delete; public: using BuildInfoTuple = std::tuple<StringData, StringData, bool, bool>; |