summaryrefslogtreecommitdiff
path: root/src/base.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
committerAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
commit26ac315192e0d8a04d50e910697ab794eedf0cc1 (patch)
treeb9916f14fe35ce5c4de95c4194ca4ea0cb30812f /src/base.cpp
parent0b6476f06ff9ce06545c421143c7d7163c750aa5 (diff)
New event system
Diffstat (limited to 'src/base.cpp')
-rw-r--r--src/base.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/base.cpp b/src/base.cpp
index 1b6a560d7..0fcd868bc 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -11,8 +11,28 @@
#include "anope.h"
#include "service.h"
-std::map<Anope::string, std::map<Anope::string, Service *> > Service::Services;
-std::map<Anope::string, std::map<Anope::string, Anope::string> > Service::Aliases;
+std::map<Anope::string, std::map<Anope::string, Service *> > *Service::Services = NULL;
+std::map<Anope::string, std::map<Anope::string, Anope::string> > *Service::Aliases = NULL;
+std::set<ReferenceBase *> *ReferenceBase::references = NULL;
+
+ReferenceBase::ReferenceBase()
+{
+ if (references == NULL)
+ references = new std::set<ReferenceBase *>();
+ references->insert(this);
+}
+
+ReferenceBase::~ReferenceBase()
+{
+ references->erase(this);
+}
+
+void ReferenceBase::ResetAll()
+{
+ if (references)
+ for (ReferenceBase *b : *references)
+ b->Reset();
+}
Base::Base() : references(NULL)
{