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