lib: remove colander sink component class
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 5 Aug 2019 20:35:56 +0000 (16:35 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 6 Aug 2019 20:17:13 +0000 (16:17 -0400)
This is not used anymore.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ib0592d3adf02f82159e262184d92e6eaf67f2386
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1827
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/lib/graph/Makefile.am
src/lib/graph/component-class-sink-colander.c [deleted file]
src/lib/graph/component-class-sink-colander.h [deleted file]
src/lib/graph/iterator.c
src/lib/lib-logging.c

index a7a9c03720106ff1c4546836e0f7f54e76d3d98c..aa9d86c7710f4cc5c12a7d9fda63e83e7cb2eebb 100644 (file)
@@ -7,8 +7,6 @@ libgraph_la_SOURCES = \
        component.c \
        component-class.c \
        component-class.h \
-       component-class-sink-colander.c \
-       component-class-sink-colander.h \
        component-filter.c \
        component-filter.h \
        component.h \
diff --git a/src/lib/graph/component-class-sink-colander.c b/src/lib/graph/component-class-sink-colander.c
deleted file mode 100644 (file)
index d1978c9..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#define BT_LOG_TAG "LIB/COLANDER"
-#include "lib/logging.h"
-
-#include "common/assert.h"
-#include "lib/assert-pre.h"
-#include "lib/object.h"
-#include <babeltrace2/graph/component-class-sink.h>
-#include <babeltrace2/graph/self-component-sink.h>
-#include <babeltrace2/graph/self-component-port.h>
-#include <babeltrace2/graph/self-component-port-input-message-iterator.h>
-#include <babeltrace2/graph/self-component.h>
-#include <glib.h>
-
-#include "component-class-sink-colander.h"
-#include "lib/func-status.h"
-
-static
-struct bt_component_class_sink *colander_comp_cls;
-
-static
-enum bt_component_class_init_method_status colander_init(
-               struct bt_self_component_sink *self_comp,
-               const struct bt_value *params, void *init_method_data)
-{
-       int status = BT_FUNC_STATUS_OK;
-       struct bt_component_class_sink_colander_priv_data *colander_data = NULL;
-       struct bt_component_class_sink_colander_data *user_provided_data =
-               init_method_data;
-
-       BT_ASSERT(init_method_data);
-       colander_data = g_new0(
-               struct bt_component_class_sink_colander_priv_data, 1);
-       if (!colander_data) {
-               BT_LIB_LOGE_APPEND_CAUSE(
-                       "Failed to allocate colander sink data.");
-               status = BT_FUNC_STATUS_MEMORY_ERROR;
-               goto end;
-       }
-
-       colander_data->msgs = user_provided_data->msgs;
-       colander_data->count_addr = user_provided_data->count_addr;
-       status = bt_self_component_sink_add_input_port(self_comp, "in",
-               NULL, NULL);
-       if (status != BT_FUNC_STATUS_OK) {
-               BT_LIB_LOGE_APPEND_CAUSE(
-                       "Cannot add input port to colander sink.");
-               goto end;
-       }
-
-       bt_self_component_set_data(
-               bt_self_component_sink_as_self_component(self_comp),
-               colander_data);
-
-end:
-       return status;
-}
-
-static
-void colander_finalize(struct bt_self_component_sink *self_comp)
-{
-       struct bt_component_class_sink_colander_priv_data *colander_data =
-               bt_self_component_get_data(
-                       bt_self_component_sink_as_self_component(self_comp));
-
-       if (!colander_data) {
-               return;
-       }
-
-       BT_OBJECT_PUT_REF_AND_RESET(colander_data->msg_iter);
-       g_free(colander_data);
-}
-
-static
-enum bt_component_class_sink_graph_is_configured_method_status
-colander_graph_is_configured(
-       bt_self_component_sink *self_comp)
-{
-       enum bt_component_class_sink_graph_is_configured_method_status status =
-               BT_FUNC_STATUS_OK;
-       struct bt_component_class_sink_colander_priv_data *colander_data =
-               bt_self_component_get_data(
-                       bt_self_component_sink_as_self_component(self_comp));
-
-       struct bt_self_component_port_input *self_port =
-               bt_self_component_sink_borrow_input_port_by_name(self_comp, "in");
-       BT_ASSERT(self_port);
-
-       BT_ASSERT(colander_data);
-       BT_OBJECT_PUT_REF_AND_RESET(colander_data->msg_iter);
-       colander_data->msg_iter =
-               bt_self_component_port_input_message_iterator_create_from_sink_component(
-                       self_comp, self_port);
-       if (!colander_data->msg_iter) {
-               BT_LIB_LOGE_APPEND_CAUSE("Cannot create message iterator on "
-                       "self component input port: %![port-]+p",
-                       self_port);
-               status = BT_FUNC_STATUS_MEMORY_ERROR;
-               goto end;
-       }
-
-end:
-       return status;
-}
-
-static
-enum bt_component_class_sink_consume_method_status colander_consume(
-               struct bt_self_component_sink *self_comp)
-{
-       enum bt_component_class_sink_consume_method_status status =
-               BT_FUNC_STATUS_OK;
-       enum bt_message_iterator_next_status next_status;
-       struct bt_component_class_sink_colander_priv_data *colander_data =
-               bt_self_component_get_data(
-                       bt_self_component_sink_as_self_component(self_comp));
-       bt_message_array_const msgs;
-
-       BT_ASSERT(colander_data);
-       BT_ASSERT(colander_data->msg_iter);
-       next_status = bt_self_component_port_input_message_iterator_next(
-               colander_data->msg_iter, &msgs,
-               colander_data->count_addr);
-       switch (next_status) {
-       case BT_FUNC_STATUS_AGAIN:
-               status = BT_FUNC_STATUS_AGAIN;
-               goto end;
-       case BT_FUNC_STATUS_END:
-               status = BT_FUNC_STATUS_END;
-               goto end;
-       case BT_FUNC_STATUS_OK:
-               /* Move messages to user (count already set) */
-               memcpy(colander_data->msgs, msgs,
-                       sizeof(*msgs) * *colander_data->count_addr);
-               break;
-       default:
-               status = BT_FUNC_STATUS_ERROR;
-               goto end;
-       }
-
-end:
-       return status;
-}
-
-struct bt_component_class_sink *bt_component_class_sink_colander_get(void)
-{
-       if (colander_comp_cls) {
-               goto end;
-       }
-
-       colander_comp_cls = bt_component_class_sink_create("colander",
-               colander_consume);
-       if (!colander_comp_cls) {
-               BT_LIB_LOGE_APPEND_CAUSE(
-                       "Cannot create sink colander component class.");
-               goto end;
-       }
-
-       (void) bt_component_class_sink_set_init_method(
-               colander_comp_cls, colander_init);
-       (void) bt_component_class_sink_set_finalize_method(
-               colander_comp_cls, colander_finalize);
-       (void) bt_component_class_sink_set_graph_is_configured_method(
-               colander_comp_cls, colander_graph_is_configured);
-
-end:
-       bt_object_get_ref(colander_comp_cls);
-       return colander_comp_cls;
-}
-
-__attribute__((destructor)) static
-void put_colander(void) {
-       BT_OBJECT_PUT_REF_AND_RESET(colander_comp_cls);
-}
diff --git a/src/lib/graph/component-class-sink-colander.h b/src/lib/graph/component-class-sink-colander.h
deleted file mode 100644 (file)
index faa7a6e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_COLANDER_H
-#define BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_COLANDER_H
-
-/*
- * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#include <stdint.h>
-#include <babeltrace2/types.h>
-#include <babeltrace2/graph/message-const.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component_class_sink_colander_priv_data {
-       bt_message_array_const msgs;
-       uint64_t *count_addr;
-       struct bt_self_component_port_input_message_iterator *msg_iter;
-};
-
-struct bt_component_class_sink_colander_data {
-       bt_message_array_const msgs;
-       uint64_t *count_addr;
-};
-
-extern struct bt_component_class_sink *
-bt_component_class_sink_colander_get(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_COLANDER_H */
index 62e1f91e768719131929aa94aa0b94fdcca46494..21cd6eb80d9c802cc4d9314d32985f95d1bc3830 100644 (file)
@@ -63,7 +63,6 @@
 #include <stdlib.h>
 
 #include "component-class.h"
-#include "component-class-sink-colander.h"
 #include "component.h"
 #include "component-sink.h"
 #include "component-source.h"
index ce261a1a89ab0d19f5cf87f9a33b086b515e4b57..42eef20864a864f4998bde9dc6f662657e4a86b4 100644 (file)
@@ -43,7 +43,6 @@
 #include "object-pool.h"
 #include "graph/interrupter.h"
 #include "graph/component-class.h"
-#include "graph/component-class-sink-colander.h"
 #include "graph/component-filter.h"
 #include "graph/component.h"
 #include "graph/component-sink.h"
This page took 0.028246 seconds and 4 git commands to generate.