+ /** Types of Extensible that an ExtensionItem can apply to. */
+ enum ExtensibleType
+ {
+ /** The ExtensionItem applies to a User object. */
+ EXT_USER,
+
+ /** The ExtensionItem applies to a Channel object. */
+ EXT_CHANNEL,
+
+ /** The ExtensionItem applies to a Membership object. */
+ EXT_MEMBERSHIP
+ };
+
+ /** The type of Extensible that this ExtensionItem applies to. */
+ const ExtensibleType type;
+
+ /** Initializes an instance of the ExtensionItem class.
+ * @param key The name of the extension item (e.g. ssl_cert).
+ * @param exttype The type of Extensible that this ExtensionItem applies to.
+ * @param owner The module which created this ExtensionItem.
+ */
+ ExtensionItem(const std::string& key, ExtensibleType exttype, Module* owner);
+
+ /** Destroys an instance of the ExtensionItem class. */
+ virtual ~ExtensionItem();
+
+ /** Sets an ExtensionItem using a value in the internal format.
+ * @param container A container the ExtensionItem should be set on.
+ * @param value A value in the internal format.
+ */
+ virtual void FromInternal(Extensible* container, const std::string& value);
+
+ /** Sets an ExtensionItem using a value in the network format.
+ * @param container A container the ExtensionItem should be set on.
+ * @param value A value in the network format.
+ */
+ virtual void FromNetwork(Extensible* container, const std::string& value);
+
+ /** Gets an ExtensionItem's value in a human-readable format.
+ * @param container The container the ExtensionItem is set on.
+ * @param item The value to convert to a human-readable format.
+ * @return The value specified in \p item in a human readable format.
+ */
+ virtual std::string ToHuman(const Extensible* container, void* item) const;
+ /** Gets an ExtensionItem's value in the internal format.
+ * @param container The container the ExtensionItem is set on.
+ * @param item The value to convert to the internal format.
+ * @return The value specified in \p item in the internal format.
+ */
+ virtual std::string ToInternal(const Extensible* container, void* item) const ;
+
+ /** Gets an ExtensionItem's value in the network format.
+ * @param container The container the ExtensionItem is set on.
+ * @param item The value to convert to the network format.
+ * @return The value specified in \p item in the network format.
+ */
+ virtual std::string ToNetwork(const Extensible* container, void* item) const;
+
+ /** Deallocates the specified ExtensionItem value.
+ * @param container The container that the ExtensionItem is set on.
+ * @param item The item to deallocate.
+ */
+ virtual void free(Extensible* container, void* item) = 0;
+
+ /** Registers this object with the ExtensionManager. */
+ void RegisterService() CXX11_OVERRIDE;
+
+ /** DEPRECATED: use To{Human,Internal,Network} instead. */
+ DEPRECATED_METHOD(virtual std::string serialize(SerializeFormat format, const Extensible* container, void* item) const);
+
+ /** DEPRECATED: use From{Internal,Network} instead. */
+ DEPRECATED_METHOD(virtual void unserialize(SerializeFormat format, Extensible* container, const std::string& value));