bt2: pass custom Python object to Python component's __init__()
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt_graph.i.h
index bccc18257109766e2dbd70c26305fa832cdbdd38..a7193497fa5cb5dff0da393805f40cf8d7accfdf 100644 (file)
@@ -513,3 +513,45 @@ end:
        Py_XDECREF(py_listener_id);
        return py_listener_ids;
 }
+
+static
+bt_graph_add_component_status
+bt_bt2_graph_add_source_component(
+               bt_graph *graph,
+               const bt_component_class_source *component_class,
+               const char *name, const bt_value *params,
+               PyObject *obj, bt_logging_level log_level,
+               const bt_component_source **component)
+{
+       return bt_graph_add_source_component_with_init_method_data(graph,
+               component_class, name, params, obj == Py_None ? NULL : obj,
+               log_level, component);
+}
+
+static
+bt_graph_add_component_status
+bt_bt2_graph_add_filter_component(
+               bt_graph *graph,
+               const bt_component_class_filter *component_class,
+               const char *name, const bt_value *params,
+               PyObject *obj, bt_logging_level log_level,
+               const bt_component_filter **component)
+{
+       return bt_graph_add_filter_component_with_init_method_data(graph,
+               component_class, name, params, obj == Py_None ? NULL : obj,
+               log_level, component);
+}
+
+static
+bt_graph_add_component_status
+bt_bt2_graph_add_sink_component(
+               bt_graph *graph,
+               const bt_component_class_sink *component_class,
+               const char *name, const bt_value *params,
+               PyObject *obj, bt_logging_level log_level,
+               const bt_component_sink **component)
+{
+       return bt_graph_add_sink_component_with_init_method_data(graph,
+               component_class, name, params, obj == Py_None ? NULL : obj,
+               log_level, component);
+}
This page took 0.025836 seconds and 4 git commands to generate.