lib: use object pool for event and packet notifications
[babeltrace.git] / include / babeltrace / graph / notification-packet.h
index 94480e6027f720a412144611db44df2b0c37032a..e3c9d55b401e094c5d575497b69a157c050d932c 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H
+#ifndef BABELTRACE_GRAPH_NOTIFICATION_PACKET_H
+#define BABELTRACE_GRAPH_NOTIFICATION_PACKET_H
 
 /*
  * BabelTrace - Plug-in Packet-related Notifications
  * SOFTWARE.
  */
 
-#include <babeltrace/graph/notification.h>
+/* For bt_get() */
+#include <babeltrace/ref.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-struct bt_ctf_packet;
+struct bt_notification;
+struct bt_packet;
 
-extern struct bt_notification *bt_notification_packet_begin_create(
-               struct bt_ctf_packet *packet);
+extern
+struct bt_notification *bt_notification_packet_begin_create(
+               struct bt_graph *graph, struct bt_packet *packet);
 
-extern struct bt_notification *bt_notification_packet_end_create(
-               struct bt_ctf_packet *packet);
+extern
+struct bt_notification *bt_notification_packet_end_create(
+               struct bt_graph *graph, struct bt_packet *packet);
 
-/*** BT_NOTIFICATION_TYPE_PACKET_BEGIN ***/
-extern struct bt_ctf_packet *bt_notification_packet_begin_get_packet(
+
+extern struct bt_packet *bt_notification_packet_begin_borrow_packet(
                struct bt_notification *notification);
 
-/*** BT_NOTIFICATION_TYPE_PACKET_END ***/
-extern struct bt_ctf_packet *bt_notification_packet_end_get_packet(
+static inline
+struct bt_packet *bt_notification_packet_begin_get_packet(
+               struct bt_notification *notification)
+{
+       return bt_get(bt_notification_packet_begin_borrow_packet(notification));
+}
+
+extern struct bt_packet *bt_notification_packet_end_borrow_packet(
                struct bt_notification *notification);
 
+static inline
+struct bt_packet *bt_notification_packet_end_get_packet(
+               struct bt_notification *notification)
+{
+       return bt_get(bt_notification_packet_end_borrow_packet(notification));
+}
+
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PACKET_H */
+#endif /* BABELTRACE_GRAPH_NOTIFICATION_PACKET_H */
This page took 0.025664 seconds and 4 git commands to generate.