Add internal BT_ASSERT() and BT_ASSERT_PRE() helpers
[babeltrace.git] / include / babeltrace / graph / notification-event-internal.h
index 8fffd47ee9b7c1af57b4d42f7439d212a3870d4e..bfc209296186b3a8fe74bf22a039e25c8c9e63f6 100644 (file)
@@ -27,6 +27,7 @@
  * SOFTWARE.
  */
 
+#include <babeltrace/compiler-internal.h>
 #include <babeltrace/ctf-ir/event.h>
 #include <babeltrace/graph/notification-internal.h>
 #include <babeltrace/graph/clock-class-priority-map.h>
@@ -37,10 +38,34 @@ extern "C" {
 
 struct bt_notification_event {
        struct bt_notification parent;
-       struct bt_ctf_event *event;
+       struct bt_event *event;
        struct bt_clock_class_priority_map *cc_prio_map;
 };
 
+static inline
+struct bt_event *bt_notification_event_borrow_event(
+               struct bt_notification *notif)
+{
+       struct bt_notification_event *notif_event = container_of(notif,
+                       struct bt_notification_event, parent);
+
+       assert(notif_event);
+       return notif_event->event;
+}
+
+static inline
+struct bt_clock_class_priority_map *
+bt_notification_event_borrow_clock_class_priority_map(
+               struct bt_notification *notif)
+{
+       struct bt_notification_event *notif_event = container_of(notif,
+                       struct bt_notification_event, parent);
+
+       assert(notif_event);
+       return notif_event->cc_prio_map;
+}
+
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.026206 seconds and 4 git commands to generate.