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_CLASS_INTERNAL_H |
9 | #define BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H | |
10 | ||
578e048b | 11 | #include "common/assert.h" |
3fadfbc0 | 12 | #include <babeltrace2/trace-ir/stream-class.h> |
578e048b MJ |
13 | #include "lib/object.h" |
14 | #include "lib/object-pool.h" | |
273b65be | 15 | #include <glib.h> |
c4f23e30 | 16 | #include <stdbool.h> |
273b65be | 17 | |
578e048b | 18 | #include "field-class.h" |
578e048b | 19 | |
cb6f1f7d | 20 | struct bt_stream_class { |
83509119 | 21 | struct bt_object base; |
3dca2276 | 22 | |
c6962c96 PP |
23 | /* Owned by this */ |
24 | struct bt_value *user_attributes; | |
25 | ||
44c440bc PP |
26 | struct { |
27 | GString *str; | |
28 | ||
29 | /* NULL or `str->str` above */ | |
30 | const char *value; | |
31 | } name; | |
32 | ||
33 | uint64_t id; | |
34 | bool assigns_automatic_event_class_id; | |
35 | bool assigns_automatic_stream_id; | |
26fc5aed | 36 | bool supports_packets; |
9b24b6aa PP |
37 | bool packets_have_beginning_default_clock_snapshot; |
38 | bool packets_have_end_default_clock_snapshot; | |
2e90378a PP |
39 | bool supports_discarded_events; |
40 | bool supports_discarded_packets; | |
41 | bool discarded_events_have_default_clock_snapshots; | |
42 | bool discarded_packets_have_default_clock_snapshots; | |
5cd6d0e5 | 43 | struct bt_field_class *packet_context_fc; |
5cd6d0e5 | 44 | struct bt_field_class *event_common_context_fc; |
44c440bc PP |
45 | struct bt_clock_class *default_clock_class; |
46 | ||
47 | /* Array of `struct bt_event_class *` */ | |
3dca2276 PP |
48 | GPtrArray *event_classes; |
49 | ||
312c056a PP |
50 | /* Pool of `struct bt_field_wrapper *` */ |
51 | struct bt_object_pool packet_context_field_pool; | |
5ca83563 | 52 | |
44c440bc PP |
53 | bool frozen; |
54 | }; | |
3dca2276 | 55 | |
40f4ba76 | 56 | void _bt_stream_class_freeze(const struct bt_stream_class *stream_class); |
2a3ced3c | 57 | |
44c440bc PP |
58 | #ifdef BT_DEV_MODE |
59 | # define bt_stream_class_freeze _bt_stream_class_freeze | |
60 | #else | |
61 | # define bt_stream_class_freeze(_sc) | |
62 | #endif | |
3dca2276 PP |
63 | |
64 | static inline | |
862ca4ed | 65 | struct bt_trace_class *bt_stream_class_borrow_trace_class_inline( |
40f4ba76 | 66 | const struct bt_stream_class *stream_class) |
dc3fffef | 67 | { |
98b15851 | 68 | BT_ASSERT_DBG(stream_class); |
44c440bc | 69 | return (void *) bt_object_borrow_parent(&stream_class->base); |
3dca2276 PP |
70 | } |
71 | ||
56e18c4c | 72 | #endif /* BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H */ |