| 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_LIB_TRACE_IR_EVENT_CLASS_H |
| 9 | #define BABELTRACE_LIB_TRACE_IR_EVENT_CLASS_H |
| 10 | |
| 11 | #include <babeltrace2/trace-ir/field-class.h> |
| 12 | #include <babeltrace2/trace-ir/field.h> |
| 13 | #include <babeltrace2/value.h> |
| 14 | #include <babeltrace2/trace-ir/stream-class.h> |
| 15 | #include <babeltrace2/trace-ir/stream.h> |
| 16 | #include <babeltrace2/trace-ir/event-class.h> |
| 17 | #include "lib/object.h" |
| 18 | #include "common/assert.h" |
| 19 | #include "lib/object-pool.h" |
| 20 | #include "lib/property.h" |
| 21 | #include <glib.h> |
| 22 | #include <stdbool.h> |
| 23 | |
| 24 | struct bt_event_class { |
| 25 | struct bt_object base; |
| 26 | struct bt_field_class *specific_context_fc; |
| 27 | struct bt_field_class *payload_fc; |
| 28 | |
| 29 | /* Owned by this */ |
| 30 | struct bt_value *user_attributes; |
| 31 | |
| 32 | gchar *ns; |
| 33 | gchar *name; |
| 34 | gchar *uid; |
| 35 | |
| 36 | uint64_t id; |
| 37 | struct bt_property_uint log_level; |
| 38 | |
| 39 | gchar *emf_uri; |
| 40 | |
| 41 | /* Pool of `struct bt_event *` */ |
| 42 | struct bt_object_pool event_pool; |
| 43 | |
| 44 | bool frozen; |
| 45 | }; |
| 46 | |
| 47 | void _bt_event_class_freeze(const struct bt_event_class *event_class); |
| 48 | |
| 49 | #ifdef BT_DEV_MODE |
| 50 | # define bt_event_class_freeze _bt_event_class_freeze |
| 51 | #else |
| 52 | # define bt_event_class_freeze(_ec) |
| 53 | #endif |
| 54 | |
| 55 | static inline |
| 56 | struct bt_stream_class *bt_event_class_borrow_stream_class_inline( |
| 57 | const struct bt_event_class *event_class) |
| 58 | { |
| 59 | BT_ASSERT_DBG(event_class); |
| 60 | return (void *) bt_object_borrow_parent(&event_class->base); |
| 61 | } |
| 62 | |
| 63 | #endif /* BABELTRACE_LIB_TRACE_IR_EVENT_CLASS_H */ |