diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-11-15 22:09:20 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-11-16 07:16:37 (GMT) |
commit | 999f19158672bd6c91fa274a9f8e968b84f8a931 (patch) | |
tree | cbcf864514c0abc71414d187f6810619bbf0fea9 /Swiften/Network/BoostNetworkFactories.h | |
parent | 0f4fad3929097dca24d1ca92b06283811661e1f4 (diff) | |
download | swift-contrib-999f19158672bd6c91fa274a9f8e968b84f8a931.zip swift-contrib-999f19158672bd6c91fa274a9f8e968b84f8a931.tar.bz2 |
Pass NetworkFactories as an explicit dependency into client.
Diffstat (limited to 'Swiften/Network/BoostNetworkFactories.h')
-rw-r--r-- | Swiften/Network/BoostNetworkFactories.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Swiften/Network/BoostNetworkFactories.h b/Swiften/Network/BoostNetworkFactories.h new file mode 100644 index 0000000..3f8b557 --- /dev/null +++ b/Swiften/Network/BoostNetworkFactories.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010 Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include "Swiften/Network/NetworkFactories.h" +#include "Swiften/Network/BoostIOServiceThread.h" + +namespace Swift { + class EventLoop; + + class BoostNetworkFactories : public NetworkFactories { + public: + BoostNetworkFactories(EventLoop* eventLoop); + ~BoostNetworkFactories(); + + virtual TimerFactory* getTimerFactory() const { + return timerFactory; + } + + virtual ConnectionFactory* getConnectionFactory() const { + return connectionFactory; + } + + BoostIOServiceThread* getIOServiceThread() { + return &ioServiceThread; + } + + private: + BoostIOServiceThread ioServiceThread; + TimerFactory* timerFactory; + ConnectionFactory* connectionFactory; + }; +} |