diff options
author | Samantha Ritter <samantha.ritter@10gen.com> | 2015-09-13 23:33:58 -0400 |
---|---|---|
committer | samantharitter <samantha.ritter@10gen.com> | 2015-09-17 11:06:55 -0400 |
commit | 32cdd0dc1d50dfc31d8007c7787be7486af7565e (patch) | |
tree | e51de5a3356768062d5b79ffbad0611cedbb0226 /src/mongo/executor/network_interface_asio.h | |
parent | dd4615e26dabd7ac6c2998061da004065cd3cf1a (diff) | |
download | mongo-32cdd0dc1d50dfc31d8007c7787be7486af7565e.tar.gz |
SERVER-19438 Add the ability to mock timers underneath NetworkInterfaceASIO
Diffstat (limited to 'src/mongo/executor/network_interface_asio.h')
-rw-r--r-- | src/mongo/executor/network_interface_asio.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/executor/network_interface_asio.h b/src/mongo/executor/network_interface_asio.h index 4df10715a2b..9f32d67b4f1 100644 --- a/src/mongo/executor/network_interface_asio.h +++ b/src/mongo/executor/network_interface_asio.h @@ -40,6 +40,7 @@ #include "mongo/base/status.h" #include "mongo/base/system_error.h" #include "mongo/executor/connection_pool.h" +#include "mongo/executor/async_timer_interface.h" #include "mongo/executor/network_connection_hook.h" #include "mongo/executor/network_interface.h" #include "mongo/executor/remote_command_request.h" @@ -75,7 +76,19 @@ class NetworkInterfaceASIO final : public NetworkInterface { public: struct Options { + Options() = default; + +// Explicit move construction and assignment to support MSVC +#if defined(_MSC_VER) && _MSC_VER < 1900 + Options(Options&&); + Options& operator=(Options&&); +#else + Options(Options&&) = default; + Options& operator=(Options&&) = default; +#endif + ConnectionPool::Options connectionPoolOptions; + std::unique_ptr<AsyncTimerFactoryInterface> timerFactory; }; NetworkInterfaceASIO(std::unique_ptr<AsyncStreamFactoryInterface> streamFactory, @@ -319,6 +332,8 @@ private: std::atomic<State> _state; + std::unique_ptr<AsyncTimerFactoryInterface> _timerFactory; + std::unique_ptr<AsyncStreamFactoryInterface> _streamFactory; ConnectionPool _connectionPool; |