lib: remove some unnecessary uses of `GString`
[babeltrace.git] / src / lib / trace-ir / stream-class.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_CLASS_INTERNAL_H
9 #define BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H
10
11 #include "common/assert.h"
12 #include <babeltrace2/trace-ir/stream-class.h>
13 #include "lib/object.h"
14 #include "lib/object-pool.h"
15 #include <glib.h>
16 #include <stdbool.h>
17
18 #include "field-class.h"
19
20 struct bt_stream_class {
21 struct bt_object base;
22
23 /* Owned by this */
24 struct bt_value *user_attributes;
25
26 gchar *name;
27
28 uint64_t id;
29 bool assigns_automatic_event_class_id;
30 bool assigns_automatic_stream_id;
31 bool supports_packets;
32 bool packets_have_beginning_default_clock_snapshot;
33 bool packets_have_end_default_clock_snapshot;
34 bool supports_discarded_events;
35 bool supports_discarded_packets;
36 bool discarded_events_have_default_clock_snapshots;
37 bool discarded_packets_have_default_clock_snapshots;
38 struct bt_field_class *packet_context_fc;
39 struct bt_field_class *event_common_context_fc;
40 struct bt_clock_class *default_clock_class;
41
42 /* Array of `struct bt_event_class *` */
43 GPtrArray *event_classes;
44
45 /* Pool of `struct bt_field_wrapper *` */
46 struct bt_object_pool packet_context_field_pool;
47
48 bool frozen;
49 };
50
51 void _bt_stream_class_freeze(const struct bt_stream_class *stream_class);
52
53 #ifdef BT_DEV_MODE
54 # define bt_stream_class_freeze _bt_stream_class_freeze
55 #else
56 # define bt_stream_class_freeze(_sc)
57 #endif
58
59 static inline
60 struct bt_trace_class *bt_stream_class_borrow_trace_class_inline(
61 const struct bt_stream_class *stream_class)
62 {
63 BT_ASSERT_DBG(stream_class);
64 return (void *) bt_object_borrow_parent(&stream_class->base);
65 }
66
67 #endif /* BABELTRACE_TRACE_IR_STREAM_CLASS_INTERNAL_H */
This page took 0.03019 seconds and 4 git commands to generate.