lib: add sink component class's "graph is configured" method
[babeltrace.git] / lib / plugin / plugin-so.c
index ed8d5e297712395174cec3075bfe82c254188c50..ac0ec75b206c777f37d744bb8d1c395be1712a5d 100644 (file)
@@ -327,6 +327,7 @@ enum bt_plugin_status bt_plugin_so_init(
                                bt_component_class_sink_query_method query;
                                bt_component_class_sink_accept_input_port_connection_method accept_input_port_connection;
                                bt_component_class_sink_input_port_connected_method input_port_connected;
+                               bt_component_class_sink_graph_is_configured_method graph_is_configured;
                        } sink;
                } methods;
        };
@@ -596,6 +597,16 @@ enum bt_plugin_status bt_plugin_so_init(
                                        abort();
                                }
                                break;
+                       case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD:
+                               switch (cc_type) {
+                               case BT_COMPONENT_CLASS_TYPE_SINK:
+                                       cc_full_descr->methods.sink.graph_is_configured =
+                                               cur_cc_descr_attr->value.sink_graph_is_configured_method;
+                                       break;
+                               default:
+                                       abort();
+                               }
+                               break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD:
                                switch (cc_type) {
                                case BT_COMPONENT_CLASS_TYPE_SOURCE:
@@ -1173,6 +1184,18 @@ enum bt_plugin_status bt_plugin_so_init(
                                }
                        }
 
+                       if (cc_full_descr->methods.sink.graph_is_configured) {
+                               ret = bt_component_class_sink_set_graph_is_configured_method(
+                                       sink_comp_class,
+                                       cc_full_descr->methods.sink.graph_is_configured);
+                               if (ret) {
+                                       BT_LOGE_STR("Cannot set sink component class's \"graph is configured\" method.");
+                                       status = BT_PLUGIN_STATUS_ERROR;
+                                       BT_OBJECT_PUT_REF_AND_RESET(sink_comp_class);
+                                       goto end;
+                               }
+                       }
+
                        break;
                default:
                        abort();
This page took 0.024547 seconds and 4 git commands to generate.