diff options
Diffstat (limited to 'Swiften/Network/BoostTimer.h')
-rw-r--r-- | Swiften/Network/BoostTimer.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Swiften/Network/BoostTimer.h b/Swiften/Network/BoostTimer.h index 85db864..f48cb36 100644 --- a/Swiften/Network/BoostTimer.h +++ b/Swiften/Network/BoostTimer.h @@ -16,12 +16,18 @@ namespace Swift { class BoostTimer : public Timer, public EventOwner, public boost::enable_shared_from_this<BoostTimer> { public: - BoostTimer(int milliseconds, boost::asio::io_service* service); + typedef boost::shared_ptr<BoostTimer> ref; + + static ref create(int milliseconds, boost::asio::io_service* service) { + return ref(new BoostTimer(milliseconds, service)); + } virtual void start(); virtual void stop(); private: + BoostTimer(int milliseconds, boost::asio::io_service* service); + void handleTimerTick(const boost::system::error_code& error); private: |