lib: remove CV snapshot property from stream beginning/end message
[babeltrace.git] / lib / graph / message / stream.c
index 46039696e77a0808db23d05f91abb1252e385313..0d6f374c2ab88cec6ed8afda6610c14a3a07b5f0 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <babeltrace/assert-pre-internal.h>
 #include <babeltrace/compiler-internal.h>
+#include <babeltrace/trace-ir/clock-snapshot-const.h>
 #include <babeltrace/trace-ir/stream-internal.h>
 #include <babeltrace/trace-ir/stream-class.h>
 #include <babeltrace/trace-ir/stream-class-internal.h>
@@ -45,12 +46,6 @@ void bt_message_stream_end_destroy(struct bt_object *obj)
                message);
        BT_LIB_LOGD("Putting stream: %!+s", message->stream);
        BT_OBJECT_PUT_REF_AND_RESET(message->stream);
-
-       if (message->default_cv) {
-               bt_clock_value_recycle(message->default_cv);
-               message->default_cv = NULL;
-       }
-
        g_free(message);
 }
 
@@ -106,37 +101,6 @@ const struct bt_stream *bt_message_stream_end_borrow_stream_const(
                (void *) message);
 }
 
-void bt_message_stream_end_set_default_clock_value(
-               struct bt_message *msg, uint64_t value_cycles)
-{
-       struct bt_message_stream_end *se_msg = (void *) msg;
-
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_HOT(msg, "Message", ": %!+n", msg);
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_END);
-       BT_ASSERT_PRE(se_msg->stream->class->default_clock_class,
-               "Message's stream class has no default clock class: "
-               "%![msg-]+n, %![sc-]+S", msg, se_msg->stream->class);
-
-       /* TODO: have the object already created */
-       se_msg->default_cv = bt_clock_value_create(
-               se_msg->stream->class->default_clock_class);
-       BT_ASSERT(se_msg->default_cv);
-       bt_clock_value_set_value_inline(se_msg->default_cv, value_cycles);
-       BT_LIB_LOGV("Set message's default clock value: %![msg-]+n, "
-               "value=%" PRIu64, value_cycles);
-}
-
-struct bt_clock_value *bt_message_stream_end_borrow_default_clock_value(
-               struct bt_message *msg)
-{
-       struct bt_message_stream_end *stream_end = (void *) msg;
-
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_END);
-       return stream_end->default_cv;
-}
-
 static
 void bt_message_stream_beginning_destroy(struct bt_object *obj)
 {
@@ -147,12 +111,6 @@ void bt_message_stream_beginning_destroy(struct bt_object *obj)
                message);
        BT_LIB_LOGD("Putting stream: %!+s", message->stream);
        BT_OBJECT_PUT_REF_AND_RESET(message->stream);
-
-       if (message->default_cv) {
-               bt_clock_value_recycle(message->default_cv);
-               message->default_cv = NULL;
-       }
-
        g_free(message);
 }
 
@@ -206,35 +164,3 @@ const struct bt_stream *bt_message_stream_beginning_borrow_stream_const(
        return bt_message_stream_beginning_borrow_stream(
                (void *) message);
 }
-
-void bt_message_stream_beginning_set_default_clock_value(
-               struct bt_message *msg,
-               uint64_t value_cycles)
-{
-       struct bt_message_stream_beginning *sb_msg = (void *) msg;
-
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_HOT(msg, "Message", ": %!+n", msg);
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_BEGINNING);
-       BT_ASSERT_PRE(sb_msg->stream->class->default_clock_class,
-               "Message's stream class has no default clock class: "
-               "%![msg-]+n, %![sc-]+S", msg, sb_msg->stream->class);
-
-       /* TODO: have the object already created */
-       sb_msg->default_cv = bt_clock_value_create(
-               sb_msg->stream->class->default_clock_class);
-       BT_ASSERT(sb_msg->default_cv);
-       bt_clock_value_set_value_inline(sb_msg->default_cv, value_cycles);
-       BT_LIB_LOGV("Set message's default clock value: %![msg-]+n, "
-               "value=%" PRIu64, value_cycles);
-}
-
-struct bt_clock_value *bt_message_stream_beginning_borrow_default_clock_value(
-               struct bt_message *msg)
-{
-       struct bt_message_stream_beginning *stream_begin = (void *) msg;
-
-       BT_ASSERT_PRE_NON_NULL(msg, "Message");
-       BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_BEGINNING);
-       return stream_begin->default_cv;
-}
This page took 0.024245 seconds and 4 git commands to generate.