summaryrefslogtreecommitdiffstats
blob: 9b27cf9965178c84af38e5dc5ea1261d0e2dc2a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <boost/enable_shared_from_this.hpp>

#include "Swiften/EventLoop/EventOwner.h"
#include "Swiften/Network/Timer.h"

namespace Swift {
	class BoostTimer : public Timer, public EventOwner, public boost::enable_shared_from_this<BoostTimer> {
		public:
			BoostTimer(int milliseconds, boost::asio::io_service* service);

			virtual void start();
			virtual void stop();

		private:
			void handleTimerTick(const boost::system::error_code& error);

		private:
			int timeout;
			boost::asio::deadline_timer timer;
	};
}