lib: use object pool for event and packet notifications
[babeltrace.git] / include / babeltrace / graph / notification-discarded-elements-internal.h
index 1a339ab0c9123ec3c8a3b1078651a9c141efe222..c5d1f0eaa5a9b52438ca8786fa4cff5eb97e2fe5 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_DISCARDED_ELEMENTS_INTERNAL_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_DISCARDED_ELEMENTS_INTERNAL_H
+#ifndef BABELTRACE_GRAPH_NOTIFICATION_DISCARDED_ELEMENTS_INTERNAL_H
+#define BABELTRACE_GRAPH_NOTIFICATION_DISCARDED_ELEMENTS_INTERNAL_H
 
 /*
  * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
 
 #include <glib.h>
 #include <stdint.h>
+#include <babeltrace/assert-internal.h>
 #include <babeltrace/compiler-internal.h>
 #include <babeltrace/graph/notification.h>
 #include <babeltrace/graph/notification-internal.h>
 
 struct bt_clock_class_priority_map;
-struct bt_ctf_stream;
+struct bt_stream;
 
 struct bt_notification_discarded_elements {
        struct bt_notification parent;
-       struct bt_ctf_stream *stream;
-       struct bt_ctf_clock_value *begin_clock_value;
-       struct bt_ctf_clock_value *end_clock_value;
+       struct bt_stream *stream;
+       struct bt_clock_value *begin_clock_value;
+       struct bt_clock_value *end_clock_value;
        int64_t count;
 };
 
 BT_HIDDEN
 struct bt_notification *bt_notification_discarded_elements_create(
+               struct bt_graph *graph,
                enum bt_notification_type type,
-               struct bt_ctf_stream *stream,
-               struct bt_ctf_clock_value *begin_clock_value,
-               struct bt_ctf_clock_value *end_clock_value,
+               struct bt_stream *stream,
+               struct bt_clock_value *begin_clock_value,
+               struct bt_clock_value *end_clock_value,
                uint64_t count);
 
 BT_HIDDEN
-struct bt_ctf_stream *bt_notification_discarded_elements_get_stream(
+struct bt_stream *bt_notification_discarded_elements_borrow_stream(
                enum bt_notification_type type,
                struct bt_notification *notification);
 
 BT_HIDDEN
-struct bt_ctf_clock_value *
-bt_notification_discarded_elements_get_begin_clock_value(
+struct bt_clock_value *
+bt_notification_discarded_elements_borrow_begin_clock_value(
                enum bt_notification_type type,
                struct bt_notification *notification);
 
 BT_HIDDEN
-struct bt_ctf_clock_value *
-bt_notification_discarded_elements_get_end_clock_value(
+struct bt_clock_value *
+bt_notification_discarded_elements_borrow_end_clock_value(
                enum bt_notification_type type,
                struct bt_notification *notification);
 
@@ -70,16 +72,4 @@ int64_t bt_notification_discarded_elements_get_count(
                enum bt_notification_type type,
                struct bt_notification *notification);
 
-static inline
-struct bt_ctf_stream *bt_notification_discarded_elements_borrow_stream(
-               struct bt_notification *notification)
-{
-       struct bt_notification_discarded_elements *discarded_elems_notif;
-
-       assert(notification);
-       discarded_elems_notif = container_of(notification,
-                       struct bt_notification_discarded_elements, parent);
-       return discarded_elems_notif->stream;
-}
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_DISCARDED_ELEMENTS_INTERNAL_H */
+#endif /* BABELTRACE_GRAPH_NOTIFICATION_DISCARDED_ELEMENTS_INTERNAL_H */
This page took 0.036894 seconds and 4 git commands to generate.