cpp-common/bt2: add bt2::wrap() overloads
[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 "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"
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"
27 #include "value.hpp"
28
29 namespace bt2 {
30
31 inline ClockClass wrap(bt_clock_class * const libObjPtr) noexcept
32 {
33 return ClockClass {libObjPtr};
34 }
35
36 inline ConstClockClass wrap(const bt_clock_class * const libObjPtr) noexcept
37 {
38 return ConstClockClass {libObjPtr};
39 }
40
41 inline ConstClockSnapshot wrap(const bt_clock_snapshot * const libObjPtr) noexcept
42 {
43 return ConstClockSnapshot {libObjPtr};
44 }
45
46 inline ConstComponent wrap(const bt_component * const libObjPtr) noexcept
47 {
48 return ConstComponent {libObjPtr};
49 }
50
51 inline ConstSourceComponent wrap(const bt_component_source * const libObjPtr) noexcept
52 {
53 return ConstSourceComponent {libObjPtr};
54 }
55
56 inline ConstFilterComponent wrap(const bt_component_filter * const libObjPtr) noexcept
57 {
58 return ConstFilterComponent {libObjPtr};
59 }
60
61 inline ConstSinkComponent wrap(const bt_component_sink * const libObjPtr) noexcept
62 {
63 return ConstSinkComponent {libObjPtr};
64 }
65
66 inline ConstInputPort wrap(const bt_port_input * const libObjPtr) noexcept
67 {
68 return ConstInputPort {libObjPtr};
69 }
70
71 inline ConstOutputPort wrap(const bt_port_output * const libObjPtr) noexcept
72 {
73 return ConstOutputPort {libObjPtr};
74 }
75
76 inline FieldClass wrap(bt_field_class * const libObjPtr) noexcept
77 {
78 return FieldClass {libObjPtr};
79 }
80
81 inline ConstFieldClass wrap(const bt_field_class * const libObjPtr) noexcept
82 {
83 return ConstFieldClass {libObjPtr};
84 }
85
86 inline ConstFieldPathItem wrap(const bt_field_path_item * const libObjPtr) noexcept
87 {
88 return ConstFieldPathItem {libObjPtr};
89 }
90
91 inline ConstFieldPath wrap(const bt_field_path * const libObjPtr) noexcept
92 {
93 return ConstFieldPath {libObjPtr};
94 }
95
96 inline Field wrap(bt_field * const libObjPtr) noexcept
97 {
98 return Field {libObjPtr};
99 }
100
101 inline ConstField wrap(const bt_field * const libObjPtr) noexcept
102 {
103 return ConstField {libObjPtr};
104 }
105
106 inline UnsignedIntegerRangeSet wrap(bt_integer_range_set_unsigned * const libObjPtr) noexcept
107 {
108 return UnsignedIntegerRangeSet {libObjPtr};
109 }
110
111 inline ConstUnsignedIntegerRangeSet
112 wrap(const bt_integer_range_set_unsigned * const libObjPtr) noexcept
113 {
114 return ConstUnsignedIntegerRangeSet {libObjPtr};
115 }
116
117 inline SignedIntegerRangeSet wrap(bt_integer_range_set_signed * const libObjPtr) noexcept
118 {
119 return SignedIntegerRangeSet {libObjPtr};
120 }
121
122 inline ConstSignedIntegerRangeSet wrap(const bt_integer_range_set_signed * const libObjPtr) noexcept
123 {
124 return ConstSignedIntegerRangeSet {libObjPtr};
125 }
126
127 inline ConstUnsignedIntegerRange wrap(const bt_integer_range_unsigned * const libObjPtr) noexcept
128 {
129 return ConstUnsignedIntegerRange {libObjPtr};
130 }
131
132 inline ConstSignedIntegerRange wrap(const bt_integer_range_signed * const libObjPtr) noexcept
133 {
134 return ConstSignedIntegerRange {libObjPtr};
135 }
136
137 inline MessageIterator wrap(bt_message_iterator * const libObjPtr) noexcept
138 {
139 return MessageIterator {libObjPtr};
140 }
141
142 inline Message wrap(bt_message * const libObjPtr) noexcept
143 {
144 return Message {libObjPtr};
145 }
146
147 inline ConstMessage wrap(const bt_message * const libObjPtr) noexcept
148 {
149 return ConstMessage {libObjPtr};
150 }
151
152 inline PrivateQueryExecutor wrap(bt_private_query_executor * const libObjPtr) noexcept
153 {
154 return PrivateQueryExecutor {libObjPtr};
155 }
156
157 inline SelfComponentClass wrap(bt_self_component_class * const libObjPtr) noexcept
158 {
159 return SelfComponentClass {libObjPtr};
160 }
161
162 inline SelfComponentClass wrap(bt_self_component_class_source * const libObjPtr) noexcept
163 {
164 return SelfComponentClass {libObjPtr};
165 }
166
167 inline SelfComponentClass wrap(bt_self_component_class_filter * const libObjPtr) noexcept
168 {
169 return SelfComponentClass {libObjPtr};
170 }
171
172 inline SelfComponentClass wrap(bt_self_component_class_sink * const libObjPtr) noexcept
173 {
174 return SelfComponentClass {libObjPtr};
175 }
176
177 inline SelfComponent wrap(bt_self_component * const libObjPtr) noexcept
178 {
179 return SelfComponent {libObjPtr};
180 }
181
182 inline SelfSourceComponent wrap(bt_self_component_source * const libObjPtr) noexcept
183 {
184 return SelfSourceComponent {libObjPtr};
185 }
186
187 inline SelfFilterComponent wrap(bt_self_component_filter * const libObjPtr) noexcept
188 {
189 return SelfFilterComponent {libObjPtr};
190 }
191
192 inline SelfSinkComponent wrap(bt_self_component_sink * const libObjPtr) noexcept
193 {
194 return SelfSinkComponent {libObjPtr};
195 }
196
197 inline SelfComponentInputPort wrap(bt_self_component_port_input * const libObjPtr) noexcept
198 {
199 return SelfComponentInputPort {libObjPtr};
200 }
201
202 inline SelfComponentOutputPort wrap(bt_self_component_port_output * const libObjPtr) noexcept
203 {
204 return SelfComponentOutputPort {libObjPtr};
205 }
206
207 inline SelfMessageIterator wrap(bt_self_message_iterator * const libObjPtr) noexcept
208 {
209 return SelfMessageIterator {libObjPtr};
210 }
211
212 inline SelfMessageIteratorConfiguration
213 wrap(bt_self_message_iterator_configuration * const libObjPtr) noexcept
214 {
215 return SelfMessageIteratorConfiguration {libObjPtr};
216 }
217
218 inline Event wrap(bt_event * const libObjPtr) noexcept
219 {
220 return Event {libObjPtr};
221 }
222
223 inline ConstEvent wrap(const bt_event * const libObjPtr) noexcept
224 {
225 return ConstEvent {libObjPtr};
226 }
227
228 inline Packet wrap(bt_packet * const libObjPtr) noexcept
229 {
230 return Packet {libObjPtr};
231 }
232
233 inline ConstPacket wrap(const bt_packet * const libObjPtr) noexcept
234 {
235 return ConstPacket {libObjPtr};
236 }
237
238 inline Stream wrap(bt_stream * const libObjPtr) noexcept
239 {
240 return Stream {libObjPtr};
241 }
242
243 inline ConstStream wrap(const bt_stream * const libObjPtr) noexcept
244 {
245 return ConstStream {libObjPtr};
246 }
247
248 inline Trace wrap(bt_trace * const libObjPtr) noexcept
249 {
250 return Trace {libObjPtr};
251 }
252
253 inline ConstTrace wrap(const bt_trace * const libObjPtr) noexcept
254 {
255 return ConstTrace {libObjPtr};
256 }
257
258 inline EventClass wrap(bt_event_class * const libObjPtr) noexcept
259 {
260 return EventClass {libObjPtr};
261 }
262
263 inline ConstEventClass wrap(const bt_event_class * const libObjPtr) noexcept
264 {
265 return ConstEventClass {libObjPtr};
266 }
267
268 inline StreamClass wrap(bt_stream_class * const libObjPtr) noexcept
269 {
270 return StreamClass {libObjPtr};
271 }
272
273 inline ConstStreamClass wrap(const bt_stream_class * const libObjPtr) noexcept
274 {
275 return ConstStreamClass {libObjPtr};
276 }
277
278 inline TraceClass wrap(bt_trace_class * const libObjPtr) noexcept
279 {
280 return TraceClass {libObjPtr};
281 }
282
283 inline ConstTraceClass wrap(const bt_trace_class * const libObjPtr) noexcept
284 {
285 return ConstTraceClass {libObjPtr};
286 }
287
288 inline Value wrap(bt_value * const libObjPtr) noexcept
289 {
290 return Value {libObjPtr};
291 }
292
293 inline ConstValue wrap(const bt_value * const libObjPtr) noexcept
294 {
295 return ConstValue {libObjPtr};
296 }
297
298 } /* namespace bt2 */
299
300 #endif /* BABELTRACE_CPP_COMMON_BT2_WRAP_HPP */
This page took 0.036809 seconds and 4 git commands to generate.