Add bt_component_*_create_iterator_with_init_method_data()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 31 Jan 2017 07:45:14 +0000 (02:45 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:37 +0000 (12:57 -0400)
This is analogous to bt_component_create_with_init_method_data(),
but for notification iterators.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
12 files changed:
include/babeltrace/component/component-class.h
include/babeltrace/component/component-filter.h
include/babeltrace/component/component-internal.h
include/babeltrace/component/component-source.h
lib/component/component.c
lib/component/filter.c
lib/component/source.c
plugins/ctf/fs/fs.c
plugins/ctf/fs/fs.h
plugins/trimmer/iterator.c
plugins/trimmer/iterator.h
tests/lib/test-plugin-plugins/sfs.c

index ac78ce3463a010e9c8e6aac1968a5f16cb52f1f1..664d7bcf2e153c454905017f54a4ea6629e3ff0a 100644 (file)
@@ -58,7 +58,7 @@ typedef void (*bt_component_class_destroy_method)(struct bt_component *component
 typedef enum bt_notification_iterator_status
                (*bt_component_class_notification_iterator_init_method)(
                struct bt_component *component,
-               struct bt_notification_iterator *iterator);
+               struct bt_notification_iterator *iterator, void *init_method_data);
 
 typedef void (*bt_component_class_notification_iterator_destroy_method)(
                struct bt_notification_iterator *iterator);
index 64e6ef964f82397934df0892ff4d9b01449e34d7..1c0373bc0078435c67ac4579cab7103398d5965e 100644 (file)
@@ -59,6 +59,10 @@ extern
 struct bt_notification_iterator *bt_component_filter_create_iterator(
                struct bt_component *component);
 
+extern
+struct bt_notification_iterator *bt_component_filter_create_iterator_with_init_method_data(
+        struct bt_component *component, void *init_method_data);
+
 /* Defaults to 1. */
 extern enum bt_component_status
 bt_component_filter_set_minimum_input_count(struct bt_component *filter,
index dadaa75b22665b93a54bc2d7eda4f6fb95c6cfdc..5d466c21e001246fc30715f457664854e701b425 100644 (file)
@@ -61,6 +61,6 @@ enum bt_component_status bt_component_init(struct bt_component *component,
 
 BT_HIDDEN
 struct bt_notification_iterator *bt_component_create_iterator(
-               struct bt_component *component);
+               struct bt_component *component, void *init_method_data);
 
 #endif /* BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H */
index fdb3eb266239818ef04016798da09e0520e5d798..5ada76d512ee077a6594114c57765dda0a559cff 100644 (file)
@@ -47,6 +47,10 @@ extern
 struct bt_notification_iterator *bt_component_source_create_iterator(
                struct bt_component *component);
 
+extern
+struct bt_notification_iterator *bt_component_source_create_iterator_with_init_method_data(
+        struct bt_component *component, void *init_method_data);
+
 #ifdef __cplusplus
 }
 #endif
index d6921a42da4b2e7235b0661be163df38330d9556..136bf95fa111258a59798aa1037df9aa38f14996 100644 (file)
@@ -107,7 +107,7 @@ enum bt_component_class_type bt_component_get_class_type(
 
 BT_HIDDEN
 struct bt_notification_iterator *bt_component_create_iterator(
-               struct bt_component *component)
+               struct bt_component *component, void *init_method_data)
 {
        enum bt_notification_iterator_status ret_iterator;
        enum bt_component_class_type type;
@@ -139,7 +139,7 @@ struct bt_notification_iterator *bt_component_create_iterator(
                source_class = container_of(class, struct bt_component_class_source, parent);
                assert(source_class->methods.iterator.init);
                status = source_class->methods.iterator.init(component,
-                               iterator);
+                               iterator, init_method_data);
                if (status < 0) {
                        goto error;
                }
@@ -153,7 +153,7 @@ struct bt_notification_iterator *bt_component_create_iterator(
                filter_class = container_of(class, struct bt_component_class_filter, parent);
                assert(filter_class->methods.iterator.init);
                status = filter_class->methods.iterator.init(component,
-                               iterator);
+                               iterator, init_method_data);
                if (status < 0) {
                        goto error;
                }
index 5d983f11724babadbd21db90098d7bb373913722..dc170e3664c22fde551683159bc3cc33e947d6fe 100644 (file)
@@ -183,7 +183,13 @@ end:
 struct bt_notification_iterator *bt_component_filter_create_iterator(
                struct bt_component *component)
 {
-       return bt_component_create_iterator(component);
+       return bt_component_create_iterator(component, NULL);
+}
+
+struct bt_notification_iterator *bt_component_filter_create_iterator_with_init_method_data(
+               struct bt_component *component, void *init_method_data)
+{
+       return bt_component_create_iterator(component, init_method_data);
 }
 
 static
index c75c556d6441acd031da6773e6357e183bfe9fc9..7f4627637837416eea6e9136ae017b9d1b3a72ee 100644 (file)
@@ -83,5 +83,11 @@ end:
 struct bt_notification_iterator *bt_component_source_create_iterator(
                struct bt_component *component)
 {
-       return bt_component_create_iterator(component);
+       return bt_component_create_iterator(component, NULL);
+}
+
+struct bt_notification_iterator *bt_component_source_create_iterator_with_init_method_data(
+               struct bt_component *component, void *init_method_data)
+{
+       return bt_component_create_iterator(component, init_method_data);
 }
index c24833facf8b00953c690970b2e069114a4db178..b7b049569981c27379c80b3e6d37ebd23482215f 100644 (file)
@@ -584,7 +584,8 @@ end:
 }
 
 enum bt_notification_iterator_status ctf_fs_iterator_init(struct bt_component *source,
-               struct bt_notification_iterator *it)
+               struct bt_notification_iterator *it,
+               UNUSED_VAR void *init_method_data)
 {
        struct ctf_fs_iterator *ctf_it;
        struct ctf_fs_component *ctf_fs;
index 4c165676b287eaa6fab2f9adf1f59245208cb373..de572cda5ac578824040855181f967f12d4afed9 100644 (file)
@@ -115,7 +115,8 @@ void ctf_fs_destroy(struct bt_component *component);
 BT_HIDDEN
 enum bt_notification_iterator_status ctf_fs_iterator_init(
                struct bt_component *source,
-               struct bt_notification_iterator *it);
+               struct bt_notification_iterator *it,
+               void *init_method_data);
 
 void ctf_fs_iterator_destroy(struct bt_notification_iterator *it);
 
