Make API CTF-agnostic
[babeltrace.git] / include / babeltrace / ctf-ir / event-class-internal.h
index 1c6a9a6c4e667af8829deeee9b1be1dfce3e10b6..8fa2ba087c929ee42fbdc4526fd2e48b6b9e7cd1 100644 (file)
  * 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 */
This page took 0.027399 seconds and 4 git commands to generate.