diff options
| author | Adam <Adam@anope.org> | 2014-12-10 01:29:18 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2014-12-10 01:29:18 -0500 |
| commit | 3e5a5e1c669f6027b897f7358d45f92e1552f746 (patch) | |
| tree | 5be9d41890d79eb0472f374b3f2a0ab9b36b1941 /include/modules/memoserv.h | |
| parent | 42238034490fb5479d787bd1695750387d508200 (diff) | |
Use a triat class for event names instead of having to manually give them places, which is much less error prone
Diffstat (limited to 'include/modules/memoserv.h')
| -rw-r--r-- | include/modules/memoserv.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/modules/memoserv.h b/include/modules/memoserv.h index 9a209e27f..b7d49ad3a 100644 --- a/include/modules/memoserv.h +++ b/include/modules/memoserv.h @@ -61,7 +61,7 @@ namespace MemoServ */ virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m) anope_abstract; }; - static EventHandlersReference<MemoSend> OnMemoSend("OnMemoSend"); + static EventHandlersReference<MemoSend> OnMemoSend; struct CoreExport MemoDel : Events { @@ -72,14 +72,14 @@ namespace MemoServ */ virtual void OnMemoDel(const Anope::string &target, MemoInfo *mi, const Memo *m) anope_abstract; }; - static EventHandlersReference<MemoDel> OnMemoDel("OnMemoDel"); + static EventHandlersReference<MemoDel> OnMemoDel; } class Memo : public Serialize::Object { protected: using Serialize::Object::Object; -// Memo() : Serialize::Object("Memo") { } + public: virtual MemoInfo *GetMemoInfo() anope_abstract; virtual void SetMemoInfo(MemoInfo *) anope_abstract; @@ -109,8 +109,7 @@ namespace MemoServ { protected: using Serialize::Object::Object; - //using MemoInfo::MemoInfo; - //MemoInfo() : Serialize::Object("MemoInfo") { } + public: virtual Memo *GetMemo(unsigned index) anope_abstract; @@ -148,3 +147,6 @@ namespace MemoServ static Serialize::TypeReference<Ignore> ignore("MemoIgnore"); } + +template<> struct EventName<MemoServ::Event::MemoSend> { static constexpr const char *const name = "OnMemoSend"; }; +template<> struct EventName<MemoServ::Event::MemoDel> { static constexpr const char *const name = "OnMemoDel"; }; |
