Notification iterator: generate automatic notifications when missing
[babeltrace.git] / include / babeltrace / graph / notification-packet-internal.h
index 8d525c55f673d6b3dbfdf163853d164c1a5354ae..4d519544f289a1642a7c80cade6f12809042f026 100644 (file)
@@ -27,6 +27,7 @@
  * SOFTWARE.
  */
 
+#include <babeltrace/compiler-internal.h>
 #include <babeltrace/ctf-ir/packet.h>
 #include <babeltrace/graph/notification-internal.h>
 
@@ -40,4 +41,28 @@ struct bt_notification_packet_end {
        struct bt_ctf_packet *packet;
 };
 
+static inline
+struct bt_ctf_packet *bt_notification_packet_begin_borrow_packet(
+               struct bt_notification *notif)
+{
+       struct bt_notification_packet_begin *notif_packet_begin =
+               container_of(notif,
+                       struct bt_notification_packet_begin, parent);
+
+       assert(notif_packet_begin);
+       return notif_packet_begin->packet;
+}
+
+static inline
+struct bt_ctf_packet *bt_notification_packet_end_borrow_packet(
+               struct bt_notification *notif)
+{
+       struct bt_notification_packet_end *notif_packet_end =
+               container_of(notif,
+                       struct bt_notification_packet_end, parent);
+
+       assert(notif_packet_end);
+       return notif_packet_end->packet;
+}
+
 #endif /* BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H */
This page took 0.02406 seconds and 4 git commands to generate.