diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/modules.h | 22 | ||||
| -rw-r--r-- | include/timers.h | 21 |
2 files changed, 21 insertions, 22 deletions
diff --git a/include/modules.h b/include/modules.h index 53f723898..10b9ed8aa 100644 --- a/include/modules.h +++ b/include/modules.h @@ -195,10 +195,6 @@ class CoreExport Module : public Extensible */ Anope::string filename; - /** Callbacks used in this module - */ - std::list<CallBack *> callbacks; - /** Handle for this module, obtained from dlopen() */ void *handle; @@ -1126,11 +1122,6 @@ class CoreExport ModuleManager */ static void Attach(Implementation *i, Module *mod, size_t sz); - /** Delete all callbacks attached to a module - * @param m The module - */ - static void ClearCallBacks(Module *m); - /** Unloading all modules except the protocol module. */ static void UnloadAll(); @@ -1143,17 +1134,4 @@ class CoreExport ModuleManager static ModuleReturn DeleteModule(Module *m); }; -/** Class used for callbacks within modules. These are identical to Timers hwoever - * they will be cleaned up automatically when a module is unloaded, and Timers will not. - */ -class CoreExport CallBack : public Timer -{ - private: - Module *m; - public: - CallBack(Module *mod, long time_from_now, time_t now = Anope::CurTime, bool repeating = false); - - virtual ~CallBack(); -}; - #endif // MODULES_H diff --git a/include/timers.h b/include/timers.h index 229333596..a0b04efa2 100644 --- a/include/timers.h +++ b/include/timers.h @@ -18,6 +18,10 @@ class CoreExport Timer { private: + /** The owner of the timer, if any + */ + Module *owner; + /** The time this was created */ time_t settime; @@ -42,6 +46,14 @@ class CoreExport Timer */ Timer(long time_from_now, time_t now = Anope::CurTime, bool repeating = false); + /** Constructor, initializes the triggering time + * @param creator The creator of the timer + * @param time_from_now The number of seconds from now to trigger the timer + * @param now The time now + * @param repeating Repeat this timer every time_from_now if this is true + */ + Timer(Module *creator, long time_from_now, time_t now = Anope::CurTime, bool repeating = false); + /** Destructor, removes the timer from the list */ virtual ~Timer(); @@ -76,6 +88,11 @@ class CoreExport Timer */ time_t GetSetTime() const; + /** Returns the owner of this timer, if any + * @return The owner of the timer + */ + Module *GetOwner() const; + /** Called when the timer ticks * This should be overridden with something useful */ @@ -106,6 +123,10 @@ class CoreExport TimerManager * @param ctime The current time */ static void TickTimers(time_t ctime = Anope::CurTime); + + /** Deletes all timers owned by the given module + */ + static void DeleteTimersFor(Module *m); }; #endif // TIMERS_H |
