CTF writer: use own `bt_ctf_object` and `bt_ctf_value` internal APIs
[babeltrace.git] / include / babeltrace / ctf-writer / stream.h
index f8ad7b835b600e18755bee789af89066663cb9b9..bc368f4e435ea73e84873adeb54620600c8fb61f 100644 (file)
@@ -2,8 +2,6 @@
 #define BABELTRACE_CTF_WRITER_STREAM_H
 
 /*
- * BabelTrace - CTF Writer: Stream
- *
  * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
  * http://www.efficios.com/ctf
  */
 
-#include <babeltrace/ctf-ir/stream.h>
-#include <babeltrace/ctf-writer/stream-class.h>
+#include <stdint.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct bt_ctf_stream;
+struct bt_ctf_event;
+
 /*
  * bt_ctf_stream_get_discarded_events_count: get the number of discarded
  * events associated with this stream.
@@ -152,24 +152,33 @@ extern int bt_ctf_stream_set_packet_context(
  */
 extern int bt_ctf_stream_flush(struct bt_ctf_stream *stream);
 
-/*
- * bt_ctf_stream_get and bt_ctf_stream_put: increment and decrement the
- * stream's reference count.
- *
- * You may also use bt_ctf_get() and bt_ctf_put() with stream objects.
- *
- * These functions ensure that the stream won't be destroyed while it
- * is in use. The same number of get and put (plus one extra put to
- * release the initial reference done at creation) have to be done to
- * destroy a stream.
- *
- * When the stream's reference count is decremented to 0 by a
- * bt_ctf_stream_put, the stream is freed.
- *
- * @param stream Stream instance.
- */
-extern void bt_ctf_stream_get(struct bt_ctf_stream *stream);
-extern void bt_ctf_stream_put(struct bt_ctf_stream *stream);
+extern int bt_ctf_stream_is_writer(struct bt_ctf_stream *stream);
+
+extern
+struct bt_ctf_stream *bt_ctf_stream_create(
+               struct bt_ctf_stream_class *stream_class,
+               const char *name, uint64_t id);
+
+extern struct bt_ctf_stream_class *bt_ctf_stream_get_class(
+               struct bt_ctf_stream *stream);
+
+extern const char *bt_ctf_stream_get_name(struct bt_ctf_stream *stream);
+
+extern int64_t bt_ctf_stream_get_id(struct bt_ctf_stream *stream);
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_stream_get(struct bt_ctf_stream *stream)
+{
+       bt_ctf_object_get_ref(stream);
+}
+
+/* Pre-2.0 CTF writer compatibility */
+static inline
+void bt_ctf_stream_put(struct bt_ctf_stream *stream)
+{
+       bt_ctf_object_put_ref(stream);
+}
 
 #ifdef __cplusplus
 }
This page took 0.024046 seconds and 4 git commands to generate.