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/nickserv/cert.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'include/modules/nickserv/cert.h') diff --git a/include/modules/nickserv/cert.h b/include/modules/nickserv/cert.h index be75fb9bf..9bb21a565 100644 --- a/include/modules/nickserv/cert.h +++ b/include/modules/nickserv/cert.h @@ -14,7 +14,9 @@ class NSCertEntry; class CertService : public Service { public: - CertService(Module *c) : Service(c, "CertService", "certs") { } + static constexpr const char *NAME = "certs"; + + CertService(Module *c) : Service(c, NAME) { } virtual NickServ::Account* FindAccountFromCert(const Anope::string &cert) anope_abstract; @@ -23,11 +25,11 @@ class CertService : public Service virtual NSCertEntry *FindCert(const std::vector &cl, const Anope::string &certfp) anope_abstract; }; -static ServiceReference certservice("CertService", "certs"); - class NSCertEntry : public Serialize::Object { public: + static constexpr const char *NAME = "nscert"; + using Serialize::Object::Object; virtual NickServ::Account *GetAccount() anope_abstract; @@ -37,12 +39,14 @@ class NSCertEntry : public Serialize::Object virtual void SetCert(const Anope::string &) anope_abstract; }; -static Serialize::TypeReference certentry("NSCertEntry"); - namespace Event { struct CoreExport NickCertEvents : Events { + static constexpr const char *NAME = "nickcertevents"; + + using Events::Events; + /** Called when a user adds an entry to their cert list * @param nc The nick * @param entry The entry @@ -62,5 +66,3 @@ namespace Event }; } - -template<> struct EventName { static constexpr const char *const name = "OnNickCert"; }; -- cgit