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 | ||
0235b0db MJ |
8 | #ifndef BABELTRACE_TRACE_IR_STREAM_INTERNAL_H |
9 | #define BABELTRACE_TRACE_IR_STREAM_INTERNAL_H | |
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 | ||
29 | struct { | |
30 | GString *str; | |
31 | ||
32 | /* NULL or `str->str` above */ | |
33 | const char *value; | |
34 | } name; | |
35 | ||
36 | uint64_t id; | |
312c056a PP |
37 | |
38 | /* Pool of `struct bt_packet *` */ | |
39 | struct bt_object_pool packet_pool; | |
44c440bc PP |
40 | |
41 | bool frozen; | |
3dca2276 PP |
42 | }; |
43 | ||
40f4ba76 | 44 | void _bt_stream_freeze(const struct bt_stream *stream); |
44c440bc PP |
45 | |
46 | #ifdef BT_DEV_MODE | |
47 | # define bt_stream_freeze _bt_stream_freeze | |
48 | #else | |
49 | # define bt_stream_freeze(_stream) | |
50 | #endif | |
51 | ||
862ca4ed PP |
52 | static inline |
53 | struct bt_trace *bt_stream_borrow_trace_inline(const struct bt_stream *stream) | |
54 | { | |
98b15851 | 55 | BT_ASSERT_DBG(stream); |
862ca4ed PP |
56 | return (void *) bt_object_borrow_parent(&stream->base); |
57 | } | |
58 | ||
56e18c4c | 59 | #endif /* BABELTRACE_TRACE_IR_STREAM_INTERNAL_H */ |