2 * SPDX-License-Identifier: MIT
4 * Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
7 /* Output argument typemap for connection output (always appends) */
8 %typemap(in, numinputs=0)
9 (const bt_connection **)
10 (bt_connection *temp_conn = NULL) {
15 (const bt_connection **) {
17 /* SWIG_Python_AppendOutput() steals the created object */
18 $result = SWIG_Python_AppendOutput($result,
19 SWIG_NewPointerObj(SWIG_as_voidptr(*$1),
20 SWIGTYPE_p_bt_connection, 0));
22 /* SWIG_Python_AppendOutput() steals Py_None */
24 $result = SWIG_Python_AppendOutput($result, Py_None);
28 /* Output argument typemap for component output (always appends) */
29 %typemap(in, numinputs=0)
30 (const bt_component_source **)
31 (bt_component_source *temp_comp = NULL) {
35 %typemap(in, numinputs=0)
36 (const bt_component_filter **)
37 (bt_component_filter *temp_comp = NULL) {
41 %typemap(in, numinputs=0)
42 (const bt_component_sink **)
43 (bt_component_sink *temp_comp = NULL) {
47 %typemap(argout) (const bt_component_source **) {
49 /* SWIG_Python_AppendOutput() steals the created object */
50 $result = SWIG_Python_AppendOutput($result,
51 SWIG_NewPointerObj(SWIG_as_voidptr(*$1),
52 SWIGTYPE_p_bt_component_source, 0));
54 /* SWIG_Python_AppendOutput() steals Py_None */
56 $result = SWIG_Python_AppendOutput($result, Py_None);
60 %typemap(argout) (const bt_component_filter **) {
62 /* SWIG_Python_AppendOutput() steals the created object */
63 $result = SWIG_Python_AppendOutput($result,
64 SWIG_NewPointerObj(SWIG_as_voidptr(*$1),
65 SWIGTYPE_p_bt_component_filter, 0));
67 /* SWIG_Python_AppendOutput() steals Py_None */
69 $result = SWIG_Python_AppendOutput($result, Py_None);
73 %typemap(argout) (const bt_component_sink **) {
75 /* SWIG_Python_AppendOutput() steals the created object */
76 $result = SWIG_Python_AppendOutput($result,
77 SWIG_NewPointerObj(SWIG_as_voidptr(*$1),
78 SWIGTYPE_p_bt_component_sink, 0));
80 /* SWIG_Python_AppendOutput() steals Py_None */
82 $result = SWIG_Python_AppendOutput($result, Py_None);
86 %include <babeltrace2/graph/graph.h>
88 /* Helper functions for Python */
91 #include "native_bt_graph.i.h"
94 PyObject *bt_bt2_graph_add_port_added_listener(struct bt_graph *graph,
95 PyObject *py_callable);
97 bt_graph_add_component_status
98 bt_bt2_graph_add_source_component(
100 const bt_component_class_source *component_class,
101 const char *name, const bt_value *params,
102 PyObject *obj, bt_logging_level log_level,
103 const bt_component_source **component);
105 bt_graph_add_component_status
106 bt_bt2_graph_add_filter_component(
108 const bt_component_class_filter *component_class,
109 const char *name, const bt_value *params,
110 PyObject *obj, bt_logging_level log_level,
111 const bt_component_filter **component);
113 bt_graph_add_component_status
114 bt_bt2_graph_add_sink_component(
116 const bt_component_class_sink *component_class,
117 const char *name, const bt_value *params,
118 PyObject *obj, bt_logging_level log_level,
119 const bt_component_sink **component);