#pragma once #include #include #include #include #include "Swiften/EventLoop/EventOwner.h" namespace Swift { class Timer : public EventOwner, public boost::enable_shared_from_this { public: Timer(int milliseconds); ~Timer(); void start(); public: boost::signal onTick; private: void doStart(); void handleTimerTick(); private: int timeout_; boost::asio::io_service* ioService_; boost::thread* thread_; boost::asio::deadline_timer* timer_; }; }