summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/Timer.cpp')
-rw-r--r--Swiften/Network/Timer.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/Swiften/Network/Timer.cpp b/Swiften/Network/Timer.cpp
index d6120e3..a8d17c3 100644
--- a/Swiften/Network/Timer.cpp
+++ b/Swiften/Network/Timer.cpp
@@ -1,37 +1,8 @@
#include "Swiften/Network/Timer.h"
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-#include "Swiften/EventLoop/MainEventLoop.h"
-
namespace Swift {
-Timer::Timer(int milliseconds, boost::asio::io_service* service) :
- timeout(milliseconds), timer(*service) {
-}
-
Timer::~Timer() {
- stop();
-}
-
-void Timer::start() {
- timer.expires_from_now(boost::posix_time::milliseconds(timeout));
- timer.async_wait(boost::bind(&Timer::handleTimerTick, shared_from_this(), boost::asio::placeholders::error));
-}
-
-void Timer::stop() {
- timer.cancel();
-}
-
-void Timer::handleTimerTick(const boost::system::error_code& error) {
- if (error) {
- assert(error == boost::asio::error::operation_aborted);
- }
- else {
- MainEventLoop::postEvent(boost::bind(boost::ref(onTick)), shared_from_this());
- timer.expires_from_now(boost::posix_time::milliseconds(timeout));
- timer.async_wait(boost::bind(&Timer::handleTimerTick, shared_from_this(), boost::asio::placeholders::error));
- }
}
}