* SOFTWARE.
*/
-#include <babeltrace/compiler.h>
+#include <babeltrace/compiler-internal.h>
#include <babeltrace/ref.h>
#include <babeltrace/plugin/plugin-internal.h>
#include <babeltrace/plugin/plugin-so-internal.h>
#include <babeltrace/plugin/plugin-dev.h>
#include <babeltrace/plugin/plugin-internal.h>
-#include <babeltrace/component/component-class-internal.h>
+#include <babeltrace/graph/component-class-internal.h>
#include <string.h>
#include <stdbool.h>
#include <glib.h>
const char *description;
const char *help;
bt_component_class_init_method init_method;
- bt_component_class_destroy_method destroy_method;
+ bt_component_class_finalize_method finalize_method;
bt_component_class_query_method query_method;
- bt_component_class_new_connection_method new_connection_method;
+ bt_component_class_accept_port_connection_method accept_port_connection_method;
+ bt_component_class_port_disconnected_method port_disconnected_method;
struct bt_component_class_iterator_methods iterator_methods;
};
cc_full_descr->init_method =
cur_cc_descr_attr->value.init_method;
break;
- case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESTROY_METHOD:
- cc_full_descr->destroy_method =
- cur_cc_descr_attr->value.destroy_method;
+ case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD:
+ cc_full_descr->finalize_method =
+ cur_cc_descr_attr->value.finalize_method;
break;
case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD:
cc_full_descr->query_method =
cur_cc_descr_attr->value.query_method;
break;
- case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NEW_CONNECTION_METHOD:
- cc_full_descr->new_connection_method =
- cur_cc_descr_attr->value.new_connection_method;
+ case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_PORT_CONNECTION_METHOD:
+ cc_full_descr->accept_port_connection_method =
+ cur_cc_descr_attr->value.accept_port_connection_method;
+ break;
+ case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_PORT_DISCONNECTED_METHOD:
+ cc_full_descr->port_disconnected_method =
+ cur_cc_descr_attr->value.port_disconnected_method;
break;
case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD:
cc_full_descr->iterator_methods.init =
cur_cc_descr_attr->value.notif_iter_init_method;
break;
- case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_DESTROY_METHOD:
- cc_full_descr->iterator_methods.destroy =
- cur_cc_descr_attr->value.notif_iter_destroy_method;
+ case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD:
+ cc_full_descr->iterator_methods.finalize =
+ cur_cc_descr_attr->value.notif_iter_finalize_method;
break;
case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_SEEK_TIME_METHOD:
cc_full_descr->iterator_methods.seek_time =
case BT_COMPONENT_CLASS_TYPE_SOURCE:
comp_class = bt_component_class_source_create(
cc_full_descr->descriptor->name,
- cc_full_descr->descriptor->methods.source.notif_iter_get,
cc_full_descr->descriptor->methods.source.notif_iter_next);
break;
case BT_COMPONENT_CLASS_TYPE_FILTER:
comp_class = bt_component_class_filter_create(
cc_full_descr->descriptor->name,
- cc_full_descr->descriptor->methods.source.notif_iter_get,
cc_full_descr->descriptor->methods.source.notif_iter_next);
break;
case BT_COMPONENT_CLASS_TYPE_SINK:
}
}
- if (cc_full_descr->destroy_method) {
- ret = bt_component_class_set_destroy_method(comp_class,
- cc_full_descr->destroy_method);
+ if (cc_full_descr->finalize_method) {
+ ret = bt_component_class_set_finalize_method(comp_class,
+ cc_full_descr->finalize_method);
if (ret) {
status = BT_PLUGIN_STATUS_ERROR;
BT_PUT(comp_class);
}
}
- if (cc_full_descr->new_connection_method) {
- ret = bt_component_class_set_new_connection_method(
- comp_class, cc_full_descr->new_connection_method);
+ if (cc_full_descr->accept_port_connection_method) {
+ ret = bt_component_class_set_accept_port_connection_method(
+ comp_class, cc_full_descr->accept_port_connection_method);
+ if (ret) {
+ status = BT_PLUGIN_STATUS_ERROR;
+ BT_PUT(comp_class);
+ goto end;
+ }
+ }
+
+ if (cc_full_descr->port_disconnected_method) {
+ ret = bt_component_class_set_port_disconnected_method(
+ comp_class, cc_full_descr->port_disconnected_method);
if (ret) {
status = BT_PLUGIN_STATUS_ERROR;
BT_PUT(comp_class);
}
}
- if (cc_full_descr->iterator_methods.destroy) {
- ret = bt_component_class_source_set_notification_iterator_destroy_method(
+ if (cc_full_descr->iterator_methods.finalize) {
+ ret = bt_component_class_source_set_notification_iterator_finalize_method(
comp_class,
- cc_full_descr->iterator_methods.destroy);
+ cc_full_descr->iterator_methods.finalize);
if (ret) {
status = BT_PLUGIN_STATUS_ERROR;
BT_PUT(comp_class);
}
}
- if (cc_full_descr->iterator_methods.destroy) {
- ret = bt_component_class_filter_set_notification_iterator_destroy_method(
+ if (cc_full_descr->iterator_methods.finalize) {
+ ret = bt_component_class_filter_set_notification_iterator_finalize_method(
comp_class,
- cc_full_descr->iterator_methods.destroy);
+ cc_full_descr->iterator_methods.finalize);
if (ret) {
status = BT_PLUGIN_STATUS_ERROR;
BT_PUT(comp_class);