2 * Copyright (c) 2023 Philippe Proulx <pproulx@efficios.com>
4 * SPDX-License-Identifier: MIT
7 #ifndef BABELTRACE_CPP_COMMON_BT2_WRAP_HPP
8 #define BABELTRACE_CPP_COMMON_BT2_WRAP_HPP
10 #include <babeltrace2/babeltrace.h>
12 #include "clock-class.hpp"
13 #include "clock-snapshot.hpp"
14 #include "component-port.hpp"
15 #include "field-class.hpp"
17 #include "integer-range-set.hpp"
18 #include "integer-range.hpp"
19 #include "message-iterator.hpp"
20 #include "message.hpp"
21 #include "private-query-executor.hpp"
22 #include "self-component-class.hpp"
23 #include "self-component-port.hpp"
24 #include "self-message-iterator-configuration.hpp"
25 #include "self-message-iterator.hpp"
26 #include "trace-ir.hpp"
31 inline ClockClass wrap(bt_clock_class * const libObjPtr) noexcept
33 return ClockClass {libObjPtr};
36 inline ConstClockClass wrap(const bt_clock_class * const libObjPtr) noexcept
38 return ConstClockClass {libObjPtr};
41 inline ConstClockSnapshot wrap(const bt_clock_snapshot * const libObjPtr) noexcept
43 return ConstClockSnapshot {libObjPtr};
46 inline ConstComponent wrap(const bt_component * const libObjPtr) noexcept
48 return ConstComponent {libObjPtr};
51 inline ConstSourceComponent wrap(const bt_component_source * const libObjPtr) noexcept
53 return ConstSourceComponent {libObjPtr};
56 inline ConstFilterComponent wrap(const bt_component_filter * const libObjPtr) noexcept
58 return ConstFilterComponent {libObjPtr};
61 inline ConstSinkComponent wrap(const bt_component_sink * const libObjPtr) noexcept
63 return ConstSinkComponent {libObjPtr};
66 inline ConstInputPort wrap(const bt_port_input * const libObjPtr) noexcept
68 return ConstInputPort {libObjPtr};
71 inline ConstOutputPort wrap(const bt_port_output * const libObjPtr) noexcept
73 return ConstOutputPort {libObjPtr};
76 inline FieldClass wrap(bt_field_class * const libObjPtr) noexcept
78 return FieldClass {libObjPtr};
81 inline ConstFieldClass wrap(const bt_field_class * const libObjPtr) noexcept
83 return ConstFieldClass {libObjPtr};
86 inline ConstFieldPathItem wrap(const bt_field_path_item * const libObjPtr) noexcept
88 return ConstFieldPathItem {libObjPtr};
91 inline ConstFieldPath wrap(const bt_field_path * const libObjPtr) noexcept
93 return ConstFieldPath {libObjPtr};
96 inline Field wrap(bt_field * const libObjPtr) noexcept
98 return Field {libObjPtr};
101 inline ConstField wrap(const bt_field * const libObjPtr) noexcept
103 return ConstField {libObjPtr};
106 inline UnsignedIntegerRangeSet wrap(bt_integer_range_set_unsigned * const libObjPtr) noexcept
108 return UnsignedIntegerRangeSet {libObjPtr};
111 inline ConstUnsignedIntegerRangeSet
112 wrap(const bt_integer_range_set_unsigned * const libObjPtr) noexcept
114 return ConstUnsignedIntegerRangeSet {libObjPtr};
117 inline SignedIntegerRangeSet wrap(bt_integer_range_set_signed * const libObjPtr) noexcept
119 return SignedIntegerRangeSet {libObjPtr};
122 inline ConstSignedIntegerRangeSet wrap(const bt_integer_range_set_signed * const libObjPtr) noexcept
124 return ConstSignedIntegerRangeSet {libObjPtr};
127 inline ConstUnsignedIntegerRange wrap(const bt_integer_range_unsigned * const libObjPtr) noexcept
129 return ConstUnsignedIntegerRange {libObjPtr};
132 inline ConstSignedIntegerRange wrap(const bt_integer_range_signed * const libObjPtr) noexcept
134 return ConstSignedIntegerRange {libObjPtr};
137 inline MessageIterator wrap(bt_message_iterator * const libObjPtr) noexcept
139 return MessageIterator {libObjPtr};
142 inline Message wrap(bt_message * const libObjPtr) noexcept
144 return Message {libObjPtr};
147 inline ConstMessage wrap(const bt_message * const libObjPtr) noexcept
149 return ConstMessage {libObjPtr};
152 inline PrivateQueryExecutor wrap(bt_private_query_executor * const libObjPtr) noexcept
154 return PrivateQueryExecutor {libObjPtr};
157 inline SelfComponentClass wrap(bt_self_component_class * const libObjPtr) noexcept
159 return SelfComponentClass {libObjPtr};
162 inline SelfComponentClass wrap(bt_self_component_class_source * const libObjPtr) noexcept
164 return SelfComponentClass {libObjPtr};
167 inline SelfComponentClass wrap(bt_self_component_class_filter * const libObjPtr) noexcept
169 return SelfComponentClass {libObjPtr};
172 inline SelfComponentClass wrap(bt_self_component_class_sink * const libObjPtr) noexcept
174 return SelfComponentClass {libObjPtr};
177 inline SelfComponent wrap(bt_self_component * const libObjPtr) noexcept
179 return SelfComponent {libObjPtr};
182 inline SelfSourceComponent wrap(bt_self_component_source * const libObjPtr) noexcept
184 return SelfSourceComponent {libObjPtr};
187 inline SelfFilterComponent wrap(bt_self_component_filter * const libObjPtr) noexcept
189 return SelfFilterComponent {libObjPtr};
192 inline SelfSinkComponent wrap(bt_self_component_sink * const libObjPtr) noexcept
194 return SelfSinkComponent {libObjPtr};
197 inline SelfComponentInputPort wrap(bt_self_component_port_input * const libObjPtr) noexcept
199 return SelfComponentInputPort {libObjPtr};
202 inline SelfComponentOutputPort wrap(bt_self_component_port_output * const libObjPtr) noexcept
204 return SelfComponentOutputPort {libObjPtr};
207 inline SelfMessageIterator wrap(bt_self_message_iterator * const libObjPtr) noexcept
209 return SelfMessageIterator {libObjPtr};
212 inline SelfMessageIteratorConfiguration
213 wrap(bt_self_message_iterator_configuration * const libObjPtr) noexcept
215 return SelfMessageIteratorConfiguration {libObjPtr};
218 inline Event wrap(bt_event * const libObjPtr) noexcept
220 return Event {libObjPtr};
223 inline ConstEvent wrap(const bt_event * const libObjPtr) noexcept
225 return ConstEvent {libObjPtr};
228 inline Packet wrap(bt_packet * const libObjPtr) noexcept
230 return Packet {libObjPtr};
233 inline ConstPacket wrap(const bt_packet * const libObjPtr) noexcept
235 return ConstPacket {libObjPtr};
238 inline Stream wrap(bt_stream * const libObjPtr) noexcept
240 return Stream {libObjPtr};
243 inline ConstStream wrap(const bt_stream * const libObjPtr) noexcept
245 return ConstStream {libObjPtr};
248 inline Trace wrap(bt_trace * const libObjPtr) noexcept
250 return Trace {libObjPtr};
253 inline ConstTrace wrap(const bt_trace * const libObjPtr) noexcept
255 return ConstTrace {libObjPtr};
258 inline EventClass wrap(bt_event_class * const libObjPtr) noexcept
260 return EventClass {libObjPtr};
263 inline ConstEventClass wrap(const bt_event_class * const libObjPtr) noexcept
265 return ConstEventClass {libObjPtr};
268 inline StreamClass wrap(bt_stream_class * const libObjPtr) noexcept
270 return StreamClass {libObjPtr};
273 inline ConstStreamClass wrap(const bt_stream_class * const libObjPtr) noexcept
275 return ConstStreamClass {libObjPtr};
278 inline TraceClass wrap(bt_trace_class * const libObjPtr) noexcept
280 return TraceClass {libObjPtr};
283 inline ConstTraceClass wrap(const bt_trace_class * const libObjPtr) noexcept
285 return ConstTraceClass {libObjPtr};
288 inline Value wrap(bt_value * const libObjPtr) noexcept
290 return Value {libObjPtr};
293 inline ConstValue wrap(const bt_value * const libObjPtr) noexcept
295 return ConstValue {libObjPtr};
298 } /* namespace bt2 */
300 #endif /* BABELTRACE_CPP_COMMON_BT2_WRAP_HPP */