Skip to content

Commit

Permalink
SERVER-29909 Remove unnecessary class friendship declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloianm committed Dec 18, 2017
1 parent 1197bba commit 4312da7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
14 changes: 7 additions & 7 deletions src/mongo/db/catalog/catalog_raii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,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,
Expand All @@ -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)
Expand Down
17 changes: 7 additions & 10 deletions src/mongo/db/catalog/catalog_raii.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ class AutoGetDb {
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) {}
Expand All @@ -92,6 +90,11 @@ class AutoGetCollection {
LockMode modeColl)
: AutoGetCollection(opCtx, nss, modeDB, modeColl, ViewMode::kViewsForbidden) {}

AutoGetCollection(OperationContext* opCtx,
const NamespaceString& nss,
const UUID& uuid,
LockMode modeAll);

AutoGetCollection(OperationContext* opCtx,
const NamespaceString& nss,
LockMode modeColl,
Expand Down Expand Up @@ -125,17 +128,11 @@ class AutoGetCollection {
}

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;
};

/**
Expand Down
4 changes: 0 additions & 4 deletions src/mongo/db/db_raii.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ class AutoGetCollectionForRead {
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);

/**
Expand Down

0 comments on commit 4312da7

Please sign in to comment.