summaryrefslogtreecommitdiff
path: root/include/extensible.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/extensible.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/extensible.h')
-rw-r--r--include/extensible.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/extensible.h b/include/extensible.h
index 4faff818b..35e051173 100644
--- a/include/extensible.h
+++ b/include/extensible.h
@@ -22,10 +22,11 @@ class CoreExport ExtensibleBase : public Service
ExtensibleBase(Module *m, const Anope::string &n);
ExtensibleBase(Module *m, const Anope::string &t, const Anope::string &n);
- ~ExtensibleBase();
public:
virtual void Unset(Extensible *obj) anope_abstract;
+
+ static constexpr const char *NAME = "Extensible";
};
class CoreExport Extensible
@@ -40,7 +41,7 @@ class CoreExport Extensible
template<typename T> T* Extend(const Anope::string &name, const T &what);
- template<typename T> void ShrinkOK(const Anope::string &name);
+ template<typename T> void Shrink(const Anope::string &name);
};
template<typename T>
@@ -116,8 +117,7 @@ class ExtensibleItem : public ExtensibleBase
template<typename T>
struct ExtensibleRef : ServiceReference<ExtensibleItem<T>>
{
- ExtensibleRef(const Anope::string &n) : ServiceReference<ExtensibleItem<T>>("Extensible", n) { }
- ExtensibleRef(const Anope::string &t, const Anope::string &n) : ServiceReference<ExtensibleItem<T>>(t, n) { }
+ ExtensibleRef(const Anope::string &n) : ServiceReference<ExtensibleItem<T>>(n) { }
};
template<typename T>
@@ -146,8 +146,7 @@ T* Extensible::Extend(const Anope::string &name, const T &what)
}
template<typename T>
-//XXX
-void Extensible::ShrinkOK(const Anope::string &name)
+void Extensible::Shrink(const Anope::string &name)
{
ExtensibleRef<T> ref(name);
if (ref)