Make API CTF-agnostic
[babeltrace.git] / plugins / ctf / common / notif-iter / notif-iter.h
index fe6f7c54ce8aebfe21a36cff485db3e0b43154a5..a504da948d2dd56e1f1f92a45a5471b602474dcd 100644 (file)
@@ -32,6 +32,8 @@
 #include <babeltrace/babeltrace.h>
 #include <babeltrace/babeltrace-internal.h>
 
+#include "../metadata/ctf-meta.h"
+
 /**
  * @file ctf-notif-iter.h
  *
@@ -228,38 +230,12 @@ struct bt_notif_iter_medium_ops {
         */
        struct bt_stream * (* borrow_stream)(
                        struct bt_stream_class *stream_class,
-                       uint64_t stream_id, void *data);
+                       int64_t stream_id, void *data);
 };
 
 /** CTF notification iterator. */
 struct bt_notif_iter;
 
-// TODO: Replace by the real thing
-enum bt_notif_iter_notif_type {
-       BT_NOTIF_ITER_NOTIF_NEW_PACKET,
-       BT_NOTIF_ITER_NOTIF_END_OF_PACKET,
-       BT_NOTIF_ITER_NOTIF_EVENT,
-};
-
-struct bt_notif_iter_notif {
-       enum bt_notif_iter_notif_type type;
-};
-
-struct bt_notif_iter_notif_new_packet {
-       struct bt_notif_iter_notif base;
-       struct bt_packet *packet;
-};
-
-struct bt_notif_iter_notif_end_of_packet {
-       struct bt_notif_iter_notif base;
-       struct bt_packet *packet;
-};
-
-struct bt_notif_iter_notif_event {
-       struct bt_notif_iter_notif base;
-       struct bt_event *event;
-};
-
 /**
  * Creates a CTF notification iterator.
  *
@@ -277,7 +253,7 @@ struct bt_notif_iter_notif_event {
  *                             success, or \c NULL on error
  */
 BT_HIDDEN
-struct bt_notif_iter *bt_notif_iter_create(struct bt_trace *trace,
+struct bt_notif_iter *bt_notif_iter_create(struct ctf_trace_class *tc,
        size_t max_request_sz, struct bt_notif_iter_medium_ops medops,
        void *medops_data);
 
@@ -332,6 +308,25 @@ enum bt_notif_iter_status bt_notif_iter_borrow_packet_header_context_fields(
                struct bt_field **packet_header_field,
                struct bt_field **packet_context_field);
 
+struct bt_notif_iter_packet_properties {
+       uint64_t exp_packet_total_size;
+       uint64_t exp_packet_content_size;
+       uint64_t stream_class_id;
+       int64_t data_stream_id;
+
+       struct {
+               uint64_t discarded_events;
+               uint64_t packets;
+               uint64_t beginning_clock;
+               uint64_t end_clock;
+       } snapshots;
+};
+
+BT_HIDDEN
+enum bt_notif_iter_status bt_notif_iter_get_packet_properties(
+               struct bt_notif_iter *notit,
+               struct bt_notif_iter_packet_properties *props);
+
 BT_HIDDEN
 void bt_notif_iter_set_medops_data(struct bt_notif_iter *notit,
                void *medops_data);
@@ -362,6 +357,13 @@ off_t bt_notif_iter_get_current_packet_size(
 BT_HIDDEN
 void bt_notif_iter_reset(struct bt_notif_iter *notit);
 
+/*
+ * Notify the iterator that the trace class changed somehow (new
+ * stream/event classes).
+ */
+BT_HIDDEN
+void bt_notif_trace_class_changed(struct bt_notif_iter *notit);
+
 static inline
 const char *bt_notif_iter_medium_status_string(
                enum bt_notif_iter_medium_status status)
This page took 0.02525 seconds and 4 git commands to generate.