"destroy" method -> "finalize" method
[babeltrace.git] / plugins / muxer / muxer.c
index 2700be6ed5671e5613842712a1d28e48d6f1012b..b0cdfe5922a1e53d0265b370e55dd29be6ab4f4e 100644 (file)
 
 #include <babeltrace/plugin/plugin-dev.h>
 #include <babeltrace/component/component.h>
-#include <babeltrace/component/filter.h>
+#include <babeltrace/component/component-filter.h>
 #include <babeltrace/component/notification/notification.h>
 #include <babeltrace/component/notification/iterator.h>
 #include <babeltrace/component/notification/event.h>
+#include <plugins-common.h>
 #include "muxer.h"
 
 static
@@ -54,15 +55,16 @@ end:
 }
 
 static
-void destroy_muxer(struct bt_component *component)
+void finalize_muxer(struct bt_private_component *component)
 {
-       void *data = bt_component_get_private_data(component);
+       void *data = bt_private_component_get_user_data(component);
 
        destroy_muxer_data(data);
 }
 
 enum bt_component_status muxer_component_init(
-       struct bt_component *component, struct bt_value *params)
+       struct bt_private_component *component, struct bt_value *params,
+       UNUSED_VAR void *init_method_data)
 {
        enum bt_component_status ret;
        struct muxer *muxer = create_muxer();
@@ -72,13 +74,7 @@ enum bt_component_status muxer_component_init(
                goto end;
        }
 
-       ret = bt_component_set_destroy_cb(component,
-                       destroy_muxer);
-       if (ret != BT_COMPONENT_STATUS_OK) {
-               goto error;
-       }
-
-       ret = bt_component_set_private_data(component, muxer);
+       ret = bt_private_component_set_user_data(component, muxer);
        if (ret != BT_COMPONENT_STATUS_OK) {
                goto error;
        }
@@ -89,12 +85,28 @@ error:
        return ret;
 }
 
+static
+struct bt_notification *muxer_iterator_get(
+               struct bt_private_notification_iterator *iterator)
+{
+       return NULL;
+}
+
+static
+enum bt_notification_iterator_status muxer_iterator_next(
+               struct bt_private_notification_iterator *iterator)
+{
+       return BT_NOTIFICATION_ITERATOR_STATUS_OK;
+}
+
 /* Initialize plug-in entry points. */
 BT_PLUGIN(muxer);
 BT_PLUGIN_DESCRIPTION("Babeltrace Trace Muxer Plug-In.");
 BT_PLUGIN_AUTHOR("Jérémie Galarneau");
 BT_PLUGIN_LICENSE("MIT");
-BT_PLUGIN_COMPONENT_CLASS(BT_COMPONENT_TYPE_FILTER, muxer,
-       muxer_component_init);
-BT_PLUGIN_COMPONENT_CLASS_DESCRIPTION(BT_COMPONENT_TYPE_FILTER, muxer,
+BT_PLUGIN_FILTER_COMPONENT_CLASS(muxer, muxer_iterator_get,
+       muxer_iterator_next);
+BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(muxer,
        "Time-correlate multiple traces.");
+BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(muxer, muxer_component_init);
+BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(muxer, finalize_muxer);
This page took 0.023997 seconds and 4 git commands to generate.