#include "component-class.h"
#include "lib/func-status.h"
-void bt_component_filter_destroy(
- struct bt_component *component __attribute__((unused)))
-{
-}
-
struct bt_component *bt_component_filter_create(void)
{
struct bt_component_filter *filter = NULL;
struct bt_component *bt_component_filter_create(void);
-void bt_component_filter_destroy(struct bt_component *component);
-
#endif /* BABELTRACE_GRAPH_COMPONENT_FILTER_INTERNAL_H */
#include "graph.h"
#include "lib/func-status.h"
-void bt_component_sink_destroy(
- struct bt_component *component __attribute__((unused)))
-{
-}
-
struct bt_component *bt_component_sink_create(void)
{
struct bt_component_sink *sink = NULL;
struct bt_component *bt_component_sink_create(void);
-void bt_component_sink_destroy(struct bt_component *component);
-
#endif /* BABELTRACE_GRAPH_COMPONENT_SINK_INTERNAL_H */
#include "message/iterator.h"
#include "lib/func-status.h"
-void bt_component_source_destroy(
- struct bt_component *component __attribute__((unused)))
-{
-}
-
struct bt_component *bt_component_source_create(void)
{
struct bt_component_source *source = NULL;
struct bt_component *bt_component_source_create(void);
-void bt_component_source_destroy(struct bt_component *component);
-
#endif /* BABELTRACE_GRAPH_COMPONENT_SOURCE_INTERNAL_H */
[BT_COMPONENT_CLASS_TYPE_FILTER] = bt_component_filter_create,
};
-static
-void (*component_destroy_funcs[])(struct bt_component *) = {
- [BT_COMPONENT_CLASS_TYPE_SOURCE] = bt_component_source_destroy,
- [BT_COMPONENT_CLASS_TYPE_SINK] = bt_component_sink_destroy,
- [BT_COMPONENT_CLASS_TYPE_FILTER] = bt_component_filter_destroy,
-};
-
static
void finalize_component(struct bt_component *comp)
{
finalize_component(component);
}
- if (component->destroy) {
- BT_LOGD_STR("Destroying type-specific data.");
- component->destroy(component);
- }
-
if (component->input_ports) {
BT_LOGD_STR("Destroying input ports.");
g_ptr_array_free(component->input_ports, TRUE);
bt_object_init_shared_with_parent(&component->base, destroy_component);
component->class = component_class;
bt_object_get_ref_no_null_check(component->class);
- component->destroy = component_destroy_funcs[type];
component->name = g_string_new(name);
if (!component->name) {
BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one GString.");
GString *name;
bt_logging_level log_level;
- /*
- * Internal destroy function specific to a source, filter, or
- * sink component object.
- */
- void (*destroy)(struct bt_component *);
-
/* User-defined data */
void *user_data;