Trace IR and notification APIs: split into private and public APIs
[babeltrace.git] / plugins / ctf / common / notif-iter / notif-iter.h
index fe6f7c54ce8aebfe21a36cff485db3e0b43154a5..81418628310df2228167620fc8df3c794437901e 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
  *
@@ -226,40 +228,14 @@ struct bt_notif_iter_medium_ops {
         * @returns             Stream instance (weak reference) or
         *                      \c NULL on error
         */
-       struct bt_stream * (* borrow_stream)(
-                       struct bt_stream_class *stream_class,
-                       uint64_t stream_id, void *data);
+       struct bt_private_stream * (* borrow_stream)(
+                       struct bt_private_stream_class *stream_class,
+                       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);
 
@@ -312,7 +288,7 @@ BT_HIDDEN
 enum bt_notif_iter_status bt_notif_iter_get_next_notification(
                struct bt_notif_iter *notit,
                struct bt_private_connection_private_notification_iterator *notif_iter,
-               struct bt_notification **notification);
+               struct bt_private_notification **notification);
 
 /**
  * Returns the first packet header and context fields. This function
@@ -329,8 +305,27 @@ enum bt_notif_iter_status bt_notif_iter_get_next_notification(
 BT_HIDDEN
 enum bt_notif_iter_status bt_notif_iter_borrow_packet_header_context_fields(
                struct bt_notif_iter *notit,
-               struct bt_field **packet_header_field,
-               struct bt_field **packet_context_field);
+               struct bt_private_field **packet_header_field,
+               struct bt_private_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,
@@ -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.034676 seconds and 4 git commands to generate.