diff options
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/clientcursor.h | 5 | ||||
-rw-r--r-- | src/mongo/db/commands/mr.h | 18 | ||||
-rw-r--r-- | src/mongo/db/curop.h | 2 | ||||
-rw-r--r-- | src/mongo/db/dbhelpers.h | 3 | ||||
-rw-r--r-- | src/mongo/db/geo/r2_region_coverer.cpp | 12 | ||||
-rw-r--r-- | src/mongo/db/geo/r2_region_coverer.h | 23 | ||||
-rw-r--r-- | src/mongo/db/hasher.h | 11 | ||||
-rw-r--r-- | src/mongo/db/pipeline/document.h | 4 | ||||
-rw-r--r-- | src/mongo/db/pipeline/document_internal.h | 4 | ||||
-rw-r--r-- | src/mongo/db/storage/mmap_v1/file_allocator.h | 4 |
10 files changed, 48 insertions, 38 deletions
diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h index 4e81a39d7ba..d2482ffbfa9 100644 --- a/src/mongo/db/clientcursor.h +++ b/src/mongo/db/clientcursor.h @@ -28,8 +28,6 @@ #pragma once -#include <boost/noncopyable.hpp> - #include "mongo/db/jsobj.h" #include "mongo/db/query/plan_executor.h" #include "mongo/db/record_id.h" @@ -50,7 +48,8 @@ namespace mongo { * ClientCursor is a wrapper that represents a cursorid from our database application's * perspective. */ - class ClientCursor : private boost::noncopyable { + class ClientCursor { + MONGO_DISALLOW_COPYING(ClientCursor); public: /** * This ClientCursor constructor creates a cursorid that can be used with getMore and diff --git a/src/mongo/db/commands/mr.h b/src/mongo/db/commands/mr.h index b36e36b29b9..083165ebe27 100644 --- a/src/mongo/db/commands/mr.h +++ b/src/mongo/db/commands/mr.h @@ -30,7 +30,6 @@ #pragma once -#include <boost/noncopyable.hpp> #include <string> #include <vector> @@ -55,15 +54,19 @@ namespace mongo { // ------------ function interfaces ----------- - class Mapper : boost::noncopyable { + class Mapper { + MONGO_DISALLOW_COPYING(Mapper); public: virtual ~Mapper() {} virtual void init( State * state ) = 0; virtual void map( const BSONObj& o ) = 0; + protected: + Mapper() = default; }; - class Finalizer : boost::noncopyable { + class Finalizer { + MONGO_DISALLOW_COPYING(Finalizer); public: virtual ~Finalizer() {} virtual void init( State * state ) = 0; @@ -72,9 +75,13 @@ namespace mongo { * this takes a tuple and returns a tuple */ virtual BSONObj finalize( const BSONObj& tuple ) = 0; + + protected: + Finalizer() = default; }; - class Reducer : boost::noncopyable { + class Reducer { + MONGO_DISALLOW_COPYING(Reducer); public: Reducer() : numReduces(0) {} virtual ~Reducer() {} @@ -93,7 +100,8 @@ namespace mongo { * used as a holder for Scope and ScriptingFunction * visitor like pattern as Scope is gotten from first access */ - class JSFunction : boost::noncopyable { + class JSFunction { + MONGO_DISALLOW_COPYING(JSFunction); public: /** * @param type (map|reduce|finalize) diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h index 080739204f4..e8467f507b8 100644 --- a/src/mongo/db/curop.h +++ b/src/mongo/db/curop.h @@ -31,8 +31,6 @@ #pragma once -#include <boost/noncopyable.hpp> - #include "mongo/base/disallow_copying.h" #include "mongo/db/operation_context.h" #include "mongo/db/server_options.h" diff --git a/src/mongo/db/dbhelpers.h b/src/mongo/db/dbhelpers.h index a5e173773ca..a0ca0f0bc3d 100644 --- a/src/mongo/db/dbhelpers.h +++ b/src/mongo/db/dbhelpers.h @@ -209,7 +209,8 @@ namespace mongo { /** * for saving deleted bson objects to a flat file */ - class RemoveSaver : public boost::noncopyable { + class RemoveSaver { + MONGO_DISALLOW_COPYING(RemoveSaver); public: RemoveSaver(const std::string& type, const std::string& ns, const std::string& why); ~RemoveSaver(); diff --git a/src/mongo/db/geo/r2_region_coverer.cpp b/src/mongo/db/geo/r2_region_coverer.cpp index c5ee989f85e..b43db9665ad 100644 --- a/src/mongo/db/geo/r2_region_coverer.cpp +++ b/src/mongo/db/geo/r2_region_coverer.cpp @@ -36,21 +36,9 @@ namespace mongo { - using std::less; - // Definition int const R2RegionCoverer::kDefaultMaxCells = 8; - // We define our own own comparison function on QueueEntries in order to - // make the results deterministic. Using the default less<QueueEntry>, - // entries of equal priority would be sorted according to the memory address - // of the candidate. - struct R2RegionCoverer::CompareQueueEntries : public less<QueueEntry> { - bool operator()(QueueEntry const& x, QueueEntry const& y) { - return x.first < y.first; - } - }; - // Doesn't take ownership of "hashConverter". The caller should guarantee its life cycle // is longer than this coverer. R2RegionCoverer::R2RegionCoverer( GeoHashConverter* hashConverter ) : diff --git a/src/mongo/db/geo/r2_region_coverer.h b/src/mongo/db/geo/r2_region_coverer.h index ddfda208094..db0aa69c8d9 100644 --- a/src/mongo/db/geo/r2_region_coverer.h +++ b/src/mongo/db/geo/r2_region_coverer.h @@ -28,7 +28,6 @@ #pragma once -#include <boost/noncopyable.hpp> #include <queue> #include "mongo/db/geo/hash.h" @@ -38,11 +37,14 @@ namespace mongo { class R2Region; - class R2RegionCoverer : boost::noncopyable { + class R2RegionCoverer { + MONGO_DISALLOW_COPYING(R2RegionCoverer); + // By default, the covering uses at most 8 cells at any level. static const int kDefaultMaxCells; // = 8; public: + R2RegionCoverer() = default; R2RegionCoverer(GeoHashConverter* hashConverter); ~R2RegionCoverer(); @@ -104,8 +106,18 @@ namespace mongo { R2Region const* _region; // We keep the candidates that may intersect with this region in a priority queue. - struct CompareQueueEntries; typedef std::pair<int, Candidate*> QueueEntry; + + // We define our own own comparison function on QueueEntries in order to + // make the results deterministic. Using the default less<QueueEntry>, + // entries of equal priority would be sorted according to the memory address + // of the candidate. + struct CompareQueueEntries { + bool operator()(QueueEntry const& x, QueueEntry const& y) const { + return x.first < y.first; + } + }; + typedef std::priority_queue<QueueEntry, std::vector<QueueEntry>, CompareQueueEntries> CandidateQueue; std::unique_ptr<CandidateQueue> _candidateQueue; // Priority queue owns candidate pointers. @@ -114,8 +126,11 @@ namespace mongo { // An R2CellUnion is a region consisting of cells of various sizes. - class R2CellUnion : boost::noncopyable { + class R2CellUnion { + MONGO_DISALLOW_COPYING(R2CellUnion); public: + R2CellUnion() = default; + void init(const std::vector<GeoHash>& cellIds); bool contains(const GeoHash cellId) const; std::string toString() const; diff --git a/src/mongo/db/hasher.h b/src/mongo/db/hasher.h index 98d6a42ee03..e5bbb39d116 100644 --- a/src/mongo/db/hasher.h +++ b/src/mongo/db/hasher.h @@ -36,8 +36,6 @@ #include "mongo/platform/basic.h" -#include <boost/noncopyable.hpp> - #include "mongo/bson/bsonelement.h" #include "mongo/util/md5.hpp" @@ -46,7 +44,8 @@ namespace mongo { typedef int HashSeed; typedef unsigned char HashDigest[16]; - class Hasher : private boost::noncopyable { + class Hasher { + MONGO_DISALLOW_COPYING(Hasher); public: explicit Hasher( HashSeed seed ); @@ -64,7 +63,8 @@ namespace mongo { HashSeed _seed; }; - class HasherFactory : private boost::noncopyable { + class HasherFactory { + MONGO_DISALLOW_COPYING(HasherFactory); public: /* Eventually this may be a more sophisticated factory * for creating other hashers, but for now use MD5. @@ -77,7 +77,8 @@ namespace mongo { HasherFactory(); }; - class BSONElementHasher : private boost::noncopyable { + class BSONElementHasher { + MONGO_DISALLOW_COPYING(BSONElementHasher); public: /* The hash function we use can be given a seed, to effectively randomize it diff --git a/src/mongo/db/pipeline/document.h b/src/mongo/db/pipeline/document.h index 10d03ae8d2d..491b9c050d3 100644 --- a/src/mongo/db/pipeline/document.h +++ b/src/mongo/db/pipeline/document.h @@ -32,7 +32,6 @@ #include <boost/functional/hash.hpp> #include <boost/intrusive_ptr.hpp> -#include <boost/noncopyable.hpp> #include "mongo/bson/util/builder.h" @@ -278,7 +277,8 @@ namespace mongo { * shallow-clone its storage on write (COW) if it is shared with any other * Documents. */ - class MutableDocument : boost::noncopyable { + class MutableDocument { + MONGO_DISALLOW_COPYING(MutableDocument); 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 13d76be908e..93188ffb6f3 100644 --- a/src/mongo/db/pipeline/document_internal.h +++ b/src/mongo/db/pipeline/document_internal.h @@ -31,7 +31,6 @@ #include <third_party/murmurhash3/MurmurHash3.h> #include <boost/intrusive_ptr.hpp> -#include <boost/noncopyable.hpp> #include "mongo/util/intrusive_counter.h" #include "mongo/db/pipeline/value.h" @@ -65,7 +64,8 @@ namespace mongo { /** This is how values are stored in the DocumentStorage buffer * Internal class. Consumers shouldn't care about this. */ - class ValueElement : boost::noncopyable { + class ValueElement { + MONGO_DISALLOW_COPYING(ValueElement); public: Value val; Position nextCollision; // Position of next field with same hashBucket diff --git a/src/mongo/db/storage/mmap_v1/file_allocator.h b/src/mongo/db/storage/mmap_v1/file_allocator.h index aabe2a368bf..cb987b21618 100644 --- a/src/mongo/db/storage/mmap_v1/file_allocator.h +++ b/src/mongo/db/storage/mmap_v1/file_allocator.h @@ -31,7 +31,6 @@ #include <list> #include <boost/filesystem/path.hpp> -#include <boost/noncopyable.hpp> #include <boost/thread/condition.hpp> #include "mongo/util/concurrency/mutex.h" @@ -43,7 +42,8 @@ namespace mongo { * requested asynchronously or synchronously. * singleton */ - class FileAllocator : boost::noncopyable { + class FileAllocator { + MONGO_DISALLOW_COPYING(FileAllocator); /* * The public functions may not be called concurrently. The allocation * functions may be called multiple times per file, but only the first |