From ad3c37e38c6c170c1f7cc3232db748ebdc62aa94 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 10 Aug 2006 00:02:31 +0000 Subject: Relocate timer stuff into TimerManager class git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4827 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/dynamic.h | 2 -- include/inspircd.h | 1 + include/modules.h | 4 ---- include/timer.h | 19 ++++++++++++++++--- 4 files changed, 17 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/dynamic.h b/include/dynamic.h index a8b7392bf..386ebb376 100644 --- a/include/dynamic.h +++ b/include/dynamic.h @@ -22,8 +22,6 @@ typedef void * (initfunc) (void); #include "inspircd_config.h" -extern void do_log(int, const char*, ...); - class DLLManager { public: diff --git a/include/inspircd.h b/include/inspircd.h index f901200cd..7cd1d973d 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -116,6 +116,7 @@ class InspIRCd : public classbase chan_hash chanlist; std::vector local_users; DNS* Res; + TimerManager* Timers; void AddServerName(const std::string &servername); const char* FindServerNamePtr(const std::string &servername); diff --git a/include/modules.h b/include/modules.h index b0d249c7c..aca4f06ea 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1357,10 +1357,6 @@ class Server : public Extensible */ virtual bool IsNick(const std::string &nick); - /** Adds an InspTimer which will trigger at a future time - */ - virtual void AddTimer(InspTimer* T); - /** Attempts to look up a nick and return a pointer to it. * This function will return NULL if the nick does not exist. */ diff --git a/include/timer.h b/include/timer.h index ec00abe4f..4d1eee470 100644 --- a/include/timer.h +++ b/include/timer.h @@ -54,8 +54,21 @@ class InspTimer : public Extensible virtual void Tick(time_t TIME) = 0; }; -void TickTimers(time_t TIME); -void AddTimer(InspTimer* T); -void TickMissedTimers(time_t TIME); +class TimerManager : public Extensible +{ + protected: + + typedef std::vector timergroup; + typedef std::map timerlist; + + private: + + timerlist Timers; + + public: + void TickTimers(time_t TIME); + void AddTimer(InspTimer* T); + void TickMissedTimers(time_t TIME); +}; #endif -- cgit v1.2.3