/*
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
* Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * Author: Jérémie Galarneau <jeremie.galarneau@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
#define BT_LOG_TAG "COMP"
#include <babeltrace/lib-logging-internal.h>
+#include <babeltrace/assert-internal.h>
+#include <babeltrace/assert-pre-internal.h>
#include <babeltrace/graph/self-component.h>
#include <babeltrace/graph/component-const.h>
#include <babeltrace/graph/component-source-const.h>
#include <babeltrace/graph/component-sink-internal.h>
#include <babeltrace/graph/connection-internal.h>
#include <babeltrace/graph/graph-internal.h>
-#include <babeltrace/graph/notification-iterator-internal.h>
+#include <babeltrace/graph/message-iterator-internal.h>
#include <babeltrace/graph/port-internal.h>
#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/compiler-internal.h>
-#include <babeltrace/object.h>
#include <babeltrace/types.h>
-#include <babeltrace/values.h>
-#include <babeltrace/values-internal.h>
-#include <babeltrace/assert-internal.h>
-#include <babeltrace/assert-pre-internal.h>
+#include <babeltrace/value.h>
+#include <babeltrace/value-internal.h>
#include <stdint.h>
#include <inttypes.h>
BT_ASSERT(user_component);
BT_ASSERT(component_class);
BT_ASSERT(name);
-
type = bt_component_class_get_type(component_class);
BT_LIB_LOGD("Creating empty component from component class: %![cc-]+C, "
"comp-name=\"%s\"", component_class, name);
goto end;
}
- bt_object_init_shared_with_parent(&component->base,
- destroy_component);
+ bt_object_init_shared_with_parent(&component->base, destroy_component);
component->class = component_class;
bt_object_get_no_null_check(component->class);
component->destroy = component_destroy_funcs[type];
* below (in which its component is `NULL` as expected because
* of the bt_object_set_parent() call below).
*
- * To avoid a destroyed port during the notification callback,
+ * To avoid a destroyed port during the message callback,
* get a reference now, and put it (destroying the port if its
* reference count is 0 at this point) after notifying the
* graph's user.
struct bt_port *cur_port = g_ptr_array_index(ports, i);
if (cur_port == port) {
- remove_port_by_index(component,
- ports, i);
+ remove_port_by_index(component, ports, i);
goto end;
}
}
}
}
}
+
+void bt_component_get_ref(const struct bt_component *component)
+{
+ bt_object_get_ref(component);
+}
+
+void bt_component_put_ref(const struct bt_component *component)
+{
+ bt_object_put_ref(component);
+}