Add bt_notification_get_stream interface
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 9 Nov 2016 19:19:17 +0000 (14:19 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 18:09:06 +0000 (14:09 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/plugin/notification/notification-internal.h
include/babeltrace/plugin/notification/stream.h
lib/plugin-system/notification/notification.c

index 77b6bf13b728b4016e3bb348a75064f3913955ac..2259eac0e5f625c2f64eba2b52274853295592ee 100644 (file)
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/plugin/notification/notification.h>
+#include <babeltrace/ctf-ir/stream.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+typedef struct bt_ctf_stream *(*get_stream_func)(
+               struct bt_notification *notification);
+
 struct bt_notification {
        struct bt_object base;
        enum bt_notification_type type;
+       get_stream_func get_stream;
 };
 
 BT_HIDDEN
index 6f079256a988071ceb13cfe5a5acfdf3fda05405..f717365ccdfe380d9241b89e0ce1397855f64f14 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 #include <babeltrace/plugin/notification/notification.h>
+#include <babeltrace/ctf-ir/stream.h>
 
 #ifdef __cplusplus
 extern "C" {
index 50aca6f7749f956ee96863c527d1dd9f4fdba9ea..139caed0b85f7d6eb966a23992c64c668091fffd 100644 (file)
@@ -42,3 +42,17 @@ enum bt_notification_type bt_notification_get_type(
 {
        return notification ? notification->type : BT_NOTIFICATION_TYPE_UNKNOWN;
 }
+
+struct bt_ctf_stream *bt_notification_get_stream(
+               struct bt_notification *notification)
+{
+       struct bt_ctf_stream *stream = NULL;
+
+       if (!notification || !notification->get_stream) {
+               goto end;
+       }
+
+       stream = notification->get_stream(notification);
+end:
+       return stream;
+}
This page took 0.025911 seconds and 4 git commands to generate.