ef192b8904466c721ef064b2eddb5d001429b016
[babeltrace.git] / src / cpp-common / bt2 / wrap.hpp
1 /*
2 * Copyright (c) 2023 Philippe Proulx <pproulx@efficios.com>
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7 #ifndef BABELTRACE_CPP_COMMON_BT2_WRAP_HPP
8 #define BABELTRACE_CPP_COMMON_BT2_WRAP_HPP
9
10 #include <babeltrace2/babeltrace.h>
11
12 #include "clock-class.hpp"
13 #include "clock-snapshot.hpp"
14 #include "component-port.hpp"
15 #include "error.hpp"
16 #include "field-class.hpp"
17 #include "field-location.hpp"
18 #include "field.hpp"
19 #include "graph.hpp"
20 #include "integer-range-set.hpp"
21 #include "integer-range.hpp"
22 #include "message-iterator.hpp"
23 #include "message.hpp"
24 #include "optional-borrowed-object.hpp"
25 #include "private-query-executor.hpp"
26 #include "self-component-class.hpp"
27 #include "self-component-port.hpp"
28 #include "self-message-iterator-configuration.hpp"
29 #include "self-message-iterator.hpp"
30 #include "trace-ir.hpp"
31 #include "value.hpp"
32
33 namespace bt2 {
34
35 inline ConstErrorCause wrap(const bt_error_cause * const libObjPtr) noexcept
36 {
37 return ConstErrorCause {libObjPtr};
38 }
39
40 inline Graph wrap(bt_graph * const libObjPtr) noexcept
41 {
42 return Graph {libObjPtr};
43 }
44
45 inline ClockClass wrap(bt_clock_class * const libObjPtr) noexcept
46 {
47 return ClockClass {libObjPtr};
48 }
49
50 inline ConstClockClass wrap(const bt_clock_class * const libObjPtr) noexcept
51 {
52 return ConstClockClass {libObjPtr};
53 }
54
55 inline ConstClockSnapshot wrap(const bt_clock_snapshot * const libObjPtr) noexcept
56 {
57 return ConstClockSnapshot {libObjPtr};
58 }
59
60 inline ConstComponent wrap(const bt_component * const libObjPtr) noexcept
61 {
62 return ConstComponent {libObjPtr};
63 }
64
65 inline ConstSourceComponent wrap(const bt_component_source * const libObjPtr) noexcept
66 {
67 return ConstSourceComponent {libObjPtr};
68 }
69
70 inline ConstFilterComponent wrap(const bt_component_filter * const libObjPtr) noexcept
71 {
72 return ConstFilterComponent {libObjPtr};
73 }
74
75 inline ConstSinkComponent wrap(const bt_component_sink * const libObjPtr) noexcept
76 {
77 return ConstSinkComponent {libObjPtr};
78 }
79
80 inline ConstInputPort wrap(const bt_port_input * const libObjPtr) noexcept
81 {
82 return ConstInputPort {libObjPtr};
83 }
84
85 inline ConstOutputPort wrap(const bt_port_output * const libObjPtr) noexcept
86 {
87 return ConstOutputPort {libObjPtr};
88 }
89
90 inline ConstUnsignedEnumerationFieldClassMapping
91 wrap(const bt_field_class_enumeration_unsigned_mapping * const libObjPtr) noexcept
92 {
93 return ConstUnsignedEnumerationFieldClassMapping {libObjPtr};
94 }
95
96 inline ConstSignedEnumerationFieldClassMapping
97 wrap(const bt_field_class_enumeration_signed_mapping * const libObjPtr) noexcept
98 {
99 return ConstSignedEnumerationFieldClassMapping {libObjPtr};
100 }
101
102 inline VariantFieldClassOption wrap(bt_field_class_variant_option * const libObjPtr) noexcept
103 {
104 return VariantFieldClassOption {libObjPtr};
105 }
106
107 inline ConstVariantFieldClassOption
108 wrap(const bt_field_class_variant_option * const libObjPtr) noexcept
109 {
110 return ConstVariantFieldClassOption {libObjPtr};
111 }
112
113 inline ConstVariantWithUnsignedIntegerSelectorFieldClassOption
114 wrap(const bt_field_class_variant_with_selector_field_integer_unsigned_option
115 * const libObjPtr) noexcept
116 {
117 return ConstVariantWithUnsignedIntegerSelectorFieldClassOption {libObjPtr};
118 }
119
120 inline ConstVariantWithSignedIntegerSelectorFieldClassOption
121 wrap(const bt_field_class_variant_with_selector_field_integer_signed_option
122 * const libObjPtr) noexcept
123 {
124 return ConstVariantWithSignedIntegerSelectorFieldClassOption {libObjPtr};
125 }
126
127 inline FieldClass wrap(bt_field_class * const libObjPtr) noexcept
128 {
129 return FieldClass {libObjPtr};
130 }
131
132 inline ConstFieldClass wrap(const bt_field_class * const libObjPtr) noexcept
133 {
134 return ConstFieldClass {libObjPtr};
135 }
136
137 inline ConstFieldPathItem wrap(const bt_field_path_item * const libObjPtr) noexcept
138 {
139 return ConstFieldPathItem {libObjPtr};
140 }
141
142 inline ConstFieldLocation wrap(const bt_field_location * const libObjPtr) noexcept
143 {
144 return ConstFieldLocation {libObjPtr};
145 }
146
147 inline ConstFieldPath wrap(const bt_field_path * const libObjPtr) noexcept
148 {
149 return ConstFieldPath {libObjPtr};
150 }
151
152 inline Field wrap(bt_field * const libObjPtr) noexcept
153 {
154 return Field {libObjPtr};
155 }
156
157 inline ConstField wrap(const bt_field * const libObjPtr) noexcept
158 {
159 return ConstField {libObjPtr};
160 }
161
162 inline UnsignedIntegerRangeSet wrap(bt_integer_range_set_unsigned * const libObjPtr) noexcept
163 {
164 return UnsignedIntegerRangeSet {libObjPtr};
165 }
166
167 inline ConstUnsignedIntegerRangeSet
168 wrap(const bt_integer_range_set_unsigned * const libObjPtr) noexcept
169 {
170 return ConstUnsignedIntegerRangeSet {libObjPtr};
171 }
172
173 inline SignedIntegerRangeSet wrap(bt_integer_range_set_signed * const libObjPtr) noexcept
174 {
175 return SignedIntegerRangeSet {libObjPtr};
176 }
177
178 inline ConstSignedIntegerRangeSet wrap(const bt_integer_range_set_signed * const libObjPtr) noexcept
179 {
180 return ConstSignedIntegerRangeSet {libObjPtr};
181 }
182
183 inline ConstUnsignedIntegerRange wrap(const bt_integer_range_unsigned * const libObjPtr) noexcept
184 {
185 return ConstUnsignedIntegerRange {libObjPtr};
186 }
187
188 inline ConstSignedIntegerRange wrap(const bt_integer_range_signed * const libObjPtr) noexcept
189 {
190 return ConstSignedIntegerRange {libObjPtr};
191 }
192
193 inline MessageIterator wrap(bt_message_iterator * const libObjPtr) noexcept
194 {
195 return MessageIterator {libObjPtr};
196 }
197
198 inline Message wrap(bt_message * const libObjPtr) noexcept
199 {
200 return Message {libObjPtr};
201 }
202
203 inline ConstMessage wrap(const bt_message * const libObjPtr) noexcept
204 {
205 return ConstMessage {libObjPtr};
206 }
207
208 inline PrivateQueryExecutor wrap(bt_private_query_executor * const libObjPtr) noexcept
209 {
210 return PrivateQueryExecutor {libObjPtr};
211 }
212
213 inline SelfComponentClass wrap(bt_self_component_class * const libObjPtr) noexcept
214 {
215 return SelfComponentClass {libObjPtr};
216 }
217
218 inline SelfComponentClass wrap(bt_self_component_class_source * const libObjPtr) noexcept
219 {
220 return SelfComponentClass {libObjPtr};
221 }
222
223 inline SelfComponentClass wrap(bt_self_component_class_filter * const libObjPtr) noexcept
224 {
225 return SelfComponentClass {libObjPtr};
226 }
227
228 inline SelfComponentClass wrap(bt_self_component_class_sink * const libObjPtr) noexcept
229 {
230 return SelfComponentClass {libObjPtr};
231 }
232
233 inline SelfComponent wrap(bt_self_component * const libObjPtr) noexcept
234 {
235 return SelfComponent {libObjPtr};
236 }
237
238 inline SelfSourceComponent wrap(bt_self_component_source * const libObjPtr) noexcept
239 {
240 return SelfSourceComponent {libObjPtr};
241 }
242
243 inline SelfFilterComponent wrap(bt_self_component_filter * const libObjPtr) noexcept
244 {
245 return SelfFilterComponent {libObjPtr};
246 }
247
248 inline SelfSinkComponent wrap(bt_self_component_sink * const libObjPtr) noexcept
249 {
250 return SelfSinkComponent {libObjPtr};
251 }
252
253 inline SelfComponentInputPort wrap(bt_self_component_port_input * const libObjPtr) noexcept
254 {
255 return SelfComponentInputPort {libObjPtr};
256 }
257
258 inline SelfComponentOutputPort wrap(bt_self_component_port_output * const libObjPtr) noexcept
259 {
260 return SelfComponentOutputPort {libObjPtr};
261 }
262
263 inline SelfMessageIterator wrap(bt_self_message_iterator * const libObjPtr) noexcept
264 {
265 return SelfMessageIterator {libObjPtr};
266 }
267
268 inline SelfMessageIteratorConfiguration
269 wrap(bt_self_message_iterator_configuration * const libObjPtr) noexcept
270 {
271 return SelfMessageIteratorConfiguration {libObjPtr};
272 }
273
274 inline Event wrap(bt_event * const libObjPtr) noexcept
275 {
276 return Event {libObjPtr};
277 }
278
279 inline ConstEvent wrap(const bt_event * const libObjPtr) noexcept
280 {
281 return ConstEvent {libObjPtr};
282 }
283
284 inline Packet wrap(bt_packet * const libObjPtr) noexcept
285 {
286 return Packet {libObjPtr};
287 }
288
289 inline ConstPacket wrap(const bt_packet * const libObjPtr) noexcept
290 {
291 return ConstPacket {libObjPtr};
292 }
293
294 inline Stream wrap(bt_stream * const libObjPtr) noexcept
295 {
296 return Stream {libObjPtr};
297 }
298
299 inline ConstStream wrap(const bt_stream * const libObjPtr) noexcept
300 {
301 return ConstStream {libObjPtr};
302 }
303
304 inline Trace wrap(bt_trace * const libObjPtr) noexcept
305 {
306 return Trace {libObjPtr};
307 }
308
309 inline ConstTrace wrap(const bt_trace * const libObjPtr) noexcept
310 {
311 return ConstTrace {libObjPtr};
312 }
313
314 inline EventClass wrap(bt_event_class * const libObjPtr) noexcept
315 {
316 return EventClass {libObjPtr};
317 }
318
319 inline ConstEventClass wrap(const bt_event_class * const libObjPtr) noexcept
320 {
321 return ConstEventClass {libObjPtr};
322 }
323
324 inline StreamClass wrap(bt_stream_class * const libObjPtr) noexcept
325 {
326 return StreamClass {libObjPtr};
327 }
328
329 inline ConstStreamClass wrap(const bt_stream_class * const libObjPtr) noexcept
330 {
331 return ConstStreamClass {libObjPtr};
332 }
333
334 inline TraceClass wrap(bt_trace_class * const libObjPtr) noexcept
335 {
336 return TraceClass {libObjPtr};
337 }
338
339 inline ConstTraceClass wrap(const bt_trace_class * const libObjPtr) noexcept
340 {
341 return ConstTraceClass {libObjPtr};
342 }
343
344 inline Value wrap(bt_value * const libObjPtr) noexcept
345 {
346 return Value {libObjPtr};
347 }
348
349 inline ConstValue wrap(const bt_value * const libObjPtr) noexcept
350 {
351 return ConstValue {libObjPtr};
352 }
353
354 inline OptionalBorrowedObject<ClockClass> wrapOptional(bt_clock_class * const libObjPtr) noexcept
355 {
356 return libObjPtr;
357 }
358
359 inline OptionalBorrowedObject<ConstClockClass>
360 wrapOptional(const bt_clock_class * const libObjPtr) noexcept
361 {
362 return libObjPtr;
363 }
364
365 inline OptionalBorrowedObject<ConstClockSnapshot>
366 wrapOptional(const bt_clock_snapshot * const libObjPtr) noexcept
367 {
368 return libObjPtr;
369 }
370
371 inline OptionalBorrowedObject<ConstComponent>
372 wrapOptional(const bt_component * const libObjPtr) noexcept
373 {
374 return libObjPtr;
375 }
376
377 inline OptionalBorrowedObject<ConstSourceComponent>
378 wrapOptional(const bt_component_source * const libObjPtr) noexcept
379 {
380 return libObjPtr;
381 }
382
383 inline OptionalBorrowedObject<ConstFilterComponent>
384 wrapOptional(const bt_component_filter * const libObjPtr) noexcept
385 {
386 return libObjPtr;
387 }
388
389 inline OptionalBorrowedObject<ConstSinkComponent>
390 wrapOptional(const bt_component_sink * const libObjPtr) noexcept
391 {
392 return libObjPtr;
393 }
394
395 inline OptionalBorrowedObject<ConstInputPort>
396 wrapOptional(const bt_port_input * const libObjPtr) noexcept
397 {
398 return libObjPtr;
399 }
400
401 inline OptionalBorrowedObject<ConstOutputPort>
402 wrapOptional(const bt_port_output * const libObjPtr) noexcept
403 {
404 return libObjPtr;
405 }
406
407 inline OptionalBorrowedObject<FieldClass> wrapOptional(bt_field_class * const libObjPtr) noexcept
408 {
409 return libObjPtr;
410 }
411
412 inline OptionalBorrowedObject<ConstFieldClass>
413 wrapOptional(const bt_field_class * const libObjPtr) noexcept
414 {
415 return libObjPtr;
416 }
417
418 inline OptionalBorrowedObject<ConstFieldPathItem>
419 wrapOptional(const bt_field_path_item * const libObjPtr) noexcept
420 {
421 return libObjPtr;
422 }
423
424 inline OptionalBorrowedObject<ConstFieldPath>
425 wrapOptional(const bt_field_path * const libObjPtr) noexcept
426 {
427 return libObjPtr;
428 }
429
430 inline OptionalBorrowedObject<Field> wrapOptional(bt_field * const libObjPtr) noexcept
431 {
432 return libObjPtr;
433 }
434
435 inline OptionalBorrowedObject<ConstField> wrapOptional(const bt_field * const libObjPtr) noexcept
436 {
437 return libObjPtr;
438 }
439
440 inline OptionalBorrowedObject<UnsignedIntegerRangeSet>
441 wrapOptional(bt_integer_range_set_unsigned * const libObjPtr) noexcept
442 {
443 return libObjPtr;
444 }
445
446 inline OptionalBorrowedObject<ConstUnsignedIntegerRangeSet>
447 wrapOptional(const bt_integer_range_set_unsigned * const libObjPtr) noexcept
448 {
449 return libObjPtr;
450 }
451
452 inline OptionalBorrowedObject<SignedIntegerRangeSet>
453 wrapOptional(bt_integer_range_set_signed * const libObjPtr) noexcept
454 {
455 return libObjPtr;
456 }
457
458 inline OptionalBorrowedObject<ConstSignedIntegerRangeSet>
459 wrapOptional(const bt_integer_range_set_signed * const libObjPtr) noexcept
460 {
461 return libObjPtr;
462 }
463
464 inline OptionalBorrowedObject<ConstUnsignedIntegerRange>
465 wrapOptional(const bt_integer_range_unsigned * const libObjPtr) noexcept
466 {
467 return libObjPtr;
468 }
469
470 inline OptionalBorrowedObject<ConstSignedIntegerRange>
471 wrapOptional(const bt_integer_range_signed * const libObjPtr) noexcept
472 {
473 return libObjPtr;
474 }
475
476 inline OptionalBorrowedObject<MessageIterator>
477 wrapOptional(bt_message_iterator * const libObjPtr) noexcept
478 {
479 return libObjPtr;
480 }
481
482 inline OptionalBorrowedObject<Message> wrapOptional(bt_message * const libObjPtr) noexcept
483 {
484 return libObjPtr;
485 }
486
487 inline OptionalBorrowedObject<ConstMessage>
488 wrapOptional(const bt_message * const libObjPtr) noexcept
489 {
490 return libObjPtr;
491 }
492
493 inline OptionalBorrowedObject<PrivateQueryExecutor>
494 wrapOptional(bt_private_query_executor * const libObjPtr) noexcept
495 {
496 return libObjPtr;
497 }
498
499 inline OptionalBorrowedObject<SelfComponentClass>
500 wrapOptional(bt_self_component_class * const libObjPtr) noexcept
501 {
502 return libObjPtr;
503 }
504
505 inline OptionalBorrowedObject<SelfComponentClass>
506 wrapOptional(bt_self_component_class_source * const libObjPtr) noexcept
507 {
508 return bt_self_component_class_source_as_self_component_class(libObjPtr);
509 }
510
511 inline OptionalBorrowedObject<SelfComponentClass>
512 wrapOptional(bt_self_component_class_filter * const libObjPtr) noexcept
513 {
514 return bt_self_component_class_filter_as_self_component_class(libObjPtr);
515 }
516
517 inline OptionalBorrowedObject<SelfComponentClass>
518 wrapOptional(bt_self_component_class_sink * const libObjPtr) noexcept
519 {
520 return bt_self_component_class_sink_as_self_component_class(libObjPtr);
521 }
522
523 inline OptionalBorrowedObject<SelfComponent>
524 wrapOptional(bt_self_component * const libObjPtr) noexcept
525 {
526 return libObjPtr;
527 }
528
529 inline OptionalBorrowedObject<SelfSourceComponent>
530 wrapOptional(bt_self_component_source * const libObjPtr) noexcept
531 {
532 return libObjPtr;
533 }
534
535 inline OptionalBorrowedObject<SelfFilterComponent>
536 wrapOptional(bt_self_component_filter * const libObjPtr) noexcept
537 {
538 return libObjPtr;
539 }
540
541 inline OptionalBorrowedObject<SelfSinkComponent>
542 wrapOptional(bt_self_component_sink * const libObjPtr) noexcept
543 {
544 return libObjPtr;
545 }
546
547 inline OptionalBorrowedObject<SelfComponentInputPort>
548 wrapOptional(bt_self_component_port_input * const libObjPtr) noexcept
549 {
550 return libObjPtr;
551 }
552
553 inline OptionalBorrowedObject<SelfComponentOutputPort>
554 wrapOptional(bt_self_component_port_output * const libObjPtr) noexcept
555 {
556 return libObjPtr;
557 }
558
559 inline OptionalBorrowedObject<SelfMessageIterator>
560 wrapOptional(bt_self_message_iterator * const libObjPtr) noexcept
561 {
562 return libObjPtr;
563 }
564
565 inline OptionalBorrowedObject<SelfMessageIteratorConfiguration>
566 wrapOptional(bt_self_message_iterator_configuration * const libObjPtr) noexcept
567 {
568 return libObjPtr;
569 }
570
571 inline OptionalBorrowedObject<Event> wrapOptional(bt_event * const libObjPtr) noexcept
572 {
573 return libObjPtr;
574 }
575
576 inline OptionalBorrowedObject<ConstEvent> wrapOptional(const bt_event * const libObjPtr) noexcept
577 {
578 return libObjPtr;
579 }
580
581 inline OptionalBorrowedObject<Packet> wrapOptional(bt_packet * const libObjPtr) noexcept
582 {
583 return libObjPtr;
584 }
585
586 inline OptionalBorrowedObject<ConstPacket> wrapOptional(const bt_packet * const libObjPtr) noexcept
587 {
588 return libObjPtr;
589 }
590
591 inline OptionalBorrowedObject<Stream> wrapOptional(bt_stream * const libObjPtr) noexcept
592 {
593 return libObjPtr;
594 }
595
596 inline OptionalBorrowedObject<ConstStream> wrapOptional(const bt_stream * const libObjPtr) noexcept
597 {
598 return libObjPtr;
599 }
600
601 inline OptionalBorrowedObject<Trace> wrapOptional(bt_trace * const libObjPtr) noexcept
602 {
603 return libObjPtr;
604 }
605
606 inline OptionalBorrowedObject<ConstTrace> wrapOptional(const bt_trace * const libObjPtr) noexcept
607 {
608 return libObjPtr;
609 }
610
611 inline OptionalBorrowedObject<EventClass> wrapOptional(bt_event_class * const libObjPtr) noexcept
612 {
613 return libObjPtr;
614 }
615
616 inline OptionalBorrowedObject<ConstEventClass>
617 wrapOptional(const bt_event_class * const libObjPtr) noexcept
618 {
619 return libObjPtr;
620 }
621
622 inline OptionalBorrowedObject<StreamClass> wrapOptional(bt_stream_class * const libObjPtr) noexcept
623 {
624 return libObjPtr;
625 }
626
627 inline OptionalBorrowedObject<ConstStreamClass>
628 wrapOptional(const bt_stream_class * const libObjPtr) noexcept
629 {
630 return libObjPtr;
631 }
632
633 inline OptionalBorrowedObject<TraceClass> wrapOptional(bt_trace_class * const libObjPtr) noexcept
634 {
635 return libObjPtr;
636 }
637
638 inline OptionalBorrowedObject<ConstTraceClass>
639 wrapOptional(const bt_trace_class * const libObjPtr) noexcept
640 {
641 return libObjPtr;
642 }
643
644 inline OptionalBorrowedObject<Value> wrapOptional(bt_value * const libObjPtr) noexcept
645 {
646 return libObjPtr;
647 }
648
649 inline OptionalBorrowedObject<ConstValue> wrapOptional(const bt_value * const libObjPtr) noexcept
650 {
651 return libObjPtr;
652 }
653
654 } /* namespace bt2 */
655
656 #endif /* BABELTRACE_CPP_COMMON_BT2_WRAP_HPP */
This page took 0.044029 seconds and 5 git commands to generate.