Freeze event classes as they are added to a stream class
[babeltrace.git] / include / babeltrace / ctf-ir / stream-class.h
index 71b10679ceac550ed0a1f4f197489daf7300cf3d..bf5f577c3c99140b21f43c694bc13aae3830b91f 100644 (file)
@@ -30,6 +30,8 @@
  * http://www.efficios.com/ctf
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -52,7 +54,12 @@ struct bt_ctf_clock;
  *     - uint64_t packet_size
  *     - uint64_t events_discarded
  *
- * @param name Stream name.
+ * A stream class's event header is a structure initialized the following
+ * fields:
+ *  - uint32_t id
+ *  - uint64_t timestamp
+ *
+ * @param name Stream name, NULL to create an unnamed stream class.
  *
  * Returns an allocated stream class on success, NULL on error.
  */
@@ -68,6 +75,16 @@ extern struct bt_ctf_stream_class *bt_ctf_stream_class_create(const char *name);
 extern const char *bt_ctf_stream_class_get_name(
                struct bt_ctf_stream_class *stream_class);
 
+/*
+ * bt_ctf_stream_class_set_name: Set a stream class' name.
+ *
+ * @param stream_class Stream class.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_stream_class_set_name(
+               struct bt_ctf_stream_class *stream_class, const char *name);
+
 /*
  * bt_ctf_stream_class_get_clock: get the clock associated with a stream class.
  *
@@ -127,6 +144,9 @@ extern int bt_ctf_stream_class_set_id(
  * The stream class will share the ownership of "event_class" by incrementing
  * its reference count.
  *
+ * Note that an event class may only be added to one stream class. It
+ * also becomes immutable.
+ *
  * @param stream_class Stream class.
  * @param event_class Event class to add to the provided stream class.
  *
@@ -194,6 +214,31 @@ extern int bt_ctf_stream_class_set_packet_context_type(
                struct bt_ctf_stream_class *stream_class,
                struct bt_ctf_field_type *packet_context_type);
 
+/*
+ * bt_ctf_stream_class_get_event_header_type: get the stream class'
+ * event header type.
+ *
+ * @param stream_class Stream class.
+ *
+ * Returns the stream event header's type (a structure), NULL on error.
+ */
+extern struct bt_ctf_field_type *
+bt_ctf_stream_class_get_event_header_type(
+               struct bt_ctf_stream_class *stream_class);
+
+/*
+ * bt_ctf_stream_class_set_event_header_type: set the stream class'
+ * event header type.
+ *
+ * @param stream_class Stream class.
+ * @param event_header_type Event header type (must be a structure).
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_stream_class_set_event_header_type(
+               struct bt_ctf_stream_class *stream_class,
+               struct bt_ctf_field_type *event_header_type);
+
 /*
  * bt_ctf_stream_class_get_event_context_type: get the stream class'
  * event context type.
This page took 0.027285 seconds and 4 git commands to generate.