+namespace details {
+/*
+ * Register types to be overriden. For example, a TSDL-safe copy of a type can
+ * be added to be overriden whenever the original type is encountered.
+ *
+ * Note that this class assumes no ownership of the original types. It assumes
+ * that the original types live as long as the original trace.
+ */
+class type_overrider {
+public:
+ type_overrider() = default;
+
+ void publish(const lttng::sessiond::trace::type& original,
+ lttng::sessiond::trace::type::cuptr new_type_override);
+ const lttng::sessiond::trace::type& type(
+ const lttng::sessiond::trace::type& original) const noexcept;
+
+private:
+ std::unordered_map<const lttng::sessiond::trace::type *, lttng::sessiond::trace::type::cuptr>
+ _overriden_types;
+};
+} /* namespace details. */
+
+/*
+ * TSDL-producing trace class visitor.
+ *
+ * An instance of this class must not be used on multiple trace class instances.
+ * The `append_metadata` callback is automatically invoked when a coherent
+ * fragment of TSDL is available.
+ */