- const std::string key;
- Module* const owner;
- ExtensionItem(const std::string& key, Module* owner);
- /** Serialize this item into a string */
- virtual std::string serialize(Module* requestor, const Extensible* container, void* item) = 0;
- /** Convert the string form back into an item */
- virtual void unserialize(Module* requestor, Extensible* container, const std::string& value) = 0;
+ /** Extensible subclasses
+ */
+ enum ExtensibleType
+ {
+ EXT_USER,
+ EXT_CHANNEL,
+ EXT_MEMBERSHIP
+ };
+
+ /** Type (subclass) of Extensible that this ExtensionItem is valid for
+ */
+ const ExtensibleType type;
+
+ ExtensionItem(const std::string& key, ExtensibleType exttype, Module* owner);
+ virtual ~ExtensionItem();
+ /** Serialize this item into a string
+ *
+ * @param format The format to serialize to
+ * @param container The object containing this item
+ * @param item The item itself
+ */
+ virtual std::string serialize(SerializeFormat format, const Extensible* container, void* item) const = 0;
+ /** Convert the string form back into an item
+ * @param format The format to serialize from (not FORMAT_USER)
+ * @param container The object that this item applies to
+ * @param value The return from a serialize() call that was run elsewhere with this key
+ */
+ virtual void unserialize(SerializeFormat format, Extensible* container, const std::string& value) = 0;