bindings/python/bt2: Make the bt2 Python bindings build
[babeltrace.git] / bindings / python / bt2 / bt2 / native_bt_component.i
CommitLineData
6945df9a
SM
1/*
2 * The MIT License (MIT)
3 *
4 * Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24
25/* Output argument typemap for self port output (always appends) */
26%typemap(in, numinputs=0)
27 (bt_self_component_port_input **OUT)
28 (bt_self_component_port_input *temp_self_port = NULL) {
29 $1 = &temp_self_port;
30}
31
32%typemap(argout) bt_self_component_port_input **OUT {
33 if (*$1) {
34 /* SWIG_Python_AppendOutput() steals the created object */
35 $result = SWIG_Python_AppendOutput($result,
36 SWIG_NewPointerObj(SWIG_as_voidptr(*$1),
37 SWIGTYPE_p_bt_self_component_port_input, 0));
38 } else {
39 /* SWIG_Python_AppendOutput() steals Py_None */
40 Py_INCREF(Py_None);
41 $result = SWIG_Python_AppendOutput($result, Py_None);
42 }
43}
44
45/* Output argument typemap for self port output (always appends) */
46%typemap(in, numinputs=0)
47 (bt_self_component_port_output **OUT)
48 (bt_self_component_port_output *temp_self_port = NULL) {
49 $1 = &temp_self_port;
50}
51
52%typemap(argout) (bt_self_component_port_output **OUT) {
53 if (*$1) {
54 /* SWIG_Python_AppendOutput() steals the created object */
55 $result = SWIG_Python_AppendOutput($result,
56 SWIG_NewPointerObj(SWIG_as_voidptr(*$1),
57 SWIGTYPE_p_bt_self_component_port_output, 0));
58 } else {
59 /* SWIG_Python_AppendOutput() steals Py_None */
60 Py_INCREF(Py_None);
61 $result = SWIG_Python_AppendOutput($result, Py_None);
62 }
63}
64
65/* From component-const.h */
66
67extern const char *bt_component_get_name(const bt_component *component);
68
69extern const bt_component_class *bt_component_borrow_class_const(
70 const bt_component *component);
71
72extern bt_component_class_type bt_component_get_class_type(
73 const bt_component *component);
74
75bt_bool bt_component_is_source(const bt_component *component);
76
77bt_bool bt_component_is_filter(const bt_component *component);
78
79bt_bool bt_component_is_sink(const bt_component *component);
80
81extern bt_bool bt_component_graph_is_canceled(
82 const bt_component *component);
83
84extern void bt_component_get_ref(const bt_component *component);
85
86extern void bt_component_put_ref(const bt_component *component);
87
88/* From component-source-const.h */
89
90const bt_component *bt_component_source_as_component_const(
91 const bt_component_source *component);
92
93extern uint64_t bt_component_source_get_output_port_count(
94 const bt_component_source *component);
95
96extern const bt_port_output *
97bt_component_source_borrow_output_port_by_name_const(
98 const bt_component_source *component, const char *name);
99
100extern const bt_port_output *
101bt_component_source_borrow_output_port_by_index_const(
102 const bt_component_source *component, uint64_t index);
103
104extern void bt_component_source_get_ref(
105 const bt_component_source *component_source);
106
107extern void bt_component_source_put_ref(
108 const bt_component_source *component_source);
109
110/* From component-filter-const.h */
111
112const bt_component *bt_component_filter_as_component_const(
113 const bt_component_filter *component);
114
115extern uint64_t bt_component_filter_get_input_port_count(
116 const bt_component_filter *component);
117
118extern const bt_port_input *
119bt_component_filter_borrow_input_port_by_name_const(
120 const bt_component_filter *component, const char *name);
121
122extern const bt_port_input *
123bt_component_filter_borrow_input_port_by_index_const(
124 const bt_component_filter *component, uint64_t index);
125
126extern uint64_t bt_component_filter_get_output_port_count(
127 const bt_component_filter *component);
128
129extern const bt_port_output *
130bt_component_filter_borrow_output_port_by_name_const(
131 const bt_component_filter *component, const char *name);
132
133extern const bt_port_output *
134bt_component_filter_borrow_output_port_by_index_const(
135 const bt_component_filter *component, uint64_t index);
136
137extern void bt_component_filter_get_ref(
138 const bt_component_filter *component_filter);
139
140extern void bt_component_filter_put_ref(
141 const bt_component_filter *component_filter);
142
143/* From component-sink-const.h */
144
145const bt_component *bt_component_sink_as_component_const(
146 const bt_component_sink *component);
147
148extern uint64_t bt_component_sink_get_input_port_count(
149 const bt_component_sink *component);
150
151extern const bt_port_input *
152bt_component_sink_borrow_input_port_by_name_const(
153 const bt_component_sink *component, const char *name);
154
155extern const bt_port_input *
156bt_component_sink_borrow_input_port_by_index_const(
157 const bt_component_sink *component, uint64_t index);
158
159extern void bt_component_sink_get_ref(
160 const bt_component_sink *component_sink);
161
162extern void bt_component_sink_put_ref(
163 const bt_component_sink *component_sink);
164
165/* From self-component.h */
166
167typedef enum bt_self_component_status {
168 BT_SELF_COMPONENT_STATUS_OK = 0,
169 BT_SELF_COMPONENT_STATUS_END = 1,
170 BT_SELF_COMPONENT_STATUS_AGAIN = 11,
171 BT_SELF_COMPONENT_STATUS_REFUSE_PORT_CONNECTION = 111,
172 BT_SELF_COMPONENT_STATUS_ERROR = -1,
173 BT_SELF_COMPONENT_STATUS_NOMEM = -12,
174} bt_self_component_status;
175
176const bt_component *bt_self_component_as_component(
177 bt_self_component *self_component);
178
179extern void *bt_self_component_get_data(
180 const bt_self_component *self_component);
181
182extern void bt_self_component_set_data(
183 bt_self_component *self_component, void *data);
184
185/* From self-component-source.h */
186
187bt_self_component *bt_self_component_source_as_self_component(
188 bt_self_component_source *self_comp_source);
189
190const bt_component_source *
191bt_self_component_source_as_component_source(
192 bt_self_component_source *self_comp_source);
193
194extern bt_self_component_port_output *
195bt_self_component_source_borrow_output_port_by_name(
196 bt_self_component_source *self_component,
197 const char *name);
198
199extern bt_self_component_port_output *
200bt_self_component_source_borrow_output_port_by_index(
201 bt_self_component_source *self_component,
202 uint64_t index);
203
204extern bt_self_component_status
205bt_self_component_source_add_output_port(
206 bt_self_component_source *self_component,
207 const char *name, void *user_data,
208 bt_self_component_port_output **OUT);
209
210/* From self-component-filter.h */
211
212bt_self_component *bt_self_component_filter_as_self_component(
213 bt_self_component_filter *self_comp_filter);
214
215const bt_component_filter *
216bt_self_component_filter_as_component_filter(
217 bt_self_component_filter *self_comp_filter);
218
219extern bt_self_component_port_output *
220bt_self_component_filter_borrow_output_port_by_name(
221 bt_self_component_filter *self_component,
222 const char *name);
223
224extern bt_self_component_port_output *
225bt_self_component_filter_borrow_output_port_by_index(
226 bt_self_component_filter *self_component,
227 uint64_t index);
228
229extern bt_self_component_status
230bt_self_component_filter_add_output_port(
231 bt_self_component_filter *self_component,
232 const char *name, void *data,
233 bt_self_component_port_output **OUT);
234
235extern bt_self_component_port_input *
236bt_self_component_filter_borrow_input_port_by_name(
237 bt_self_component_filter *self_component,
238 const char *name);
239
240extern bt_self_component_port_input *
241bt_self_component_filter_borrow_input_port_by_index(
242 bt_self_component_filter *self_component,
243 uint64_t index);
244
245extern bt_self_component_status
246bt_self_component_filter_add_input_port(
247 bt_self_component_filter *self_component,
248 const char *name, void *data,
249 bt_self_component_port_input **OUT);
250
251/* From self-component-sink.h */
252
253bt_self_component *bt_self_component_sink_as_self_component(
254 bt_self_component_sink *self_comp_sink);
255
256const bt_component_sink *
257bt_self_component_sink_as_component_sink(
258 bt_self_component_sink *self_comp_sink);
259
260extern bt_self_component_port_input *
261bt_self_component_sink_borrow_input_port_by_name(
262 bt_self_component_sink *self_component,
263 const char *name);
264
265extern bt_self_component_port_input *
266bt_self_component_sink_borrow_input_port_by_index(
267 bt_self_component_sink *self_component, uint64_t index);
268
269extern bt_self_component_status
270bt_self_component_sink_add_input_port(
271 bt_self_component_sink *self_component,
272 const char *name, void *user_data,
273 bt_self_component_port_input **OUT);
This page took 0.032599 seconds and 4 git commands to generate.