From 0e758a2ac23dc4a001e8e126cec14588da9a9769 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 28 Jul 2016 21:29:35 -0400 Subject: Allow serializable fields to use storage in the respective objects. Split service management code nito a proper servicemanager. Make service references managed instead of lazy lookup. Also made events and serializable use service manager instead of their respective systems for management --- include/modules/chanserv/suspend.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'include/modules/chanserv/suspend.h') diff --git a/include/modules/chanserv/suspend.h b/include/modules/chanserv/suspend.h index 27187ea09..93702c107 100644 --- a/include/modules/chanserv/suspend.h +++ b/include/modules/chanserv/suspend.h @@ -1,5 +1,5 @@ /* - * (C) 2014 Anope Team + * (C) 2014-2016 Anope Team * Contact us at team@anope.org * * Please read COPYING and README for further details. @@ -12,6 +12,8 @@ class CSSuspendInfo : public Serialize::Object using Serialize::Object::Object; public: + static constexpr const char *const NAME = "cssuspendinfo"; + virtual ChanServ::Channel *GetChannel() anope_abstract; virtual void SetChannel(ChanServ::Channel *) anope_abstract; @@ -28,12 +30,14 @@ class CSSuspendInfo : public Serialize::Object virtual void SetExpires(const time_t &) anope_abstract; }; -static Serialize::TypeReference cssuspendinfo("CSSuspendInfo"); - namespace Event { struct CoreExport ChanSuspend : Events { + static constexpr const char *NAME = "chansuspend"; + + using Events::Events; + /** Called when a channel is suspended * @param ci The channel */ @@ -41,13 +45,14 @@ namespace Event }; struct CoreExport ChanUnsuspend : Events { + static constexpr const char *NAME = "chanunsuspend"; + + using Events::Events; + /** Called when a channel is unsuspended * @param ci The channel */ virtual void OnChanUnsuspend(ChanServ::Channel *ci) anope_abstract; }; - extern CoreExport EventHandlers OnChanUnsuspend; } -template<> struct EventName { static constexpr const char *const name = "OnChanSuspend"; }; -template<> struct EventName { static constexpr const char *const name = "OnChanUnsuspend"; }; -- cgit