Implement CTF-IR event getters
[babeltrace.git] / include / babeltrace / ctf-ir / stream-class.h
index 2e2f3fb93f5678427a652d7774b12203dee4b2d0..d26bc2ca861441745750309e2a2fd6ae052d9a30 100644 (file)
@@ -4,7 +4,7 @@
 /*
  * BabelTrace - CTF IR: Stream Class
  *
- * Copyright 2014 EfficiOS Inc.
+ * Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
@@ -50,6 +50,16 @@ struct bt_ctf_clock;
  */
 extern struct bt_ctf_stream_class *bt_ctf_stream_class_create(const char *name);
 
+/*
+ * bt_ctf_stream_class_get_clock: get the clock associated with a stream class.
+ *
+ * @param stream_class Stream class.
+ *
+ * Returns a clock instance, NULL on error.
+ */
+extern struct bt_ctf_clock *bt_ctf_stream_class_get_clock(
+               struct bt_ctf_stream_class *stream_class);
+
 /*
  * bt_ctf_stream_class_set_clock: assign a clock to a stream class.
  *
@@ -65,6 +75,31 @@ extern int bt_ctf_stream_class_set_clock(
                struct bt_ctf_stream_class *stream_class,
                struct bt_ctf_clock *clock);
 
+/*
+ * bt_ctf_stream_class_get_id: Get a stream class' id.
+ *
+ * @param stream_class Stream class.
+ *
+ * Returns the stream class' id, a negative value on error.
+ */
+extern int64_t bt_ctf_stream_class_get_id(
+               struct bt_ctf_stream_class *stream_class);
+
+/*
+ * bt_ctf_stream_class_set_id: Set a stream class' id.
+ *
+ * Set a stream class' id. Must be unique trace-wise.
+ * Note that stream classes are assigned a unique id when a stream instance
+ * is created for the first time from a trace or writer.
+ *
+ * @param stream_class Stream class.
+ * @param id Stream class id.
+ *
+ * Returns 0 on success, a negative value on error.
+ */
+extern int bt_ctf_stream_class_set_id(
+               struct bt_ctf_stream_class *stream_class, uint32_t id);
+
 /*
  * bt_ctf_stream_class_set_clock: assign a clock to a stream class.
  *
This page took 0.024061 seconds and 4 git commands to generate.