diff options
author | Adam <Adam@anope.org> | 2017-02-07 17:20:07 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-02-07 17:20:07 -0500 |
commit | 09dca29c8898916772c2a2a6b86b625c812007ed (patch) | |
tree | 1b28f4751feec3ea2b46fa0afb061da7926f3a47 /include/serialize.h | |
parent | 8b694bc392c36551e428b84454efb81cdbc8bcd3 (diff) |
Normalize databases by not allowing generic Object references
Remove redis database support
Diffstat (limited to 'include/serialize.h')
-rw-r--r-- | include/serialize.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/include/serialize.h b/include/serialize.h index 90aedc7ae..10ec14d16 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -41,11 +41,9 @@ namespace Serialize template<typename T, typename> class Type; template<typename T> class Reference; - // by id - extern std::unordered_map<ID, Object *> objects; extern std::vector<FieldBase *> serializableFields; - extern Object *GetID(ID id); + extern Object *GetID(Serialize::TypeBase *type, ID id); template<typename T> inline T GetObject(); @@ -240,7 +238,6 @@ class CoreExport Serialize::TypeBase : public Service std::set<Object *> objects; TypeBase(Module *owner, const Anope::string &n); - ~TypeBase(); void Unregister(); @@ -292,7 +289,7 @@ class Serialize::Type : public Base T* RequireID(ID id) { - Object *s = Serialize::GetID(id); + Object *s = Serialize::GetID(this, id); if (s == nullptr) return new T(this, id); @@ -353,7 +350,7 @@ class Serialize::Reference if (!valid) return nullptr; - Object *targ = GetID(id); + Object *targ = GetID(type, id); if (targ != nullptr && targ->GetSerializableType() == type) return anope_dynamic_static_cast<T*>(targ); |