diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-10-27 19:06:56 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-10-27 19:07:55 (GMT) |
commit | 6810a2896f27e7ee07aee847f5e8dbccd1f6ec89 (patch) | |
tree | f7ea87f030e57cb4494a4f897506fb18fc3d2241 /Swiften/Network/FakeConnection.h | |
parent | a7da393cfc807048d320ddba8a1c7d24ef23a46e (diff) | |
download | swift-contrib-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.zip swift-contrib-6810a2896f27e7ee07aee847f5e8dbccd1f6ec89.tar.bz2 |
Remove MainEventLoop singleton.
The event loop now needs to be explicitly passed to clients
using it.
Diffstat (limited to 'Swiften/Network/FakeConnection.h')
-rw-r--r-- | Swiften/Network/FakeConnection.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Swiften/Network/FakeConnection.h b/Swiften/Network/FakeConnection.h index a89466f..4e2e960 100644 --- a/Swiften/Network/FakeConnection.h +++ b/Swiften/Network/FakeConnection.h @@ -14,7 +14,7 @@ #include "Swiften/Network/Connection.h" #include "Swiften/Network/HostAddressPort.h" #include "Swiften/EventLoop/EventOwner.h" -#include "Swiften/EventLoop/MainEventLoop.h" +#include "Swiften/EventLoop/EventLoop.h" namespace Swift { class FakeConnection : @@ -30,7 +30,7 @@ namespace Swift { DisconnectedWithError }; - FakeConnection() : state(Initial), delayConnect(false) {} + FakeConnection(EventLoop* eventLoop) : eventLoop(eventLoop), state(Initial), delayConnect(false) {} virtual void listen() { assert(false); @@ -44,7 +44,7 @@ namespace Swift { error = boost::optional<Error>(e); state = DisconnectedWithError; if (connectedTo) { - MainEventLoop::postEvent( + eventLoop->postEvent( boost::bind(boost::ref(onDisconnected), error), shared_from_this()); } @@ -62,7 +62,7 @@ namespace Swift { else { state = DisconnectedWithError; } - MainEventLoop::postEvent( + eventLoop->postEvent( boost::bind(boost::ref(onConnectFinished), error), shared_from_this()); } @@ -76,7 +76,7 @@ namespace Swift { state = DisconnectedWithError; } connectedTo.reset(); - MainEventLoop::postEvent( + eventLoop->postEvent( boost::bind(boost::ref(onDisconnected), error), shared_from_this()); } @@ -89,6 +89,7 @@ namespace Swift { delayConnect = true; } + EventLoop* eventLoop; boost::optional<HostAddressPort> connectedTo; std::vector<ByteArray> dataWritten; boost::optional<Error> error; |