Use bt_stream_class_set_name() and bt_stream_class_get_name().
</dd>
+ <dt>
+ \anchor api-tir-stream-cls-prop-uid
+ \bt_dt_opt UID
+ (only available when the parent \bt_trace_cls was created
+ from a \bt_comp which belongs to a trace processing \bt_graph
+ with the effective \bt_mip version 1)
+ </dt>
+ <dd>
+ <a href="https://en.wikipedia.org/wiki/Unique_identifier">Unique identifier</a>
+ (UID) of the stream class.
+
+ Use bt_stream_class_set_uid() and
+ bt_stream_class_get_uid().
+ </dd>
+
<dt>
\anchor api-tir-stream-cls-prop-def-clock-cls
\bt_dt_opt Default clock class
<tr>
<td>\ref api-tir-stream-cls-prop-name "Name"
<td>\em None
+ <tr>
+ <td>\bt_mip version 1: \ref api-tir-stream-cls-prop-uid "UID"
+ <td>\em None
<tr>
<td>\ref api-tir-stream-cls-prop-def-clock-cls "Default clock class"
<td>\em None
<tr>
<td>\ref api-tir-stream-cls-prop-name "Name"
<td>\em None
+ <tr>
+ <td>\bt_mip version 1: \ref api-tir-stream-cls-prop-uid "UID"
+ <td>\em None
<tr>
<td>\ref api-tir-stream-cls-prop-def-clock-cls "Default clock class"
<td>\em None
extern const char *bt_stream_class_get_name(
const bt_stream_class *stream_class) __BT_NOEXCEPT;
+/*!
+@brief
+ Status codes for bt_stream_class_set_uid().
+*/
+typedef enum bt_stream_class_set_uid_status {
+ /*!
+ @brief
+ Success.
+ */
+ BT_STREAM_CLASS_SET_UID_STATUS_OK = __BT_FUNC_STATUS_OK,
+
+ /*!
+ @brief
+ Out of memory.
+ */
+ BT_STREAM_CLASS_SET_UID_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
+} bt_stream_class_set_uid_status;
+
+/*!
+@brief
+ Sets the
+ <a href="https://en.wikipedia.org/wiki/Unique_identifier">unique identifier</a> (UID)
+ of the stream class \bt_p{stream_class} to
+ a copy of \bt_p{uid}.
+
+See the \ref api-tir-stream-cls-prop-uid "UID" property.
+
+@param[in] stream_class
+ Stream class of which to set the UID to \bt_p{uid}.
+@param[in] name
+ New UID of \bt_p{stream_class} (copied).
+
+@retval #BT_STREAM_CLASS_SET_UID_STATUS_OK
+ Success.
+@retval #BT_STREAM_CLASS_SET_UID_STATUS_MEMORY_ERROR
+ Out of memory.
+
+@bt_pre_not_null{stream_class}
+@bt_pre_hot{stream_class}
+@bt_pre_stream_cls_with_mip{stream_class, 1}
+@bt_pre_not_null{uid}
+
+@sa bt_stream_class_get_uid() —
+ Returns the UID of a stream class.
+*/
+extern bt_stream_class_set_uid_status bt_stream_class_set_uid(
+ bt_stream_class *stream_class, const char *uid) __BT_NOEXCEPT;
+
+/*!
+@brief
+ Returns the UID of the stream class \bt_p{stream_class}.
+
+See the \ref api-tir-stream-cls-prop-uid "UID" property.
+
+If \bt_p{stream_class} has no UID, this function returns \c NULL.
+
+@param[in] stream_class
+ Stream class of which to get the UID.
+
+@returns
+ @parblock
+ UID of \bt_p{stream_class}, or \c NULL if none.
+
+ The returned pointer remains valid as long as \bt_p{stream_class}
+ is not modified.
+ @endparblock
+
+@bt_pre_not_null{stream_class}
+@bt_pre_stream_cls_with_mip{stream_class, 1}
+
+@sa bt_stream_class_set_uid() —
+ Sets the UID of a stream class.
+*/
+extern const char *bt_stream_class_get_uid(
+ const bt_stream_class *stream_class) __BT_NOEXCEPT;
+
/*!
@brief
Status codes for bt_stream_class_set_default_clock_class().
g_free(stream_class->ns);
g_free(stream_class->name);
+ g_free(stream_class->uid);
BT_LOGD_STR("Putting packet context field class.");
BT_OBJECT_PUT_REF_AND_RESET(stream_class->packet_context_fc);
BT_LOGD_STR("Putting event common context field class.");
return BT_FUNC_STATUS_OK;
}
+BT_EXPORT
+const char *bt_stream_class_get_uid(const struct bt_stream_class *stream_class)
+{
+ BT_ASSERT_PRE_DEV_SC_NON_NULL(stream_class);
+ BT_ASSERT_PRE_SC_MIP_VERSION_GE(stream_class, 1);
+ return stream_class->uid;
+}
+
+BT_EXPORT
+enum bt_stream_class_set_uid_status bt_stream_class_set_uid(
+ struct bt_stream_class *stream_class,
+ const char *uid)
+{
+ BT_ASSERT_PRE_NO_ERROR();
+ BT_ASSERT_PRE_SC_NON_NULL(stream_class);
+ BT_ASSERT_PRE_NAME_NON_NULL(uid);
+ BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
+ BT_ASSERT_PRE_SC_MIP_VERSION_GE(stream_class, 1);
+ g_free(stream_class->uid);
+ stream_class->uid = g_strdup(uid);
+ BT_LIB_LOGD("Set stream class's UID: %!+S", stream_class);
+ return BT_FUNC_STATUS_OK;
+}
+
BT_EXPORT
uint64_t bt_stream_class_get_id(const struct bt_stream_class *stream_class)
{