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