lib: add internal object pool API and use it; adapt plugins/tests
[babeltrace.git] / include / babeltrace / ctf-ir / event-class-internal.h
index 4836ec368292ab27b3d581faf50096e1b1abbc33..316408d84ae1592633dd9b6306d4f1c3c8107229 100644 (file)
@@ -38,6 +38,7 @@
 #include <babeltrace/ctf-ir/event-class.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/assert-internal.h>
+#include <babeltrace/object-pool-internal.h>
 #include <glib.h>
 
 struct bt_event_class_common {
@@ -63,6 +64,9 @@ struct bt_event_class_common {
 
 struct bt_event_class {
        struct bt_event_class_common common;
+
+       /* Pool of `struct bt_event *` */
+       struct bt_object_pool event_pool;
 };
 
 BT_HIDDEN
@@ -83,14 +87,6 @@ struct bt_stream_class_common *bt_event_class_common_borrow_stream_class(
        return (void *) bt_object_borrow_parent(event_class);
 }
 
-static inline
-struct bt_stream_class *bt_event_class_borrow_stream_class(
-               struct bt_event_class *event_class)
-{
-       return BT_FROM_COMMON(bt_event_class_common_borrow_stream_class(
-               BT_TO_COMMON(event_class)));
-}
-
 typedef struct bt_field_type_common *(*bt_field_type_structure_create_func)();
 
 BT_HIDDEN
@@ -106,6 +102,10 @@ int bt_event_class_common_validate_single_clock_class(
                struct bt_event_class_common *event_class,
                struct bt_clock_class **expected_clock_class);
 
+BT_HIDDEN
+int bt_event_class_update_event_pool_clock_values(
+               struct bt_event_class *event_class);
+
 static inline
 const char *bt_event_class_common_get_name(
                struct bt_event_class_common *event_class)
@@ -295,7 +295,7 @@ end:
 }
 
 static inline
-struct bt_field_type_common *bt_event_class_common_get_context_field_type(
+struct bt_field_type_common *bt_event_class_common_borrow_context_field_type(
                struct bt_event_class_common *event_class)
 {
        struct bt_field_type_common *context_ft = NULL;
@@ -310,7 +310,7 @@ struct bt_field_type_common *bt_event_class_common_get_context_field_type(
                goto end;
        }
 
-       context_ft = bt_get(event_class->context_field_type);
+       context_ft = event_class->context_field_type;
 
 end:
        return context_ft;
@@ -364,11 +364,11 @@ end:
 }
 
 static inline
-struct bt_field_type_common *bt_event_class_common_get_payload_field_type(
+struct bt_field_type_common *bt_event_class_common_borrow_payload_field_type(
                struct bt_event_class_common *event_class)
 {
        BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
-       return bt_get(event_class->payload_field_type);
+       return event_class->payload_field_type;
 }
 
 static inline
This page took 0.026355 seconds and 4 git commands to generate.