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