X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fcomponent%2Fcomponent-internal.h;h=b6dfc880182f507a09e0b73e814e27edff4ba2ab;hb=2d41b99e628ef719c83f11d55d4a88aa9126a35e;hp=7c18f494d1fd28b000f916657ae3e22aadbe5844;hpb=33b34c437c354e1c065e33151135bc2e57e2e29c;p=babeltrace.git diff --git a/include/babeltrace/component/component-internal.h b/include/babeltrace/component/component-internal.h index 7c18f494..b6dfc880 100644 --- a/include/babeltrace/component/component-internal.h +++ b/include/babeltrace/component/component-internal.h @@ -30,20 +30,27 @@ #include #include #include +#include #include #include #include +#define DEFAULT_INPUT_PORT_NAME "default" +#define DEFAULT_OUTPUT_PORT_NAME "default" + struct bt_component { struct bt_object base; struct bt_component_class *class; GString *name; - /** Source, Sink or Filter destroy */ - bt_component_destroy_cb destroy; - /** User-defined data and its destruction callback */ + /** + * Internal destroy function specific to a source, filter, or + * sink component object. + */ + bt_component_class_destroy_method destroy; + + /** User-defined data */ void *user_data; - bt_component_destroy_cb user_destroy; /** * Used to protect operations which may only be used during @@ -54,13 +61,43 @@ struct bt_component { BT_HIDDEN enum bt_component_status bt_component_init(struct bt_component *component, - bt_component_destroy_cb destroy); + bt_component_class_destroy_method destroy); + +BT_HIDDEN +struct bt_notification_iterator *bt_component_create_iterator( + struct bt_component *component, void *init_method_data); BT_HIDDEN -enum bt_component_type bt_component_get_type(struct bt_component *component); +enum bt_component_status bt_component_new_connection( + struct bt_component *component, struct bt_port *own_port, + struct bt_connection *connection); BT_HIDDEN -struct bt_notification_iterator *bt_component_create_iterator( - struct bt_component *component); +void bt_component_set_graph(struct bt_component *component, + struct bt_graph *graph); + +BT_HIDDEN +int bt_component_init_input_ports(struct bt_component *component, + GPtrArray **input_ports); + +BT_HIDDEN +int bt_component_init_output_ports(struct bt_component *component, + GPtrArray **output_ports); + +BT_HIDDEN +struct bt_port *bt_component_get_port(GPtrArray *ports, const char *name); + +BT_HIDDEN +struct bt_port *bt_component_get_port_at_index(GPtrArray *ports, int index); + +BT_HIDDEN +struct bt_port *bt_component_add_port( + struct bt_component *component,GPtrArray *ports, + enum bt_port_type port_type, const char *name); + +BT_HIDDEN +enum bt_component_status bt_component_remove_port( + struct bt_component *component, GPtrArray *ports, + const char *name); #endif /* BABELTRACE_COMPONENT_COMPONENT_INTERNAL_H */