summaryrefslogtreecommitdiff
path: root/include/modules/operserv/session.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
committerAdam <Adam@anope.org>2016-07-28 21:29:35 -0400
commit0e758a2ac23dc4a001e8e126cec14588da9a9769 (patch)
tree45df813323e023c5c89db7279426c4ad0943b4a9 /include/modules/operserv/session.h
parenta3c8afae00c54d5b95c620248b51f90679d7d53f (diff)
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
Diffstat (limited to 'include/modules/operserv/session.h')
-rw-r--r--include/modules/operserv/session.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/modules/operserv/session.h b/include/modules/operserv/session.h
index b9afd196e..1afa9e48a 100644
--- a/include/modules/operserv/session.h
+++ b/include/modules/operserv/session.h
@@ -16,6 +16,7 @@ class Exception : public Serialize::Object
using Serialize::Object::Object;
public:
+ static constexpr const char *NAME = "exception";
virtual Anope::string GetMask() anope_abstract;
virtual void SetMask(const Anope::string &) anope_abstract;
@@ -36,14 +37,14 @@ class Exception : public Serialize::Object
virtual void SetExpires(const time_t &) anope_abstract;
};
-static Serialize::TypeReference<Exception> exception("Exception");
-
class SessionService : public Service
{
public:
+ static constexpr const char *NAME = "session";
+
typedef std::unordered_map<cidr, Session *, cidr::hash> SessionMap;
- SessionService(Module *m) : Service(m, "SessionService", "session") { }
+ SessionService(Module *m) : Service(m, NAME) { }
virtual Exception *FindException(User *u) anope_abstract;
@@ -54,12 +55,14 @@ class SessionService : public Service
virtual SessionMap &GetSessions() anope_abstract;
};
-static ServiceReference<SessionService> session_service("SessionService", "session");
-
namespace Event
{
struct CoreExport Exception : Events
{
+ static constexpr const char *NAME = "exception";
+
+ using Events::Events;
+
/** Called after an exception has been added
* @param ex The exception
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
@@ -74,4 +77,3 @@ namespace Event
};
}
-template<> struct EventName<Event::Exception> { static constexpr const char *const name = "Exception"; };