diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-12-18 17:15:39 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-12-18 17:54:29 -0500 |
commit | 4312da76ee19623dd60811a22a53fa8e9beb484c (patch) | |
tree | 79e2fd150be9b6efc09f903f2b423f148da13c83 /src | |
parent | 1197bbad52d34a2c504f3269373946eed4a557dc (diff) | |
download | mongo-4312da76ee19623dd60811a22a53fa8e9beb484c.tar.gz |
SERVER-29909 Remove unnecessary class friendship declarations
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/catalog/catalog_raii.cpp | 14 | ||||
-rw-r--r-- | src/mongo/db/catalog/catalog_raii.h | 17 | ||||
-rw-r--r-- | src/mongo/db/db_raii.h | 4 |
3 files changed, 14 insertions, 21 deletions
diff --git a/src/mongo/db/catalog/catalog_raii.cpp b/src/mongo/db/catalog/catalog_raii.cpp index decd79fc513..ef61f3db568 100644 --- a/src/mongo/db/catalog/catalog_raii.cpp +++ b/src/mongo/db/catalog/catalog_raii.cpp @@ -64,13 +64,6 @@ AutoGetCollection::AutoGetCollection(OperationContext* opCtx, AutoGetCollection::AutoGetCollection(OperationContext* opCtx, const NamespaceString& nss, - LockMode modeDB, - LockMode modeColl, - ViewMode viewMode) - : AutoGetCollection(opCtx, nss, modeColl, viewMode, Lock::DBLock(opCtx, nss.db(), modeDB)) {} - -AutoGetCollection::AutoGetCollection(OperationContext* opCtx, - const NamespaceString& nss, LockMode modeColl, ViewMode viewMode, Lock::DBLock lock) @@ -94,6 +87,13 @@ AutoGetCollection::AutoGetCollection(OperationContext* opCtx, } } +AutoGetCollection::AutoGetCollection(OperationContext* opCtx, + const NamespaceString& nss, + LockMode modeDB, + LockMode modeColl, + ViewMode viewMode) + : AutoGetCollection(opCtx, nss, modeColl, viewMode, Lock::DBLock(opCtx, nss.db(), modeDB)) {} + AutoGetCollectionOrView::AutoGetCollectionOrView(OperationContext* opCtx, const NamespaceString& nss, LockMode modeAll) diff --git a/src/mongo/db/catalog/catalog_raii.h b/src/mongo/db/catalog/catalog_raii.h index ea839261e4e..8ff5401dc18 100644 --- a/src/mongo/db/catalog/catalog_raii.h +++ b/src/mongo/db/catalog/catalog_raii.h @@ -78,10 +78,8 @@ private: class AutoGetCollection { MONGO_DISALLOW_COPYING(AutoGetCollection); - enum class ViewMode; - public: - AutoGetCollection(OperationContext*, const NamespaceString&, const UUID&, LockMode modeAll); + enum class ViewMode { kViewsPermitted, kViewsForbidden }; AutoGetCollection(OperationContext* opCtx, const NamespaceString& nss, LockMode modeAll) : AutoGetCollection(opCtx, nss, modeAll, modeAll, ViewMode::kViewsForbidden) {} @@ -94,6 +92,11 @@ public: AutoGetCollection(OperationContext* opCtx, const NamespaceString& nss, + const UUID& uuid, + LockMode modeAll); + + AutoGetCollection(OperationContext* opCtx, + const NamespaceString& nss, LockMode modeColl, ViewMode viewMode, Lock::DBLock lock); @@ -125,17 +128,11 @@ public: } private: - enum class ViewMode { kViewsPermitted, kViewsForbidden }; - const ViewMode _viewMode; const AutoGetDb _autoDb; const Lock::CollectionLock _collLock; - Collection* const _coll; - friend class AutoGetCollectionOrView; - friend class AutoGetCollectionForRead; - friend class AutoGetCollectionForReadCommand; - friend class AutoGetCollectionOrViewForReadCommand; + Collection* const _coll; }; /** diff --git a/src/mongo/db/db_raii.h b/src/mongo/db/db_raii.h index 25c676fe7ea..ec270c2f237 100644 --- a/src/mongo/db/db_raii.h +++ b/src/mongo/db/db_raii.h @@ -85,10 +85,6 @@ public: AutoGetCollectionForRead(OperationContext* opCtx, const NamespaceString& nss) : AutoGetCollectionForRead(opCtx, nss, AutoGetCollection::ViewMode::kViewsForbidden) {} - AutoGetCollectionForRead(OperationContext* opCtx, const NamespaceString& nss, Lock::DBLock lock) - : AutoGetCollectionForRead( - opCtx, nss, AutoGetCollection::ViewMode::kViewsForbidden, std::move(lock)) {} - AutoGetCollectionForRead(OperationContext* opCtx, const StringData dbName, const UUID& uuid); /** |