*/
#include <babeltrace/plugin/notification/notification.h>
+#include <stdint.h>
#ifdef __cplusplus
extern "C" {
struct bt_component_factory;
struct bt_value;
-typedef enum bt_component_status (*bt_plugin_init_func)(
+typedef enum bt_component_status (*bt_plugin_register_func)(
struct bt_component_factory *factory);
-typedef void (*bt_plugin_exit_func)(void);
/**
* Component private data deallocation function type.
/** bt_component_sink */
/**
- * Notification handling function type.
+ * Notification consumption function type.
*
* @param sink Sink component instance
- * @param notificattion Notification to handle
* @returns One of #bt_component_status values
*/
-typedef enum bt_component_status (*bt_component_sink_handle_notification_cb)(
- struct bt_component *, struct bt_notification *);
+typedef enum bt_component_status (*bt_component_sink_consume_cb)(
+ struct bt_component *);
/**
- * Set a sink component's notification handling callback.
+ * Iterator addition function type.
*
- * @param sink Sink component instance
- * @param handle_notification Notification handling callback
- * @returns One of #bt_component_status values
+ * A sink component may choose to refuse the addition of an iterator
+ * by not returning BT_COMPONENT_STATUS_OK.
+ *
+ * @param sink Sink component instance
+ * @returns One of #bt_component_status values
+ */
+typedef enum bt_component_status (*bt_component_sink_add_iterator_cb)(
+ struct bt_component *, struct bt_notification_iterator *);
+
+/**
+ * Set a sink component's consumption callback.
+ *
+ * @param sink Sink component instance
+ * @param consume Consumption callback
+ * @returns One of #bt_component_status values
*/
extern enum bt_component_status
-bt_component_sink_set_handle_notification_cb(struct bt_component *sink,
- bt_component_sink_handle_notification_cb handle_notification);
+bt_component_sink_set_consume_cb(struct bt_component *sink,
+ bt_component_sink_consume_cb consume);
/**
- * Register a sink to a given notification type.
+ * Set a sink component's iterator addition callback.
*
- * A sink is always registered to notifications of type
- * BT_NOTIFICATION_TYPE_EVENT. However, it may opt to receive any (or all)
- * other notification type(s).
+ * @param sink Sink component instance
+ * @param add_iterator Iterator addition callback
+ * @returns One of #bt_component_status values
+ */
+extern enum bt_component_status
+bt_component_sink_set_add_iterator_cb(struct bt_component *sink,
+ bt_component_sink_add_iterator_cb add_iterator);
+
+/* Defaults to 1. */
+extern enum bt_component_status
+bt_component_sink_set_minimum_input_count(struct bt_component *sink,
+ unsigned int minimum);
+
+/* Defaults to 1. */
+extern enum bt_component_status
+bt_component_sink_set_maximum_input_count(struct bt_component *sink,
+ unsigned int maximum);
+
+extern enum bt_component_status
+bt_component_sink_get_input_count(struct bt_component *sink,
+ unsigned int *count);
+
+/* May return NULL after an interator has reached its end. */
+extern enum bt_component_status
+bt_component_sink_get_input_iterator(struct bt_component *sink,
+ unsigned int input, struct bt_notification_iterator **iterator);
+
+/** bt_component_filter */
+/**
+ * Iterator initialization function type.
*
- * @param sink Sink component instance.
- * @param type One of #bt_notification_type
- * @returns One of #bt_component_status
+ * A notification iterator's private data, deinitialization, next, and get
+ * callbacks must be set by this function.
+ *
+ * @param filter Filter component instance
+ * @param iterator Notification iterator instance
*/
+typedef enum bt_component_status (*bt_component_filter_init_iterator_cb)(
+ struct bt_component *, struct bt_notification_iterator *);
+
+/**
+ * Iterator addition function type.
+ *
+ * A filter component may choose to refuse the addition of an iterator
+ * by not returning BT_COMPONENT_STATUS_OK.
+ *
+ * @param filter Filter component instance
+ * @returns One of #bt_component_status values
+ */
+typedef enum bt_component_status (*bt_component_filter_add_iterator_cb)(
+ struct bt_component *, struct bt_notification_iterator *);
+
+/**
+ * Set a filter component's iterator initialization function.
+ *
+ * @param filter Filter component instance
+ * @param init_iterator Notification iterator initialization callback
+ */
+extern enum bt_component_status
+bt_component_filter_set_iterator_init_cb(struct bt_component *filter,
+ bt_component_filter_init_iterator_cb init_iterator);
+
+/**
+ * Set a filter component's iterator addition callback.
+ *
+ * @param filter Filter component instance
+ * @param add_iterator Iterator addition callback
+ * @returns One of #bt_component_status values
+ */
+extern enum bt_component_status
+bt_component_filter_set_add_iterator_cb(struct bt_component *filter,
+ bt_component_filter_add_iterator_cb add_iterator);
+
+/* Defaults to 1. */
+extern enum bt_component_status
+bt_component_filter_set_minimum_input_count(struct bt_component *filter,
+ unsigned int minimum);
+
+/* Defaults to 1. */
extern enum bt_component_status
-bt_component_sink_register_notification_type(struct bt_component *sink,
- enum bt_notification_type type);
+bt_component_filter_set_maximum_input_count(struct bt_component *filter,
+ unsigned int maximum);
-/** bt_component_notification_iterator */
+extern enum bt_component_status
+bt_component_filter_get_input_count(struct bt_component *filter,
+ unsigned int *count);
+
+/* May return NULL after an interator has reached its end. */
+extern enum bt_component_status
+bt_component_filter_get_input_iterator(struct bt_component *filter,
+ unsigned int input, struct bt_notification_iterator **iterator);
+
+/** bt_notification_iterator */
/**
* Function returning an iterator's current notification.
*
typedef enum bt_notification_iterator_status (*bt_notification_iterator_next_cb)(
struct bt_notification_iterator *iterator);
+/**
+ * Function advancing an iterator's position to a given time (relative to Epoch).
+ *
+ * @param iterator Notification iterator instance
+ * @param time Time at which to seek, expressed in ns since Epoch
+ * @returns One of #bt_notification_iterator_status values
+ */
+typedef enum bt_notification_iterator_status
+ (*bt_notification_iterator_seek_time_cb)(
+ struct bt_notification_iterator *iterator, int64_t time);
+
/**
* Function cleaning-up an iterator's private data on destruction.
*
bt_notification_iterator_set_next_cb(struct bt_notification_iterator *iterator,
bt_notification_iterator_next_cb next);
+/**
+ * Set an iterator's "seek_time" callback which sets the iterator's position to
+ * provided time (in ns since Epoch).
+ *
+ * @param iterator Notification iterator instance
+ * @param seek_timetime Iterator "seek_time" callback
+ * @returns One of #bt_notification_iterator_status values
+ */
+extern enum bt_notification_iterator_status
+bt_notification_iterator_set_seek_time_cb(struct bt_notification_iterator *iterator,
+ bt_notification_iterator_seek_time_cb seek_time);
+
/**
* Set an iterator's "destroy" callback.
*