2 * SPDX-License-Identifier: MIT
4 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
5 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 #define BT_LOG_TAG "LIB/MSG"
9 #include "lib/logging.h"
11 #include "common/assert.h"
12 #include "lib/assert-cond.h"
13 #include <babeltrace2/graph/message.h>
14 #include "lib/graph/message/message.h"
15 #include "lib/graph/graph.h"
18 void bt_message_init(struct bt_message
*message
,
19 enum bt_message_type type
,
20 bt_object_release_func release
,
21 struct bt_graph
*graph
)
24 bt_object_init_shared(&message
->base
, release
);
25 message
->graph
= graph
;
28 bt_graph_add_message(graph
, message
);
32 enum bt_message_type
bt_message_get_type(
33 const struct bt_message
*message
)
35 BT_ASSERT_PRE_DEV_NON_NULL(message
, "Message");
40 void bt_message_unlink_graph(struct bt_message
*msg
)
46 void bt_message_get_ref(const struct bt_message
*message
)
48 bt_object_get_ref(message
);
51 void bt_message_put_ref(const struct bt_message
*message
)
53 bt_object_put_ref(message
);