Visibility hidden by default
[babeltrace.git] / src / lib / trace-ir / stream.h
1 /*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
5 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 */
7
8 #ifndef BABELTRACE_TRACE_IR_STREAM_INTERNAL_H
9 #define BABELTRACE_TRACE_IR_STREAM_INTERNAL_H
10
11 #include <babeltrace2/trace-ir/stream.h>
12 #include "lib/object.h"
13 #include "lib/object-pool.h"
14 #include "common/macros.h"
15 #include <glib.h>
16 #include <stdbool.h>
17
18 #include "utils.h"
19
20 struct bt_stream_class;
21 struct bt_stream;
22
23 struct bt_stream {
24 struct bt_object base;
25
26 /* Owned by this */
27 struct bt_value *user_attributes;
28
29 /* Owned by this */
30 struct bt_stream_class *class;
31
32 struct {
33 GString *str;
34
35 /* NULL or `str->str` above */
36 const char *value;
37 } name;
38
39 uint64_t id;
40
41 /* Pool of `struct bt_packet *` */
42 struct bt_object_pool packet_pool;
43
44 bool frozen;
45 };
46
47 void _bt_stream_freeze(const struct bt_stream *stream);
48
49 #ifdef BT_DEV_MODE
50 # define bt_stream_freeze _bt_stream_freeze
51 #else
52 # define bt_stream_freeze(_stream)
53 #endif
54
55 static inline
56 struct bt_trace *bt_stream_borrow_trace_inline(const struct bt_stream *stream)
57 {
58 BT_ASSERT_DBG(stream);
59 return (void *) bt_object_borrow_parent(&stream->base);
60 }
61
62 #endif /* BABELTRACE_TRACE_IR_STREAM_INTERNAL_H */
This page took 0.030667 seconds and 4 git commands to generate.