diff options
Diffstat (limited to 'src/mongo/db/sessions_collection_mock.h')
-rw-r--r-- | src/mongo/db/sessions_collection_mock.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/mongo/db/sessions_collection_mock.h b/src/mongo/db/sessions_collection_mock.h index 05acb1f256f..64e2a76fc7b 100644 --- a/src/mongo/db/sessions_collection_mock.h +++ b/src/mongo/db/sessions_collection_mock.h @@ -54,7 +54,6 @@ namespace mongo { */ class MockSessionsCollectionImpl { public: - using SessionList = std::list<LogicalSessionId>; using SessionMap = stdx::unordered_map<LogicalSessionId, LogicalSessionRecord, LogicalSessionId::Hash>; @@ -62,8 +61,8 @@ public: using FetchHook = stdx::function<StatusWith<LogicalSessionRecord>(LogicalSessionId)>; using InsertHook = stdx::function<Status(LogicalSessionRecord)>; - using RefreshHook = stdx::function<SessionList(SessionList)>; - using RemoveHook = stdx::function<void(SessionList)>; + using RefreshHook = stdx::function<LogicalSessionIdSet(LogicalSessionIdSet)>; + using RemoveHook = stdx::function<void(LogicalSessionIdSet)>; // Set custom hooks to override default behavior void setFetchHook(FetchHook hook); @@ -77,8 +76,8 @@ public: // Forwarding methods from the MockSessionsCollection StatusWith<LogicalSessionRecord> fetchRecord(LogicalSessionId lsid); Status insertRecord(LogicalSessionRecord record); - SessionList refreshSessions(SessionList sessions); - void removeRecords(SessionList sessions); + LogicalSessionIdSet refreshSessions(LogicalSessionIdSet sessions); + void removeRecords(LogicalSessionIdSet sessions); // Test-side methods that operate on the _sessions map void add(LogicalSessionRecord record); @@ -91,8 +90,8 @@ private: // Default implementations, may be overridden with custom hooks. StatusWith<LogicalSessionRecord> _fetchRecord(LogicalSessionId lsid); Status _insertRecord(LogicalSessionRecord record); - SessionList _refreshSessions(SessionList sessions); - void _removeRecords(SessionList sessions); + LogicalSessionIdSet _refreshSessions(LogicalSessionIdSet sessions); + void _removeRecords(LogicalSessionIdSet sessions); stdx::mutex _mutex; SessionMap _sessions; @@ -110,8 +109,6 @@ private: */ class MockSessionsCollection : public SessionsCollection { public: - using SessionList = std::list<LogicalSessionId>; - explicit MockSessionsCollection(std::shared_ptr<MockSessionsCollectionImpl> impl) : _impl(std::move(impl)) {} @@ -123,11 +120,11 @@ public: return _impl->insertRecord(std::move(record)); } - SessionList refreshSessions(SessionList sessions) override { + LogicalSessionIdSet refreshSessions(LogicalSessionIdSet sessions) override { return _impl->refreshSessions(std::move(sessions)); } - void removeRecords(SessionList sessions) override { + void removeRecords(LogicalSessionIdSet sessions) override { return _impl->removeRecords(std::move(sessions)); } |