index 614748a2f76349f869afbe1602134f8e2ff93ce2..04557cba3ad4b491ba0e429791bc48463b43622f 100644 (file)
@@ -42,6 +42,7 @@
 #include <babeltrace/ctf-ir/trace.h>
 #include <babeltrace/ctf-ir/fields.h>
 #include <assert.h>
+#include <plugins-common.h>
 
 BT_HIDDEN
 void trimmer_iterator_destroy(struct bt_notification_iterator *it)
@@ -61,7 +62,8 @@ void trimmer_iterator_destroy(struct bt_notification_iterator *it)
 BT_HIDDEN
 enum bt_notification_iterator_status trimmer_iterator_init(
                struct bt_component *component,
-               struct bt_notification_iterator *iterator)
+               struct bt_notification_iterator *iterator,
+               UNUSED_VAR void *init_method_data)
 {
        enum bt_notification_iterator_status ret =
                BT_NOTIFICATION_ITERATOR_STATUS_OK;
index 9bebf45982c1b507813d4e6fed186c8182c13cc0..1a632cda039d2ad527d988e40a6db5a9970ec21f 100644 (file)
@@ -40,7 +40,7 @@ struct trimmer_iterator {
 BT_HIDDEN
 enum bt_notification_iterator_status trimmer_iterator_init(
                struct bt_component *component,
-               struct bt_notification_iterator *iterator);
+               struct bt_notification_iterator *iterator, void *init_method_data);
 
 BT_HIDDEN
 void trimmer_iterator_destroy(struct bt_notification_iterator *it);
index 52d3bf9f2bba319658726e4819799e4f5dce1515..cb1e7e475de2d4f04d61a017c8995debd56a98b7 100644 (file)
@@ -25,7 +25,8 @@ static enum bt_component_status sink_consume(struct bt_component *component)
 
 static enum bt_notification_iterator_status dummy_iterator_init_method(
                struct bt_component *component,
-               struct bt_notification_iterator *iterator)
+               struct bt_notification_iterator *iterator,
+               void *init_method_data)
 {
        return BT_NOTIFICATION_ITERATOR_STATUS_OK;
 }
This page took 0.029311 seconds and 4 git commands to generate.