ir: add bt_ctf_trace_get_stream_class_by_id()
[babeltrace.git] / include / babeltrace / ctf-ir / ref.h
index fa612ca0a9ed33174952dce36a2c5e0f36b12b76..acc89d175b6ddda805cb5f686cea04ff8cb6fe8c 100644 (file)
                (_obj) = NULL;          \
        } while (0)
 
+/*
+ * BT_CTF_MOVE: moves the ownership of a CTF object, setting the old
+ *     owner to NULL.
+ *
+ * This macro sets the variable _dst to the value of the variable _src,
+ * then sets _src to NULL, effectively moving the ownership of a CTF
+ * object from one variable to the other.
+ *
+ * @param obj CTF IR object.
+ */
+#define BT_CTF_MOVE(_dst, _src)                \
+       do {                            \
+               (_dst) = (_src);        \
+               (_src) = NULL;          \
+       } while (0)
+
 /*
  * bt_ctf_get: increments the reference count of a CTF IR object.
  *
This page took 0.022978 seconds and 4 git commands to generate.