Commit | Line | Data |
---|---|---|
273b65be | 1 | /* |
0235b0db MJ |
2 | * SPDX-License-Identifier: MIT |
3 | * | |
e2f7325d | 4 | * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com> |
de9dd397 | 5 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
273b65be JG |
6 | */ |
7 | ||
ae2be88d SM |
8 | #ifndef BABELTRACE_LIB_TRACE_IR_STREAM_H |
9 | #define BABELTRACE_LIB_TRACE_IR_STREAM_H | |
0235b0db | 10 | |
3fadfbc0 | 11 | #include <babeltrace2/trace-ir/stream.h> |
578e048b MJ |
12 | #include "lib/object.h" |
13 | #include "lib/object-pool.h" | |
273b65be | 14 | #include <glib.h> |
c4f23e30 | 15 | #include <stdbool.h> |
273b65be | 16 | |
3dca2276 | 17 | struct bt_stream_class; |
cb6f1f7d | 18 | struct bt_stream; |
3230ee6b | 19 | |
cb6f1f7d | 20 | struct bt_stream { |
83509119 | 21 | struct bt_object base; |
44c440bc | 22 | |
c6962c96 PP |
23 | /* Owned by this */ |
24 | struct bt_value *user_attributes; | |
25 | ||
862ca4ed | 26 | /* Owned by this */ |
44c440bc PP |
27 | struct bt_stream_class *class; |
28 | ||
b91e0631 | 29 | gchar *name; |
44c440bc PP |
30 | |
31 | uint64_t id; | |
312c056a PP |
32 | |
33 | /* Pool of `struct bt_packet *` */ | |
34 | struct bt_object_pool packet_pool; | |
44c440bc PP |
35 | |
36 | bool frozen; | |
3dca2276 PP |
37 | }; |
38 | ||
40f4ba76 | 39 | void _bt_stream_freeze(const struct bt_stream *stream); |
44c440bc PP |
40 | |
41 | #ifdef BT_DEV_MODE | |
42 | # define bt_stream_freeze _bt_stream_freeze | |
43 | #else | |
44 | # define bt_stream_freeze(_stream) | |
45 | #endif | |
46 | ||
862ca4ed PP |
47 | static inline |
48 | struct bt_trace *bt_stream_borrow_trace_inline(const struct bt_stream *stream) | |
49 | { | |
98b15851 | 50 | BT_ASSERT_DBG(stream); |
862ca4ed PP |
51 | return (void *) bt_object_borrow_parent(&stream->base); |
52 | } | |
53 | ||
ae2be88d | 54 | #endif /* BABELTRACE_LIB_TRACE_IR_STREAM_H */ |