summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-12 19:48:32 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-12 20:41:59 (GMT)
commit8231ecc07c1c7d5e260a2795b0660de157501850 (patch)
tree935baa855914d632086fcac5f26330c2f0261216 /Swiften/StreamStack/WhitespacePingLayer.cpp
parent48bb7441f913144d6a20687ff79264e4631156f0 (diff)
downloadswift-8231ecc07c1c7d5e260a2795b0660de157501850.zip
swift-8231ecc07c1c7d5e260a2795b0660de157501850.tar.bz2
Created a TimerFactory, and abstracted Timer.
Diffstat (limited to 'Swiften/StreamStack/WhitespacePingLayer.cpp')
-rw-r--r--Swiften/StreamStack/WhitespacePingLayer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/StreamStack/WhitespacePingLayer.cpp b/Swiften/StreamStack/WhitespacePingLayer.cpp
index 939c4fa..5c1eb00 100644
--- a/Swiften/StreamStack/WhitespacePingLayer.cpp
+++ b/Swiften/StreamStack/WhitespacePingLayer.cpp
@@ -1,16 +1,16 @@
#include "Swiften/StreamStack/WhitespacePingLayer.h"
-#include "Swiften/Network/BoostIOServiceThread.h"
-#include "Swiften/Network/MainBoostIOServiceThread.h"
+#include <boost/bind.hpp>
+
+#include "Swiften/Network/TimerFactory.h"
#include "Swiften/Network/Timer.h"
namespace Swift {
static const int TIMEOUT_MILLISECONDS = 60000;
-WhitespacePingLayer::WhitespacePingLayer() : isActive(false) {
- // FIXME: Create a BoostTimerFactory.
- timer = boost::shared_ptr<Timer>(new Timer(TIMEOUT_MILLISECONDS, &MainBoostIOServiceThread::getInstance().getIOService()));
+WhitespacePingLayer::WhitespacePingLayer(TimerFactory* timerFactory) : isActive(false) {
+ timer = timerFactory->createTimer(TIMEOUT_MILLISECONDS);
timer->onTick.connect(boost::bind(&WhitespacePingLayer::handleTimerTick, this));
}