* SOFTWARE.
*/
+#include <babeltrace/assert-pre-internal.h>
#include <babeltrace/ctf-ir/field-types.h>
#include <babeltrace/ctf-ir/fields.h>
#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/values.h>
-#include <babeltrace/ctf/types.h>
+#include <babeltrace/ctf-ir/trace-internal.h>
#include <babeltrace/ctf-ir/stream-class.h>
#include <babeltrace/ctf-ir/stream.h>
+#include <babeltrace/ctf-ir/event-class.h>
#include <babeltrace/object-internal.h>
+#include <babeltrace/assert-internal.h>
+#include <babeltrace/object-pool-internal.h>
+#include <babeltrace/property-internal.h>
#include <glib.h>
+#include <stdbool.h>
-#define BT_CTF_EVENT_CLASS_ATTR_ID_INDEX 0
-#define BT_CTF_EVENT_CLASS_ATTR_NAME_INDEX 1
-
-struct bt_ctf_event_class {
+struct bt_event_class {
struct bt_object base;
- struct bt_value *attributes;
- /* Structure type containing the event's context */
- struct bt_ctf_field_type *context;
- /* Structure type containing the event's fields */
- struct bt_ctf_field_type *fields;
- int frozen;
+ struct bt_field_type *specific_context_ft;
+ struct bt_field_type *payload_ft;
- /*
- * This flag indicates if the event class is valid. A valid
- * event class is _always_ frozen. However, an event class
- * may be frozen, but not valid yet. This is okay, as long as
- * no events are created out of this event class.
- */
- int valid;
-};
+ struct {
+ GString *str;
-BT_HIDDEN
-void bt_ctf_event_class_freeze(struct bt_ctf_event_class *event_class);
+ /* NULL or `str->str` above */
+ const char *value;
+ } name;
-BT_HIDDEN
-int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class,
- struct metadata_context *context);
+ uint64_t id;
+ struct bt_property_uint log_level;
-BT_HIDDEN
-void bt_ctf_event_class_set_native_byte_order(
- struct bt_ctf_event_class *event_class,
- int byte_order);
+ struct {
+ GString *str;
+
+ /* NULL or `str->str` above */
+ const char *value;
+ } emf_uri;
+
+ /* Pool of `struct bt_event *` */
+ struct bt_object_pool event_pool;
+
+ bool frozen;
+};
BT_HIDDEN
-int bt_ctf_event_class_set_stream_id(struct bt_ctf_event_class *event_class,
- uint32_t stream_id);
+void _bt_event_class_freeze(struct bt_event_class *event_class);
+
+#ifdef BT_DEV_MODE
+# define bt_event_class_freeze _bt_event_class_freeze
+#else
+# define bt_event_class_freeze(_ec)
+#endif
+
+static inline
+struct bt_stream_class *bt_event_class_borrow_stream_class_inline(
+ struct bt_event_class *event_class)
+{
+ BT_ASSERT(event_class);
+ return (void *) bt_object_borrow_parent(&event_class->base);
+}
#endif /* BABELTRACE_CTF_IR_EVENT_CLASS_INTERNAL_H */