+ /** Registers an xline factory.
+ * An xline factory is a class which when given a particular xline type,
+ * will generate a new XLine specialized to that type. For example if you
+ * pass the XLineFactory that handles G-lines some data it will return a
+ * pointer to a GLine, polymorphically represented as XLine. This is used where
+ * you do not know the full details of the item you wish to create, e.g. in a
+ * server protocol module like m_spanningtree, when you receive xlines from other
+ * servers.
+ * @param xlf XLineFactory pointer to register
+ */
+ bool RegisterFactory(XLineFactory* xlf);
+
+ /** Unregisters an xline factory.
+ * You must do this when your module unloads.
+ * @param xlf XLineFactory pointer to unregister
+ */
+ bool UnregisterFactory(XLineFactory* xlf);
+
+ /** Get the XLineFactory for a specific type.
+ * Returns NULL if there is no known handler for this xline type.
+ * @param type The type of XLine you require the XLineFactory for
+ */
+ XLineFactory* GetFactory(const std::string &type);
+
+ /** Check if a user matches an XLine
+ * @param type The type of line to look up
+ * @param user The user to match against (what is checked is specific to the xline type)
+ * @return The reason for the line if there is a match, or NULL if there is no match
+ */
+ XLine* MatchesLine(const std::string &type, User* user);
+
+ /** Check if a pattern matches an XLine
+ * @param type The type of line to look up
+ * @param pattern A pattern string specific to the xline type
+ * @return The matching XLine if there is a match, or NULL if there is no match
+ */
+ XLine* MatchesLine(const std::string &type, const std::string &pattern);
+
+ /** Expire a line given two iterators which identify it in the main map.
+ * @param container Iterator to the first level of entries the map
+ * @param item Iterator to the second level of entries in the map
+ * @param silent If true, doesn't send an expiry SNOTICE.
+ */
+ void ExpireLine(ContainerIter container, LookupIter item, bool silent = false);
+
+ /** Apply any new lines that are pending to be applied.
+ * This will only apply lines in the pending_lines list, to save on
+ * CPU time.
+ */
+ void ApplyLines();
+
+ /** DEPRECATED: use the `bool InvokeStats(const std::string&, Stats::Context&)` overload instead. */
+ DEPRECATED_METHOD(void InvokeStats(const std::string& type, unsigned int numeric, Stats::Context& stats));
+
+ /** Generates a /STATS response for the given X-line type.
+ * @param type The type of X-line to look up.
+ * @param context The stats context to respond with.
+ * @return True if a response was sent; otherwise, false.
+ */
+ bool InvokeStats(const std::string& type, Stats::Context& context);
+
+ /** Expire X-lines which were added by the server configuration and have been removed. */
+ void ExpireRemovedConfigLines(const std::string& type, const insp::flat_set<std::string>& configlines);
+};