Add ctf fs iterator initialization
[babeltrace.git] / include / babeltrace / plugin / plugin-system.h
index d2970b5895b57b1ad653a7bd187610c0acaed81b..0c3618c219b46b79dc1957ad750400cede5db1cd 100644 (file)
@@ -30,8 +30,7 @@
  * SOFTWARE.
  */
 
-#include <babeltrace/objects.h>
-#include <babeltrace/objects.h>
+#include <babeltrace/plugin/notification/notification.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -40,6 +39,12 @@ extern "C" {
 struct bt_notification;
 struct bt_notification_iterator;
 struct bt_component;
+struct bt_component_factory;
+struct bt_value;
+
+typedef enum bt_component_status (*bt_plugin_init_func)(
+               struct bt_component_factory *factory);
+typedef void (*bt_plugin_exit_func)(void);
 
 /**
  * Component private data deallocation function type.
@@ -49,36 +54,17 @@ struct bt_component;
 typedef void (*bt_component_destroy_cb)(struct bt_component *component);
 
 /**
- * Source component initialization function type.
- *
- * A source component's iterator initialization callback, private data and
- * deinitialization callback must be set by this function.
- *
- * @param component    Component instance
- */
-typedef struct bt_component *(*bt_component_source_init_cb)(
-               struct bt_component *component);
-
-/**
- * Sink component initialization function type.
+ * Component initialization function type.
  *
- * A sink component's notification handling callback, private data and
- * deinitialization callback must be set by this function.
+ * A component's private data and required callbacks must be set by this
+ * function.
  *
  * @param component    Component instance
+ * @param params       A dictionary of component parameters
+ * @returns            One of #bt_component_status values
  */
-typedef struct bt_component *(*bt_component_sink_init_cb)(
-               struct bt_component *component);
-
-/**
- * Iterator initialization function type.
- *
- * @param component    Component instance
- * @param iterator     Iterator instance
- */
-typedef enum bt_component_status (*bt_component_source_iterator_init_cb)(
-               struct bt_component *component,
-               struct bt_notification_iterator *iterator);
+typedef enum bt_component_status (*bt_component_init_cb)(
+               struct bt_component *component, struct bt_value *params);
 
 /**
  * Get a component's private data.
@@ -117,29 +103,31 @@ extern enum bt_component_status bt_component_set_destroy_cb(
  * A notification iterator's private data, deinitialization, next, and get
  * callbacks must be set by this function.
  *
- * @param component    Component instance
+ * @param source       Source component instance
  * @param iterator     Notification iterator instance
  */
 typedef enum bt_component_status (*bt_component_source_init_iterator_cb)(
-               struct bt_component *component,
-               struct bt_notification_iterator *iterator);
+               struct bt_component *, struct bt_notification_iterator *);
 
 /**
  * Set a source component's iterator initialization function.
  *
- * @param component    Component instance
+ * @param source       Source component instance
  * @param init_iterator        Notification iterator initialization callback
  */
 extern enum bt_component_status
-bt_component_source_set_iterator_init_cb(struct bt_component *component,
+bt_component_source_set_iterator_init_cb(struct bt_component *source,
                bt_component_source_init_iterator_cb init_iterator);
 
 /** bt_component_sink */
 /**
  * Notification handling function type.
  *
- * @param component    Component instance
- * @param notificattion        Notification to handle
+ * A reference must be taken on the notification if the component has to
+ * keep ownership of the notification beyond the invocation of the callback.
+ *
+ * @param sink         Sink component instance
+ * @param notification Notification to handle
  * @returns            One of #bt_component_status values
  */
 typedef enum bt_component_status (*bt_component_sink_handle_notification_cb)(
@@ -148,14 +136,29 @@ typedef enum bt_component_status (*bt_component_sink_handle_notification_cb)(
 /**
  * Set a sink component's notification handling callback.
  *
- * @param component            Component instance
+ * @param sink                 Sink component instance
  * @param handle_notification  Notification handling callback
  * @returns                    One of #bt_component_status values
  */
 extern enum bt_component_status
-bt_component_sink_set_handle_notification_cb(struct bt_component *component,
+bt_component_sink_set_handle_notification_cb(struct bt_component *sink,
                bt_component_sink_handle_notification_cb handle_notification);
 
+/**
+ * Register a sink to a given notification type.
+ *
+ * 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 type         One of #bt_notification_type
+ * @returns            One of #bt_component_status
+ */
+extern enum bt_component_status
+bt_component_sink_register_notification_type(struct bt_component *sink,
+               enum bt_notification_type type);
+
 /** bt_component_notification_iterator */
 /**
  * Function returning an iterator's current notification.
@@ -229,7 +232,7 @@ bt_notification_iterator_set_private_data(
                struct bt_notification_iterator *iterator, void *data);
 
 /**
- * Gett an iterator's private data.
+ * Get an iterator's private data.
  *
  * @param iterator     Notification iterator instance
  * @returns            Iterator instance private data
This page took 0.026 seconds and 4 git commands to generate.