/*
* InspIRCd -- Internet Relay Chat Daemon
*
+ * Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2012, 2014-2015 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2012 Robby <robby@chatbelgie.be>
* Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* a flags variable, and each module defining bits within the flag as 'theirs' as it is less prone to conflict and
* supports arbitary data storage).
*/
-class CoreExport Extensible : public classbase
+class CoreExport Extensible
+ : public classbase
+ , public Serializable
{
public:
typedef insp::flat_map<reference<ExtensionItem>, void*> ExtensibleStore;
* Free all extension items attached to this Extensible
*/
void FreeAllExtItems();
+
+ /** @copydoc Serializable::Deserialize. */
+ bool Deserialize(Data& data) CXX11_OVERRIDE;
+
+ /** @copydoc Serializable::Deserialize. */
+ bool Serialize(Serializable::Data& data) CXX11_OVERRIDE;
};
class CoreExport ExtensionManager
{
T* ptr = new T(value);
T* old = static_cast<T*>(set_raw(container, ptr));
- Del del;
- del(old);
+ free(container, old);
}
inline void set(Extensible* container, T* value)
{
T* old = static_cast<T*>(set_raw(container, value));
- Del del;
- del(old);
+ free(container, old);
}
inline void unset(Extensible* container)
{
T* old = static_cast<T*>(unset_raw(container));
- Del del;
- del(old);
+ free(container, old);
}
void free(Extensible* container, void* item) CXX11_OVERRIDE