summaryrefslogtreecommitdiff
path: root/src/base.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-08-22 00:34:02 -0400
committerAdam <Adam@anope.org>2010-08-22 00:34:02 -0400
commitada65a3bafd3ae6738a80972cf0d2f31ad19a7ae (patch)
treeafde8d7594adc78beec8feb8090f4a990bd6a56b /src/base.cpp
parent8a4c6ae618f767d2a9335da40f507ddccfc77b4b (diff)
Added a classbase for the major classes, makes dynamic_reference invalidation really work.
This also cleans up a bit of the code in the modestacker.
Diffstat (limited to 'src/base.cpp')
-rw-r--r--src/base.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/base.cpp b/src/base.cpp
new file mode 100644
index 000000000..0aec072a1
--- /dev/null
+++ b/src/base.cpp
@@ -0,0 +1,25 @@
+#include "services.h"
+#include "modules.h"
+
+Base::Base()
+{
+}
+
+Base::~Base()
+{
+ for (std::set<dynamic_reference_base *>::iterator it = this->References.begin(), it_end = this->References.end(); it != it_end; ++it)
+ {
+ (*it)->Invalidate();
+ }
+}
+
+void Base::AddReference(dynamic_reference_base *r)
+{
+ this->References.insert(r);
+}
+
+void Base::DelReference(dynamic_reference_base *r)
+{
+ this->References.erase(r);
+}
+