bt2: Adapt test_message.py and make it pass
[babeltrace.git] / bindings / python / bt2 / bt2 / native_bt_message.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
9ec609ec
SM
25
26/* Output argument typemap for clock value output (always appends) */
27%typemap(in, numinputs=0)
28 (const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT)
29 (bt_clock_snapshot *temp_clock_snapshot = NULL) {
30 $1 = &temp_clock_snapshot;
31}
32
33%typemap(argout)
34 (const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT) {
35 if (*$1) {
36 /* SWIG_Python_AppendOutput() steals the created object */
37 $result = SWIG_Python_AppendOutput($result,
38 SWIG_NewPointerObj(SWIG_as_voidptr(*$1),
39 SWIGTYPE_p_bt_clock_snapshot, 0));
40 } else {
41 /* SWIG_Python_AppendOutput() steals Py_None */
42 Py_INCREF(Py_None);
43 $result = SWIG_Python_AppendOutput($result, Py_None);
44 }
45}
46
6945df9a
SM
47/* From message-const.h */
48
49typedef enum bt_message_type {
50 BT_MESSAGE_TYPE_EVENT = 0,
51 BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY = 1,
52 BT_MESSAGE_TYPE_STREAM_BEGINNING = 2,
53 BT_MESSAGE_TYPE_STREAM_END = 3,
54 BT_MESSAGE_TYPE_PACKET_BEGINNING = 4,
55 BT_MESSAGE_TYPE_PACKET_END = 5,
56 BT_MESSAGE_TYPE_STREAM_ACTIVITY_BEGINNING = 6,
57 BT_MESSAGE_TYPE_STREAM_ACTIVITY_END = 7,
58 BT_MESSAGE_TYPE_DISCARDED_EVENTS = 8,
59 BT_MESSAGE_TYPE_DISCARDED_PACKETS = 9,
60} bt_message_type;
61
62extern bt_message_type bt_message_get_type(const bt_message *message);
63
64extern void bt_message_get_ref(const bt_message *message);
65
66extern void bt_message_put_ref(const bt_message *message);
67
68/* From message-event-const.h */
69
70extern const bt_event *bt_message_event_borrow_event_const(
71 const bt_message *message);
72
0cbc2c33 73extern const bt_clock_snapshot *
6945df9a 74bt_message_event_borrow_default_clock_snapshot_const(
0cbc2c33 75 const bt_message *msg);
6945df9a
SM
76
77extern const bt_clock_class *
78bt_message_event_borrow_stream_class_default_clock_class_const(
79 const bt_message *msg);
80
81/* From message-event.h */
82
83extern
84bt_message *bt_message_event_create(
85 bt_self_message_iterator *message_iterator,
86 const bt_event_class *event_class,
87 const bt_packet *packet);
88
89extern
90bt_message *bt_message_event_create_with_default_clock_snapshot(
91 bt_self_message_iterator *message_iterator,
92 const bt_event_class *event_class,
93 const bt_packet *packet, uint64_t raw_clock_value);
94
95extern bt_event *bt_message_event_borrow_event(
96 bt_message *message);
97
98/* From message-message-iterator-inactivity-const.h */
99
0cbc2c33 100extern const bt_clock_snapshot *
6945df9a 101bt_message_message_iterator_inactivity_borrow_default_clock_snapshot_const(
0cbc2c33 102 const bt_message *msg);
6945df9a
SM
103
104/* From message-message-iterator-inactivity.h */
105
106extern
107bt_message *bt_message_message_iterator_inactivity_create(
108 bt_self_message_iterator *message_iterator,
109 const bt_clock_class *default_clock_class, uint64_t raw_value);
110
111/* From message-stream-beginning-const.h */
112
113extern const bt_stream *bt_message_stream_beginning_borrow_stream_const(
114 const bt_message *message);
115
116/* From message-stream-beginning.h */
117
118extern
119bt_message *bt_message_stream_beginning_create(
120 bt_self_message_iterator *message_iterator,
121 const bt_stream *stream);
122
123extern bt_stream *bt_message_stream_beginning_borrow_stream(
124 bt_message *message);
125
126/* From message-stream-end-const.h */
127
128extern const bt_stream *bt_message_stream_end_borrow_stream_const(
129 const bt_message *message);
130
131/* From message-stream-end.h */
132
133extern
134bt_message *bt_message_stream_end_create(
135 bt_self_message_iterator *message_iterator,
136 const bt_stream *stream);
137
138extern bt_stream *bt_message_stream_end_borrow_stream(
139 bt_message *message);
140
141/* From message-packet-beginning-const.h */
142
143extern const bt_packet *bt_message_packet_beginning_borrow_packet_const(
144 const bt_message *message);
145
0cbc2c33 146extern const bt_clock_snapshot *
6945df9a 147bt_message_packet_beginning_borrow_default_clock_snapshot_const(
0cbc2c33 148 const bt_message *msg);
6945df9a
SM
149
150extern const bt_clock_class *
151bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(
152 const bt_message *msg);
153
154/* From message-packet-beginning.h */
155
156extern
157bt_message *bt_message_packet_beginning_create(
158 bt_self_message_iterator *message_iterator,
159 const bt_packet *packet);
160
161extern
162bt_message *bt_message_packet_beginning_create_with_default_clock_snapshot(
163 bt_self_message_iterator *message_iterator,
164 const bt_packet *packet, uint64_t raw_value);
165
166extern bt_packet *bt_message_packet_beginning_borrow_packet(
167 bt_message *message);
168
169/* From message-packet-end-const.h */
170
171extern const bt_packet *bt_message_packet_end_borrow_packet_const(
172 const bt_message *message);
173
0cbc2c33 174extern const bt_clock_snapshot *
6945df9a 175bt_message_packet_end_borrow_default_clock_snapshot_const(
0cbc2c33 176 const bt_message *msg);
6945df9a
SM
177
178extern const bt_clock_class *
179bt_message_packet_end_borrow_stream_class_default_clock_class_const(
180 const bt_message *msg);
181
182/* From message-packet-end.h */
183
184extern
185bt_message *bt_message_packet_end_create(
186 bt_self_message_iterator *message_iterator,
187 const bt_packet *packet);
188
189extern
190bt_message *bt_message_packet_end_create_with_default_clock_snapshot(
191 bt_self_message_iterator *message_iterator,
192 const bt_packet *packet, uint64_t raw_value);
193
194extern bt_packet *bt_message_packet_end_borrow_packet(
195 bt_message *message);
196
197/* From message-stream-activity-const.h */
198
199typedef enum bt_message_stream_activity_clock_snapshot_state {
200 BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_KNOWN,
201 BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_UNKNOWN,
202 BT_MESSAGE_STREAM_ACTIVITY_CLOCK_SNAPSHOT_STATE_INFINITE,
203} bt_message_stream_activity_clock_snapshot_state;
204
205/* From message-stream-activity-beginning-const.h */
206
207extern bt_message_stream_activity_clock_snapshot_state
208bt_message_stream_activity_beginning_borrow_default_clock_snapshot_const(
209 const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
210
211extern const bt_clock_class *
212bt_message_stream_activity_beginning_borrow_stream_class_default_clock_class_const(
213 const bt_message *msg);
214
215extern const bt_stream *
216bt_message_stream_activity_beginning_borrow_stream_const(
217 const bt_message *message);
218
219/* From message-stream-activity-beginning.h */
220
221extern bt_message *bt_message_stream_activity_beginning_create(
222 bt_self_message_iterator *message_iterator,
223 const bt_stream *stream);
224
225extern bt_stream *bt_message_stream_activity_beginning_borrow_stream(
226 bt_message *message);
227
228extern void bt_message_stream_activity_beginning_set_default_clock_snapshot_state(
229 bt_message *msg,
230 bt_message_stream_activity_clock_snapshot_state state);
231
232extern void bt_message_stream_activity_beginning_set_default_clock_snapshot(
233 bt_message *msg, uint64_t raw_value);
234
235/* From message-stream-activity-end-const.h */
236
237extern bt_message_stream_activity_clock_snapshot_state
238bt_message_stream_activity_end_borrow_default_clock_snapshot_const(
239 const bt_message *msg, const bt_clock_snapshot **BTOUTCLOCKSNAPSHOT);
240
241extern const bt_clock_class *
242bt_message_stream_activity_end_borrow_stream_class_default_clock_class_const(
243 const bt_message *msg);
244
245extern const bt_stream *
246bt_message_stream_activity_end_borrow_stream_const(
247 const bt_message *message);
248
249/* From message-stream-activity-end.h */
250
251extern bt_message *bt_message_stream_activity_end_create(
252 bt_self_message_iterator *message_iterator,
253 const bt_stream *stream);
254
255extern void bt_message_stream_activity_end_set_default_clock_snapshot_state(
256 bt_message *msg,
257 bt_message_stream_activity_clock_snapshot_state state);
258
259extern void bt_message_stream_activity_end_set_default_clock_snapshot(
260 bt_message *msg, uint64_t raw_value);
261
262extern bt_stream *bt_message_stream_activity_end_borrow_stream(
263 bt_message *message);
264
265/* From message-discarded-events-const.h */
266
0cbc2c33 267extern const bt_clock_snapshot *
6945df9a 268bt_message_discarded_events_borrow_default_beginning_clock_snapshot_const(
0cbc2c33 269 const bt_message *msg);
6945df9a 270
0cbc2c33 271extern const bt_clock_snapshot *
6945df9a 272bt_message_discarded_events_borrow_default_end_clock_snapshot_const(
0cbc2c33 273 const bt_message *msg);
6945df9a
SM
274
275extern const bt_clock_class *
276bt_message_discarded_events_borrow_stream_class_default_clock_class_const(
277 const bt_message *msg);
278
279extern const bt_stream *
280bt_message_discarded_events_borrow_stream_const(const bt_message *message);
281
282extern bt_property_availability bt_message_discarded_events_get_count(
283 const bt_message *message, uint64_t *OUT);
284
285/* From message-discarded-events.h */
286
287extern bt_message *bt_message_discarded_events_create(
288 bt_self_message_iterator *message_iterator,
289 const bt_stream *stream);
290
291extern bt_message *bt_message_discarded_events_create_with_default_clock_snapshots(
292 bt_self_message_iterator *message_iterator,
293 const bt_stream *stream, uint64_t beginning_raw_value,
294 uint64_t end_raw_value);
295
296extern bt_stream *bt_message_discarded_events_borrow_stream(
297 bt_message *message);
298
299extern void bt_message_discarded_events_set_count(bt_message *message,
300 uint64_t count);
301
302/* From message-discarded-packets-const.h */
303
0cbc2c33 304extern const bt_clock_snapshot *
6945df9a 305bt_message_discarded_packets_borrow_default_beginning_clock_snapshot_const(
0cbc2c33 306 const bt_message *msg);
6945df9a 307
0cbc2c33 308extern const bt_clock_snapshot *
6945df9a 309bt_message_discarded_packets_borrow_default_end_clock_snapshot_const(
0cbc2c33 310 const bt_message *msg);
6945df9a
SM
311
312extern const bt_clock_class *
313bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(
314 const bt_message *msg);
315
316extern const bt_stream *
317bt_message_discarded_packets_borrow_stream_const(const bt_message *message);
318
319extern bt_property_availability bt_message_discarded_packets_get_count(
320 const bt_message *message, uint64_t *OUT);
321
322/* From message-discarded-packets.h */
323
324extern bt_message *bt_message_discarded_packets_create(
325 bt_self_message_iterator *message_iterator,
326 const bt_stream *stream);
327
328extern bt_message *bt_message_discarded_packets_create_with_default_clock_snapshots(
329 bt_self_message_iterator *message_iterator,
330 const bt_stream *stream, uint64_t beginning_raw_value,
331 uint64_t end_raw_value);
332
333extern bt_stream *bt_message_discarded_packets_borrow_stream(
334 bt_message *message);
335
336extern void bt_message_discarded_packets_set_count(bt_message *message,
337 uint64_t count);
This page took 0.036189 seconds and 4 git commands to generate.