Hide filter creation functions
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 18 Feb 2017 16:48:25 +0000 (11:48 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:38 +0000 (12:57 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/component/component-filter-internal.h
lib/component/filter.c

index 1d4cc9a78a2ca84bffccbffc7713785f6b3910a8..72bbbab1df1f58765e0c75d85d2b0d6ae03cd4ee 100644 (file)
@@ -59,4 +59,18 @@ BT_HIDDEN
 enum bt_component_status bt_component_filter_validate(
                struct bt_component *component);
 
+/**
+ * Create an iterator on a component instance.
+ *
+ * @param component    Component instance
+ * @returns            Notification iterator instance
+ */
+BT_HIDDEN
+struct bt_notification_iterator *bt_component_filter_create_notification_iterator(
+               struct bt_component *component);
+
+BT_HIDDEN
+struct bt_notification_iterator *bt_component_filter_create_notification_iterator_with_init_method_data(
+        struct bt_component *component, void *init_method_data);
+
 #endif /* BABELTRACE_COMPONENT_FILTER_INTERNAL_H */
index 231907096313e57197501fcf54e2e67905d11a89..da59cc21d82081f81ad69c82d7aed02445f36bb7 100644 (file)
 #include <babeltrace/component/notification/notification.h>
 #include <babeltrace/component/notification/iterator-internal.h>
 
-enum bt_component_status bt_component_filter_add_iterator(
-               struct bt_component *component,
-               struct bt_notification_iterator *iterator)
-{
-       enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
-       struct bt_component_class_filter *filter_class;
-
-       if (!component || !iterator) {
-               ret = BT_COMPONENT_STATUS_INVALID;
-               goto end;
-       }
-
-       if (bt_component_get_class_type(component) != BT_COMPONENT_CLASS_TYPE_FILTER) {
-               ret = BT_COMPONENT_STATUS_UNSUPPORTED;
-               goto end;
-       }
-
-       /* TODO validate iterator count limits. */
-
-       filter_class = container_of(component->class,
-                       struct bt_component_class_filter, parent);
-       if (filter_class->methods.add_iterator) {
-               ret = filter_class->methods.add_iterator(component, iterator);
-               if (ret != BT_COMPONENT_STATUS_OK) {
-                       goto end;
-               }
-       }
-
-end:
-       return ret;
-}
-
+BT_HIDDEN
 struct bt_notification_iterator *bt_component_filter_create_notification_iterator(
                struct bt_component *component)
 {
        return bt_component_create_iterator(component, NULL);
 }
 
+BT_HIDDEN
 struct bt_notification_iterator *bt_component_filter_create_notification_iterator_with_init_method_data(
                struct bt_component *component, void *init_method_data)
 {
This page took 0.025808 seconds and 4 git commands to generate.