lib: remove internal stream destroy listener API
[babeltrace.git] / tests / lib / test-plugin-plugins / sfs.c
index cb1e7e475de2d4f04d61a017c8995debd56a98b7..f9d521300818638ed4a633659efadb163ce00e44 100644 (file)
  */
 
 #include <babeltrace/plugin/plugin-dev.h>
-#include <babeltrace/component/component.h>
+#include <babeltrace/graph/component-class.h>
+#include <babeltrace/values.h>
+#include <babeltrace/ref.h>
+#include <babeltrace/assert-internal.h>
+#include <babeltrace/assert-internal.h>
 
-static enum bt_component_status sink_consume(struct bt_component *component)
+static enum bt_component_status sink_consume(
+               struct bt_private_component *private_component)
 {
        return BT_COMPONENT_STATUS_OK;
 }
 
 static enum bt_notification_iterator_status dummy_iterator_init_method(
-               struct bt_component *component,
-               struct bt_notification_iterator *iterator,
-               void *init_method_data)
+               struct bt_private_connection_private_notification_iterator *private_iterator,
+               struct bt_private_port *private_port)
 {
        return BT_NOTIFICATION_ITERATOR_STATUS_OK;
 }
 
-static void dummy_iterator_destroy_method(
-               struct bt_notification_iterator *iterator)
+static void dummy_iterator_finalize_method(
+               struct bt_private_connection_private_notification_iterator *private_iterator)
 {
 }
 
-static struct bt_notification *dummy_iterator_get_method(
-               struct bt_notification_iterator *iterator)
+static struct bt_notification_iterator_next_method_return dummy_iterator_next_method(
+               struct bt_private_connection_private_notification_iterator *private_iterator)
 {
-       return NULL;
-}
+       struct bt_notification_iterator_next_method_return next_return = {
+               .notification = NULL,
+               .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
+       };
 
-static enum bt_notification_iterator_status dummy_iterator_next_method(
-               struct bt_notification_iterator *iterator)
-{
-       return BT_NOTIFICATION_ITERATOR_STATUS_OK;
+       return next_return;
 }
 
-static enum bt_notification_iterator_status dummy_iterator_seek_time_method(
-               struct bt_notification_iterator *iterator, int64_t time)
+static struct bt_component_class_query_method_return query_method(
+               struct bt_component_class *component_class,
+               struct bt_query_executor *query_exec,
+               const char *object, struct bt_value *params)
 {
-       return BT_NOTIFICATION_ITERATOR_STATUS_OK;
+       struct bt_component_class_query_method_return ret = {
+               .status = BT_QUERY_STATUS_OK,
+               .result = bt_value_array_create(),
+       };
+       int iret;
+
+       BT_ASSERT(ret.result);
+       iret = bt_value_array_append_string(ret.result, object);
+       BT_ASSERT(iret == 0);
+       iret = bt_value_array_append(ret.result, params);
+       BT_ASSERT(iret == 0);
+       return ret;
 }
 
+BT_PLUGIN_MODULE();
 BT_PLUGIN(test_sfs);
 BT_PLUGIN_DESCRIPTION("Babeltrace plugin with source, sink, and filter component classes");
 BT_PLUGIN_AUTHOR("Janine Sutto");
 BT_PLUGIN_LICENSE("Beerware");
 BT_PLUGIN_VERSION(1, 2, 3, "yes");
 
-BT_PLUGIN_SOURCE_COMPONENT_CLASS(source, dummy_iterator_get_method,
-       dummy_iterator_next_method);
+BT_PLUGIN_SOURCE_COMPONENT_CLASS(source, dummy_iterator_next_method);
 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(source, "A source.");
 BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(source,
        dummy_iterator_init_method);
-BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD(source,
-       dummy_iterator_destroy_method);
-BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(source,
-       dummy_iterator_seek_time_method);
+BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(source,
+       dummy_iterator_finalize_method);
 
 BT_PLUGIN_SINK_COMPONENT_CLASS(sink, sink_consume);
 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(sink, "A sink.");
+BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(sink,
+       "Bacon ipsum dolor amet strip steak cupim pastrami venison shoulder.\n"
+       "Prosciutto beef ribs flank meatloaf pancetta brisket kielbasa drumstick\n"
+       "venison tenderloin cow tail. Beef short loin shoulder meatball, sirloin\n"
+       "ground round brisket salami cupim pork bresaola turkey bacon boudin.\n"
+);
 
-BT_PLUGIN_FILTER_COMPONENT_CLASS(filter, dummy_iterator_get_method,
-       dummy_iterator_next_method);
+BT_PLUGIN_FILTER_COMPONENT_CLASS(filter, dummy_iterator_next_method);
 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(filter, "A filter.");
 BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(filter,
        dummy_iterator_init_method);
-BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD(filter,
-       dummy_iterator_destroy_method);
-BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(filter,
-       dummy_iterator_seek_time_method);
+BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(filter,
+       dummy_iterator_finalize_method);
+BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(filter, query_method);
This page took 0.023944 seconds and 4 git commands to generate.