Fix: mark (again) section start/end symbols as hidden
[babeltrace.git] / include / babeltrace2 / plugin / plugin-dev.h
1 /*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5 */
6
7 #ifndef BABELTRACE2_PLUGIN_PLUGIN_DEV_H
8 #define BABELTRACE2_PLUGIN_PLUGIN_DEV_H
9
10 #ifndef __BT_IN_BABELTRACE_H
11 # error "Please include <babeltrace2/babeltrace.h> instead."
12 #endif
13
14 #include <stdint.h>
15
16 #include <babeltrace2/graph/component-class-dev.h>
17 #include <babeltrace2/graph/message-iterator-class.h>
18 #include <babeltrace2/types.h>
19
20 /*
21 * _BT_HIDDEN: set the hidden attribute for internal functions
22 * On Windows, symbols are local unless explicitly exported,
23 * see https://gcc.gnu.org/wiki/Visibility
24 */
25 #if defined(_WIN32) || defined(__CYGWIN__)
26 #define _BT_HIDDEN
27 #else
28 #define _BT_HIDDEN __attribute__((visibility("hidden")))
29 #endif
30
31 /*
32 * _BT_EXPORT: set the visibility for exported functions.
33 */
34 #if defined(_WIN32) || defined(__CYGWIN__)
35 #define _BT_EXPORT
36 #else
37 #define _BT_EXPORT __attribute__((visibility("default")))
38 #endif
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /*!
45 @defgroup api-plugin-dev Plugin development
46
47 @brief
48 Shared object plugin development.
49
50 This module offers macros to create a \bt_name shared object plugin.
51
52 Behind the scenes, the <code>BT_PLUGIN_*()</code> macros of this module
53 create and fill global tables which are located in sections of the
54 shared object with specific names. The \ref api-plugin functions can
55 load the resulting shared object file and create corresponding
56 \bt_plugin objects.
57
58 See \ref guide-comp-link-plugin-so.
59
60 <h1>Plugin definition C file structure</h1>
61
62 The structure of a \bt_name plugin definition C file is as such:
63
64 <ol>
65 <li>
66 Start with
67
68 @code
69 BT_PLUGIN_MODULE();
70 @endcode
71 </li>
72
73 <li>
74 Define a \bt_name plugin with BT_PLUGIN() if the plugin's name is a
75 valid C identifier, or with BT_PLUGIN_WITH_ID() otherwise.
76
77 See \ref api-plugin-dev-custom-plugin-id "Custom plugin ID" to
78 learn more about plugin IDs.
79
80 @note
81 When you use BT_PLUGIN(), the plugin's ID is <code>auto</code>.
82 </li>
83
84 <li>
85 \bt_dt_opt Use any of the following macros (or their
86 <code>*_WITH_ID()</code> counterpart) \em once to set the properties
87 of the plugin:
88
89 - BT_PLUGIN_AUTHOR()
90 - BT_PLUGIN_DESCRIPTION()
91 - BT_PLUGIN_LICENSE()
92 - BT_PLUGIN_VERSION()
93 </li>
94
95 <li>
96 \bt_dt_opt Use any of the following macros (or their
97 <code>*_WITH_ID()</code> counterpart) \em once to set the
98 initialization and finalization functions of the plugin:
99
100 - BT_PLUGIN_INITIALIZE_FUNC()
101 - BT_PLUGIN_FINALIZE_FUNC()
102
103 A plugin's initialization function is executed when the shared
104 object is loaded (see \ref api-plugin).
105
106 A plugin's finalization function is executed when the \bt_plugin
107 object is destroyed, if the initialization function (if any)
108 succeeded.
109 </li>
110
111 <li>
112 Use any of the following macros (or their <code>*_WITH_ID()</code>
113 counterpart) to add a component class to the plugin:
114
115 - BT_PLUGIN_SOURCE_COMPONENT_CLASS()
116 - BT_PLUGIN_FILTER_COMPONENT_CLASS()
117 - BT_PLUGIN_SINK_COMPONENT_CLASS()
118 </li>
119
120 <li>
121 \bt_dt_opt Depending on the type of the component class of step 5,
122 use any of the following macros (or their <code>*_WITH_ID()</code>
123 counterpart)
124 \em once to set its properties:
125
126 <dl>
127 <dt>\bt_c_src_comp_cls</dt>
128 <dd>
129 - BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION()
130 - BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP()
131 </dd>
132
133 <dt>\bt_c_flt_comp_cls</dt>
134 <dd>
135 - BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION()
136 - BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP()
137 </dd>
138
139 <dt>\bt_c_sink_comp_cls</dt>
140 <dd>
141 - BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION()
142 - BT_PLUGIN_SINK_COMPONENT_CLASS_HELP()
143 </dd>
144 </dl>
145 </li>
146
147 <li>
148 \bt_dt_opt Depending on the type of the component class of step 5,
149 use any of the following macros (or their <code>*_WITH_ID()</code>
150 counterpart) to set its optional methods:
151
152 <dl>
153 <dt>Source component class</dt>
154 <dd>
155 - BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD()
156 - BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD()
157 - BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD()
158 - BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD()
159 - BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD()
160 - BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD()
161 - BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD()
162 </dd>
163
164 <dt>Filter component class</dt>
165 <dd>
166 - BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD()
167 - BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD()
168 - BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD()
169 - BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD()
170 - BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD()
171 - BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD()
172 - BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD()
173 - BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD()
174 </dd>
175
176 <dt>Sink component class</dt>
177 <dd>
178 - BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD()
179 - BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD()
180 - BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD()
181 - BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD()
182 - BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD()
183 - BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD()
184 </dd>
185 </dl>
186 </li>
187 </ol>
188
189 You can repeat steps 5 to 7 to add more than one component class to a
190 given plugin.
191
192 See \ref example-simple-plugin-def-file for a concrete example of how
193 to use the macros of this module.
194
195 <h1>\anchor api-plugin-dev-custom-plugin-id Custom plugin ID</h1>
196
197 The BT_PLUGIN() macro defines a plugin with a specific name and the
198 ID <code>auto</code>.
199
200 All the <code>BT_PLUGIN_*()</code> macros which do not end with
201 <code>_WITH_ID</code> refer to the <code>auto</code> plugin.
202
203 There are two situations which demand that you use a custom plugin ID:
204
205 - You want more than one plugin contained in your shared object file.
206
207 Although the \bt_name project does not recommend this, it is possible.
208 This is why bt_plugin_find_all_from_file() returns a \bt_plugin_set
209 instead of a single \bt_plugin.
210
211 In this case, each plugin of the shared object needs its own, unique
212 ID.
213
214 - You want to give the plugin a name which is not a valid C identifier.
215
216 The BT_PLUGIN() macro accepts a C identifier as the plugin name, while
217 the BT_PLUGIN_WITH_ID() accepts a C identifier for the ID and a C
218 string for the name.
219
220 To define a plugin with a specific ID, use BT_PLUGIN_WITH_ID(), for
221 example:
222
223 @code
224 BT_PLUGIN_WITH_ID(my_plugin_id, "my-plugin-name");
225 @endcode
226
227 Then, use the <code>BT_PLUGIN_*_WITH_ID()</code> macros to refer to
228 this specific plugin, for example:
229
230 @code
231 BT_PLUGIN_AUTHOR_WITH_ID(my_plugin_id, "Patrick Bouchard");
232 @endcode
233
234 @note
235 @parblock
236 You can still use the <code>auto</code> ID with BT_PLUGIN_WITH_ID()
237 to use the simpler macros afterwards while still giving the plugin a
238 name which is not a valid C identifier, for example:
239
240 @code
241 BT_PLUGIN_WITH_ID(auto, "my-plugin-name");
242 BT_PLUGIN_AUTHOR("Patrick Bouchard");
243 @endcode
244 @endparblock
245
246 <h1>Custom component class ID</h1>
247
248 The BT_PLUGIN_SOURCE_COMPONENT_CLASS(),
249 BT_PLUGIN_FILTER_COMPONENT_CLASS(), and
250 BT_PLUGIN_SINK_COMPONENT_CLASS() add a component class with a specific
251 name to the plugin having the ID <code>auto</code>.
252
253 The name you pass to those macros must be a valid C identifier and it
254 also serves as the component class's ID within the <code>auto</code>
255 plugin.
256
257 There are two situations which demand that you use a custom component
258 class ID:
259
260 - You want to add the component class to a specific plugin (other than
261 <code>auto</code>, if you have more than one).
262
263 - You want to give the component class a name which is not a valid C
264 identifier.
265
266 The <code>BT_PLUGIN_*_COMPONENT_CLASS_WITH_ID()</code> macros accept a
267 C identifier for the component class ID and a string for its name.
268
269 For a given plugin and for a given component class type, all component
270 class IDs must be unique.
271
272 To add a component class having a specific ID to a plugin,
273 use the BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(),
274 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(), and
275 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID() macros, for example:
276
277 @code
278 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(my_plugin_id, my_comp_class_id,
279 "my-source", my_source_iter_next);
280 @endcode
281
282 @note
283 @parblock
284 The <code>BT_PLUGIN_*_COMPONENT_CLASS_WITH_ID()</code> macros
285 specify the ID of the plugin to which to add the component class.
286
287 If you use the BT_PLUGIN() macro to define your plugin, then its
288 ID is <code>auto</code>:
289
290 @code
291 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, my_comp_class_id,
292 "my-source", my_source_iter_next);
293 @endcode
294 @endparblock
295
296 Then, use the <code>BT_PLUGIN_*_COMPONENT_CLASS_*_WITH_ID()</code>
297 macros to refer to this specific component class, for example:
298
299 @code
300 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(my_plugin_id,
301 my_comp_class_id, my_source_finalize);
302 @endcode
303 */
304
305 /*! @{ */
306
307 /*!
308 @name Type
309 @{
310
311 @typedef struct bt_self_plugin bt_self_plugin;
312
313 @brief
314 Self plugin.
315
316 @}
317 */
318
319 /*!
320 @name Plugin module
321 @{
322 */
323
324 /*!
325 @brief
326 Defines a plugin module.
327
328 In a plugin define C file, you must use this macro before you use any
329 other <code>BT_PLUGIN*()</code> macro.
330 */
331 #define BT_PLUGIN_MODULE() \
332 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_dummy __BT_PLUGIN_DESCRIPTOR_ATTRS = NULL; \
333 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA; \
334 _BT_HIDDEN extern struct __bt_plugin_descriptor const *__BT_PLUGIN_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_END_EXTRA; \
335 \
336 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_dummy __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
337 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
338 _BT_HIDDEN extern struct __bt_plugin_descriptor_attribute const *__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
339 \
340 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_component_class_descriptor_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = NULL; \
341 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA; \
342 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA; \
343 \
344 static struct __bt_plugin_component_class_descriptor_attribute const * const __bt_plugin_component_class_descriptor_attribute_dummy __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS = NULL; \
345 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor_attribute const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA; \
346 _BT_HIDDEN extern struct __bt_plugin_component_class_descriptor_attribute const *__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA; \
347 \
348 _BT_EXPORT struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void) \
349 { \
350 return &__BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL; \
351 } \
352 _BT_EXPORT struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void) \
353 { \
354 return &__BT_PLUGIN_DESCRIPTOR_END_SYMBOL; \
355 } \
356 _BT_EXPORT struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void) \
357 { \
358 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
359 } \
360 _BT_EXPORT struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void) \
361 { \
362 return &__BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
363 } \
364 _BT_EXPORT struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void) \
365 { \
366 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL; \
367 } \
368 _BT_EXPORT struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void) \
369 { \
370 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL; \
371 } \
372 _BT_EXPORT struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void) \
373 { \
374 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL; \
375 } \
376 _BT_EXPORT struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void) \
377 { \
378 return &__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL; \
379 }
380
381 /*! @} */
382
383 /*!
384 @name Plugin definition
385 @{
386 */
387
388 /*!
389 @brief
390 Defines a plugin named \bt_p{_name} and having the ID \bt_p{_id}.
391
392 @param[in] _id
393 @parblock
394 C identifier.
395
396 Plugin's ID, unique amongst all the plugin IDs of the same shared
397 object.
398 @endparblock
399 @param[in] _name
400 @parblock
401 <code>const char *</code>
402
403 Plugin's name.
404 @endparblock
405
406 @bt_pre_not_null{_name}
407 */
408 #define BT_PLUGIN_WITH_ID(_id, _name) \
409 struct __bt_plugin_descriptor __bt_plugin_descriptor_##_id = { \
410 .name = _name, \
411 }; \
412 static struct __bt_plugin_descriptor const * const __bt_plugin_descriptor_##_id##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRS = &__bt_plugin_descriptor_##_id
413
414 /*!
415 @brief
416 Alias of BT_PLUGIN_WITH_ID() with the \bt_p{_id} parameter set to
417 <code>auto</code>.
418 */
419 #define BT_PLUGIN(_name) static BT_PLUGIN_WITH_ID(auto, #_name)
420
421 /*! @} */
422
423 /*!
424 @name Plugin properties
425 @{
426 */
427
428 /*!
429 @brief
430 Sets the description of the plugin having the ID \bt_p{_id} to
431 \bt_p{_description}.
432
433 See the \ref api-comp-cls-prop-descr "description" property.
434
435 @param[in] _id
436 @parblock
437 C identifier.
438
439 ID of the plugin of which to set the description.
440 @endparblock
441 @param[in] _description
442 @parblock
443 <code>const char *</code>
444
445 Plugin's description.
446 @endparblock
447
448 @bt_pre_not_null{_description}
449 */
450 #define BT_PLUGIN_DESCRIPTION_WITH_ID(_id, _description) \
451 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _id, _description)
452
453 /*!
454 @brief
455 Alias of BT_PLUGIN_DESCRIPTION_WITH_ID() with the \bt_p{_id}
456 parameter set to <code>auto</code>.
457 */
458 #define BT_PLUGIN_DESCRIPTION(_description) BT_PLUGIN_DESCRIPTION_WITH_ID(auto, _description)
459
460 /*!
461 @brief
462 Sets the name(s) of the author(s) of the plugin having the ID
463 \bt_p{_id} to \bt_p{_author}.
464
465 See the \ref api-plugin-prop-author "author name(s)" property.
466
467 @param[in] _id
468 @parblock
469 C identifier.
470
471 ID of the plugin of which to set the author(s).
472 @endparblock
473 @param[in] _author
474 @parblock
475 <code>const char *</code>
476
477 Plugin's author(s).
478 @endparblock
479
480 @bt_pre_not_null{_author}
481 */
482 #define BT_PLUGIN_AUTHOR_WITH_ID(_id, _author) \
483 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(author, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR, _id, _author)
484
485 /*!
486 @brief
487 Alias of BT_PLUGIN_AUTHOR_WITH_ID() with the \bt_p{_id}
488 parameter set to <code>auto</code>.
489 */
490 #define BT_PLUGIN_AUTHOR(_author) BT_PLUGIN_AUTHOR_WITH_ID(auto, _author)
491
492 /*!
493 @brief
494 Sets the license (name or full) of the plugin having the ID
495 \bt_p{_id} to \bt_p{_license}.
496
497 See the \ref api-plugin-prop-license "license" property.
498
499 @param[in] _id
500 @parblock
501 C identifier.
502
503 ID of the plugin of which to set the license.
504 @endparblock
505 @param[in] _license
506 @parblock
507 <code>const char *</code>
508
509 Plugin's license.
510 @endparblock
511
512 @bt_pre_not_null{_license}
513 */
514 #define BT_PLUGIN_LICENSE_WITH_ID(_id, _license) \
515 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(license, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE, _id, _license)
516
517 /*!
518 @brief
519 Alias of BT_PLUGIN_LICENSE_WITH_ID() with the \bt_p{_id}
520 parameter set to <code>auto</code>.
521 */
522 #define BT_PLUGIN_LICENSE(_license) BT_PLUGIN_LICENSE_WITH_ID(auto, _license)
523
524 /*!
525 @brief
526 Sets the version of the plugin having the ID \bt_p{_id} to
527 \bt_p{_version}.
528
529 See the \ref api-plugin-prop-version "version" property.
530
531 @param[in] _id
532 @parblock
533 C identifier.
534
535 ID of the plugin of which to set the version.
536 @endparblock
537 @param[in] _major
538 @parblock
539 <code>unsigned int</code>
540
541 Plugin's major version.
542 @endparblock
543 @param[in] _minor
544 @parblock
545 <code>unsigned int</code>
546
547 Plugin's minor version.
548 @endparblock
549 @param[in] _patch
550 @parblock
551 <code>unsigned int</code>
552
553 Plugin's patch version.
554 @endparblock
555 @param[in] _extra
556 @parblock
557 <code>const char *</code>
558
559 Plugin's version's extra information.
560
561 Can be \c NULL if the plugin's version has no extra information.
562 @endparblock
563 */
564 #define BT_PLUGIN_VERSION_WITH_ID(_id, _major, _minor, _patch, _extra) \
565 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(version, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION, _id, __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra))
566
567 /*!
568 @brief
569 Alias of BT_PLUGIN_VERSION_WITH_ID() with the \bt_p{_id}
570 parameter set to <code>auto</code>.
571 */
572 #define BT_PLUGIN_VERSION(_major, _minor, _patch, _extra) BT_PLUGIN_VERSION_WITH_ID(auto, _major, _minor, _patch, _extra)
573
574 /*! @} */
575
576 /*!
577 @name Plugin functions
578 @{
579 */
580
581 /*!
582 @brief
583 Status codes for #bt_plugin_initialize_func.
584 */
585 typedef enum bt_plugin_initialize_func_status {
586 /*!
587 @brief
588 Success.
589 */
590 BT_PLUGIN_INITIALIZE_FUNC_STATUS_OK = __BT_FUNC_STATUS_OK,
591
592 /*!
593 @brief
594 Out of memory.
595 */
596 BT_PLUGIN_INITIALIZE_FUNC_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
597
598 /*!
599 @brief
600 Error.
601 */
602 BT_PLUGIN_INITIALIZE_FUNC_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
603 } bt_plugin_initialize_func_status;
604
605 /*!
606 @brief
607 User plugin initialization function.
608
609 @param[in] self_plugin
610 @parblock
611 Plugin instance.
612
613 This parameter is a private view of the \bt_plugin object for
614 this function.
615
616 As of \bt_name_version_min_maj, there's no self plugin API.
617 @endparblock
618
619 @retval #BT_PLUGIN_INITIALIZE_FUNC_STATUS_OK
620 Success.
621 @retval #BT_PLUGIN_INITIALIZE_FUNC_STATUS_MEMORY_ERROR
622 Out of memory.
623 @retval #BT_PLUGIN_INITIALIZE_FUNC_STATUS_ERROR
624 Error.
625
626 @bt_pre_not_null{self_plugin}
627 */
628 typedef bt_plugin_initialize_func_status (*bt_plugin_initialize_func)(
629 bt_self_plugin *self_plugin);
630
631 /*!
632 @brief
633 Sets the initialization function of the plugin having the ID
634 \bt_p{_id} to \bt_p{_func}.
635
636 @param[in] _id
637 @parblock
638 C identifier.
639
640 ID of the plugin of which to set the initialization function.
641 @endparblock
642 @param[in] _func
643 @parblock
644 #bt_plugin_initialize_func
645
646 Plugin's initialization function.
647 @endparblock
648
649 @bt_pre_not_null{_func}
650 */
651 #define BT_PLUGIN_INITIALIZE_FUNC_WITH_ID(_id, _func) \
652 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(init, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT, _id, _func)
653
654 /*!
655 @brief
656 Alias of BT_PLUGIN_INITIALIZE_FUNC_WITH_ID() with the \bt_p{_id}
657 parameter set to <code>auto</code>.
658 */
659 #define BT_PLUGIN_INITIALIZE_FUNC(_func) BT_PLUGIN_INITIALIZE_FUNC_WITH_ID(auto, _func)
660
661 /*!
662 @brief
663 User plugin finalization function.
664 */
665 typedef void (*bt_plugin_finalize_func)(void);
666
667 /*!
668 @brief
669 Sets the finalization function of the plugin having the ID
670 \bt_p{_id} to \bt_p{_func}.
671
672 @param[in] _id
673 @parblock
674 C identifier.
675
676 ID of the plugin of which to set the finalization function.
677 @endparblock
678 @param[in] _func
679 @parblock
680 #bt_plugin_finalize_func
681
682 Plugin's finalization function.
683 @endparblock
684
685 @bt_pre_not_null{_func}
686 */
687 #define BT_PLUGIN_FINALIZE_FUNC_WITH_ID(_id, _func) \
688 __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(exit, BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT, _id, _func)
689
690 /*!
691 @brief
692 Alias of BT_PLUGIN_FINALIZE_FUNC_WITH_ID() with the \bt_p{_id}
693 parameter set to <code>auto</code>.
694 */
695 #define BT_PLUGIN_FINALIZE_FUNC(_func) BT_PLUGIN_FINALIZE_FUNC_WITH_ID(auto, _func)
696
697 /*! @} */
698
699 /*!
700 @name Component class adding
701 @{
702 */
703
704 /*!
705 @brief
706 Adds a \bt_src_comp_cls named \bt_p{_name}, having the ID
707 \bt_p{_component_class_id} and the message iterator class's "next"
708 method \bt_p{_message_iterator_class_next_method}, to the plugin
709 having the ID \bt_p{_plugin_id}.
710
711 @param[in] _plugin_id
712 @parblock
713 C identifier.
714
715 ID of the plugin to which to add the source component class.
716 @endparblock
717 @param[in] _component_class_id
718 @parblock
719 C identifier.
720
721 Source component class's ID, unique amongst all the source component
722 class IDs of the same plugin.
723 @endparblock
724 @param[in] _name
725 @parblock
726 <code>const char *</code>
727
728 Source component class's name, unique amongst all the source
729 component class names of the same plugin.
730 @endparblock
731 @param[in] _message_iterator_class_next_method
732 @parblock
733 #bt_message_iterator_class_next_method
734
735 Source component class's message iterator class's "next" method.
736 @endparblock
737
738 @bt_pre_not_null{_name}
739 @bt_pre_not_null{_message_iterator_class_next_method}
740 */
741 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_plugin_id, _component_class_id, _name, _message_iterator_class_next_method) \
742 static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_plugin_id##_##_component_class_id = { \
743 .plugin_descriptor = &__bt_plugin_descriptor_##_plugin_id, \
744 .name = _name, \
745 .type = BT_COMPONENT_CLASS_TYPE_SOURCE, \
746 .methods = { .source = { .msg_iter_next = _message_iterator_class_next_method } }, \
747 }; \
748 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_source_component_class_descriptor_##_plugin_id##_##_component_class_id##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = &__bt_plugin_source_component_class_descriptor_##_plugin_id##_##_component_class_id
749
750 /*!
751 @brief
752 Alias of BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID() with the
753 \bt_p{_plugin_id} parameter set to <code>auto</code>, the
754 \bt_p{_component_class_id} parameter set to \bt_p{_name}, and
755 the \bt_p{_name} parameter set to a string version of \bt_p{_name}.
756
757 @param[in] _name
758 @parblock
759 C identifier
760
761 Passed as both the \bt_p{_component_class_id} and the
762 \bt_p{_name} (once converted to a string) parameters of
763 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID().
764 @endparblock
765 */
766 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _message_iterator_class_next_method) \
767 BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _message_iterator_class_next_method)
768
769 /*!
770 @brief
771 Adds a \bt_flt_comp_cls named \bt_p{_name}, having the ID
772 \bt_p{_component_class_id} and the message iterator class's "next"
773 method \bt_p{_message_iterator_class_next_method}, to the plugin
774 having the ID \bt_p{_plugin_id}.
775
776 @param[in] _plugin_id
777 @parblock
778 C identifier.
779
780 ID of the plugin to which to add the filter component class.
781 @endparblock
782 @param[in] _component_class_id
783 @parblock
784 C identifier.
785
786 Filter component class's ID, unique amongst all the filter component
787 class IDs of the same plugin.
788 @endparblock
789 @param[in] _name
790 @parblock
791 <code>const char *</code>
792
793 Filter component class's name, unique amongst all the filter
794 component class names of the same plugin.
795 @endparblock
796 @param[in] _message_iterator_class_next_method
797 @parblock
798 #bt_message_iterator_class_next_method
799
800 Filter component class's message iterator class's "next" method.
801 @endparblock
802
803 @bt_pre_not_null{_name}
804 @bt_pre_not_null{_message_iterator_class_next_method}
805 */
806 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_plugin_id, _component_class_id, _name, _message_iterator_class_next_method) \
807 static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_plugin_id##_##_component_class_id = { \
808 .plugin_descriptor = &__bt_plugin_descriptor_##_plugin_id, \
809 .name = _name, \
810 .type = BT_COMPONENT_CLASS_TYPE_FILTER, \
811 .methods = { .filter = { .msg_iter_next = _message_iterator_class_next_method } }, \
812 }; \
813 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_filter_component_class_descriptor_##_plugin_id##_##_component_class_id##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = &__bt_plugin_filter_component_class_descriptor_##_plugin_id##_##_component_class_id
814
815 /*!
816 @brief
817 Alias of BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID() with the
818 \bt_p{_plugin_id} parameter set to <code>auto</code>, the
819 \bt_p{_component_class_id} parameter set to \bt_p{_name}, and
820 the \bt_p{_name} parameter set to a string version of \bt_p{_name}.
821
822 @param[in] _name
823 @parblock
824 C identifier
825
826 Passed as both the \bt_p{_component_class_id} and the
827 \bt_p{_name} (once converted to a string) parameters of
828 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID().
829 @endparblock
830 */
831 #define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _message_iterator_class_next_method) \
832 BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _message_iterator_class_next_method)
833
834 /*!
835 @brief
836 Adds a \bt_sink_comp_cls named \bt_p{_name}, having the ID
837 \bt_p{_component_class_id} and the consuming method
838 \bt_p{_consume_method}, to the plugin
839 having the ID \bt_p{_plugin_id}.
840
841 @param[in] _plugin_id
842 @parblock
843 C identifier.
844
845 ID of the plugin to which to add the sink component class.
846 @endparblock
847 @param[in] _component_class_id
848 @parblock
849 C identifier.
850
851 Sink component class's ID, unique amongst all the sink component
852 class IDs of the same plugin.
853 @endparblock
854 @param[in] _name
855 @parblock
856 <code>const char *</code>
857
858 Sink component class's name, unique amongst all the sink
859 component class names of the same plugin.
860 @endparblock
861 @param[in] _consume_method
862 @parblock
863 #bt_component_class_sink_consume_method
864
865 Sink component class's message iterator class's "next" method.
866 @endparblock
867
868 @bt_pre_not_null{_name}
869 @bt_pre_not_null{_consume_method}
870 */
871 #define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_plugin_id, _component_class_id, _name, _consume_method) \
872 static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_plugin_id##_##_component_class_id = { \
873 .plugin_descriptor = &__bt_plugin_descriptor_##_plugin_id, \
874 .name = _name, \
875 .type = BT_COMPONENT_CLASS_TYPE_SINK, \
876 .methods = { .sink = { .consume = _consume_method } }, \
877 }; \
878 static struct __bt_plugin_component_class_descriptor const * const __bt_plugin_sink_component_class_descriptor_##_plugin_id##_##_component_class_id##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS = &__bt_plugin_sink_component_class_descriptor_##_plugin_id##_##_component_class_id
879
880 /*!
881 @brief
882 Alias of BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID() with the
883 \bt_p{_plugin_id} parameter set to <code>auto</code>, the
884 \bt_p{_component_class_id} parameter set to \bt_p{_name}, and
885 the \bt_p{_name} parameter set to a string version of \bt_p{_name}.
886
887 @param[in] _name
888 @parblock
889 C identifier
890
891 Passed as both the \bt_p{_component_class_id} and the
892 \bt_p{_name} (once converted to a string) parameters of
893 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID().
894 @endparblock
895 */
896 #define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
897 BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
898
899 /*! @} */
900
901 /*!
902 @name Source component class properties
903 @{
904 */
905
906 /*!
907 @brief
908 Sets the description of the \bt_src_comp_cls having the ID
909 \bt_p{_component_class_id} in the plugin having the ID
910 \bt_p{_plugin_id} to \bt_p{_description}.
911
912 See the \ref api-comp-cls-prop-descr "description" property.
913
914 @param[in] _plugin_id
915 @parblock
916 C identifier.
917
918 ID of the plugin which contains the source component class of which
919 to set the description.
920 @endparblock
921 @param[in] _component_class_id
922 @parblock
923 C identifier.
924
925 ID of the source component class, within the plugin having the ID
926 \bt_p{_plugin_id}, of which to set the description to
927 \bt_p{_description}.
928 @endparblock
929 @param[in] _description
930 @parblock
931 <code>const char *</code>
932
933 Source component class's description.
934 @endparblock
935
936 @bt_pre_not_null{_description}
937 */
938 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_plugin_id, _component_class_id, _description) \
939 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _plugin_id, _component_class_id, source, _description)
940
941 /*!
942 @brief
943 Alias of BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID() with
944 the \bt_p{_plugin_id} parameter set to <code>auto</code> and the
945 \bt_p{_component_class_id} parameter set to \bt_p{_name}.
946 */
947 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(_name, _description) \
948 BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _description)
949
950 /*!
951 @brief
952 Sets the help text of the \bt_src_comp_cls having the ID
953 \bt_p{_component_class_id} in the plugin having the ID
954 \bt_p{_plugin_id} to \bt_p{_help_text}.
955
956 See the \ref api-comp-cls-prop-help "help text" property.
957
958 @param[in] _plugin_id
959 @parblock
960 C identifier.
961
962 ID of the plugin which contains the source component class of which
963 to set the help text.
964 @endparblock
965 @param[in] _component_class_id
966 @parblock
967 C identifier.
968
969 ID of the source component class, within the plugin having the ID
970 \bt_p{_plugin_id}, of which to set the help text to
971 \bt_p{_help_text}.
972 @endparblock
973 @param[in] _help_text
974 @parblock
975 <code>const char *</code>
976
977 Source component class's help text.
978 @endparblock
979
980 @bt_pre_not_null{_help_text}
981 */
982 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(_plugin_id, _component_class_id, _help_text) \
983 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _plugin_id, _component_class_id, source, _help_text)
984
985 /*!
986 @brief
987 Alias of BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID() with the
988 \bt_p{_plugin_id} parameter set to <code>auto</code> and the
989 \bt_p{_component_class_id} parameter set to \bt_p{_name}.
990 */
991 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(_name, _help_text) \
992 BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _help_text)
993
994 /*! @} */
995
996 /*!
997 @name Filter component class properties
998 @{
999 */
1000
1001 /*!
1002 @brief
1003 Sets the description of the \bt_flt_comp_cls having the ID
1004 \bt_p{_component_class_id} in the plugin having the ID
1005 \bt_p{_plugin_id} to \bt_p{_description}.
1006
1007 See the \ref api-comp-cls-prop-descr "description" property.
1008
1009 @param[in] _plugin_id
1010 @parblock
1011 C identifier.
1012
1013 ID of the plugin which contains the filter component class of which
1014 to set the description.
1015 @endparblock
1016 @param[in] _component_class_id
1017 @parblock
1018 C identifier.
1019
1020 ID of the filter component class, within the plugin having the ID
1021 \bt_p{_plugin_id}, of which to set the description to
1022 \bt_p{_description}.
1023 @endparblock
1024 @param[in] _description
1025 @parblock
1026 <code>const char *</code>
1027
1028 Filter component class's description.
1029 @endparblock
1030
1031 @bt_pre_not_null{_description}
1032 */
1033 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_plugin_id, _component_class_id, _description) \
1034 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _plugin_id, _component_class_id, filter, _description)
1035
1036 /*!
1037 @brief
1038 Alias of BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID() with
1039 the \bt_p{_plugin_id} parameter set to <code>auto</code> and the
1040 \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1041 */
1042 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(_name, _description) \
1043 BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _description)
1044
1045 /*!
1046 @brief
1047 Sets the help text of the \bt_flt_comp_cls having the ID
1048 \bt_p{_component_class_id} in the plugin having the ID
1049 \bt_p{_plugin_id} to \bt_p{_help_text}.
1050
1051 See the \ref api-comp-cls-prop-help "help text" property.
1052
1053 @param[in] _plugin_id
1054 @parblock
1055 C identifier.
1056
1057 ID of the plugin which contains the filter component class of which
1058 to set the help text.
1059 @endparblock
1060 @param[in] _component_class_id
1061 @parblock
1062 C identifier.
1063
1064 ID of the filter component class, within the plugin having the ID
1065 \bt_p{_plugin_id}, of which to set the help text to
1066 \bt_p{_help_text}.
1067 @endparblock
1068 @param[in] _help_text
1069 @parblock
1070 <code>const char *</code>
1071
1072 Filter component class's help text.
1073 @endparblock
1074
1075 @bt_pre_not_null{_help_text}
1076 */
1077 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(_plugin_id, _component_class_id, _help_text) \
1078 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _plugin_id, _component_class_id, filter, _help_text)
1079
1080 /*!
1081 @brief
1082 Alias of BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID() with the
1083 \bt_p{_plugin_id} parameter set to <code>auto</code> and the
1084 \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1085 */
1086 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(_name, _help_text) \
1087 BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _help_text)
1088
1089 /*! @} */
1090
1091 /*!
1092 @name Sink component class properties
1093 @{
1094 */
1095
1096 /*!
1097 @brief
1098 Sets the description of the \bt_sink_comp_cls having the ID
1099 \bt_p{_component_class_id} in the plugin having the ID
1100 \bt_p{_plugin_id} to \bt_p{_description}.
1101
1102 See the \ref api-comp-cls-prop-descr "description" property.
1103
1104 @param[in] _plugin_id
1105 @parblock
1106 C identifier.
1107
1108 ID of the plugin which contains the sink component class of which
1109 to set the description.
1110 @endparblock
1111 @param[in] _component_class_id
1112 @parblock
1113 C identifier.
1114
1115 ID of the sink component class, within the plugin having the ID
1116 \bt_p{_plugin_id}, of which to set the description to
1117 \bt_p{_description}.
1118 @endparblock
1119 @param[in] _description
1120 @parblock
1121 <code>const char *</code>
1122
1123 Sink component class's description.
1124 @endparblock
1125
1126 @bt_pre_not_null{_description}
1127 */
1128 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(_plugin_id, _component_class_id, _description) \
1129 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(description, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION, _plugin_id, _component_class_id, sink, _description)
1130
1131 /*!
1132 @brief
1133 Alias of BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID() with
1134 the \bt_p{_plugin_id} parameter set to <code>auto</code> and the
1135 \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1136 */
1137 #define BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(_name, _description) \
1138 BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION_WITH_ID(auto, _name, _description)
1139
1140 /*!
1141 @brief
1142 Sets the help text of the \bt_sink_comp_cls having the ID
1143 \bt_p{_component_class_id} in the plugin having the ID
1144 \bt_p{_plugin_id} to \bt_p{_help_text}.
1145
1146 See the \ref api-comp-cls-prop-help "help text" property.
1147
1148 @param[in] _plugin_id
1149 @parblock
1150 C identifier.
1151
1152 ID of the plugin which contains the sink component class of which
1153 to set the help text.
1154 @endparblock
1155 @param[in] _component_class_id
1156 @parblock
1157 C identifier.
1158
1159 ID of the sink component class, within the plugin having the ID
1160 \bt_p{_plugin_id}, of which to set the help text to
1161 \bt_p{_help_text}.
1162 @endparblock
1163 @param[in] _help_text
1164 @parblock
1165 <code>const char *</code>
1166
1167 Sink component class's help text.
1168 @endparblock
1169
1170 @bt_pre_not_null{_help_text}
1171 */
1172 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(_plugin_id, _component_class_id, _help_text) \
1173 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(help, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP, _plugin_id, _component_class_id, sink, _help_text)
1174
1175 /*!
1176 @brief
1177 Alias of BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID() with
1178 the \bt_p{_plugin_id} parameter set to <code>auto</code> and the
1179 \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1180 */
1181 #define BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(_name, _help_text) \
1182 BT_PLUGIN_SINK_COMPONENT_CLASS_HELP_WITH_ID(auto, _name, _help_text)
1183
1184 /*! @} */
1185
1186 /*!
1187 @name Source component class methods
1188 @{
1189 */
1190
1191 /*!
1192 @brief
1193 Sets the finalization method of the \bt_src_comp_cls having the ID
1194 \bt_p{_component_class_id} in the plugin having the ID
1195 \bt_p{_plugin_id} to \bt_p{_method}.
1196
1197 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1198
1199 @param[in] _plugin_id
1200 @parblock
1201 C identifier.
1202
1203 ID of the plugin which contains the source component class of which
1204 to set the finalization method.
1205 @endparblock
1206 @param[in] _component_class_id
1207 @parblock
1208 C identifier.
1209
1210 ID of the source component class, within the plugin having the ID
1211 \bt_p{_plugin_id}, of which to set the finalization method to
1212 \bt_p{_method}.
1213 @endparblock
1214 @param[in] _method
1215 @parblock
1216 #bt_component_class_source_finalize_method
1217
1218 Source component class's finalization method.
1219 @endparblock
1220
1221 @bt_pre_not_null{_method}
1222 */
1223 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1224 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _plugin_id, _component_class_id, source, _method)
1225
1226 /*!
1227 @brief
1228 Alias of
1229 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID()
1230 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1231 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1232 */
1233 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _method) \
1234 BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
1235
1236 /*!
1237 @brief
1238 Sets the \"get supported \bt_mip versions\" method of the
1239 \bt_src_comp_cls having the ID \bt_p{_component_class_id} in the
1240 plugin having the ID \bt_p{_plugin_id} to \bt_p{_method}.
1241
1242 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1243 method.
1244
1245 @param[in] _plugin_id
1246 @parblock
1247 C identifier.
1248
1249 ID of the plugin which contains the source component class of which
1250 to set the "get supported MIP versions" method.
1251 @endparblock
1252 @param[in] _component_class_id
1253 @parblock
1254 C identifier.
1255
1256 ID of the source component class, within the plugin having the ID
1257 \bt_p{_plugin_id}, of which to set the "get supported MIP versions"
1258 method to \bt_p{_method}.
1259 @endparblock
1260 @param[in] _method
1261 @parblock
1262 #bt_component_class_source_get_supported_mip_versions_method
1263
1264 Source component class's "get supported MIP versions" method.
1265 @endparblock
1266
1267 @bt_pre_not_null{_method}
1268 */
1269 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1270 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD, _plugin_id, _component_class_id, source, _method)
1271
1272 /*!
1273 @brief
1274 Alias of
1275 BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID()
1276 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1277 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1278 */
1279 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _method) \
1280 BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _method)
1281
1282 /*!
1283 @brief
1284 Sets the initialization method of the \bt_src_comp_cls having the ID
1285 \bt_p{_component_class_id} in the plugin having the ID
1286 \bt_p{_plugin_id} to \bt_p{_method}.
1287
1288 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1289
1290 @param[in] _plugin_id
1291 @parblock
1292 C identifier.
1293
1294 ID of the plugin which contains the source component class of which
1295 to set the initialization method.
1296 @endparblock
1297 @param[in] _component_class_id
1298 @parblock
1299 C identifier.
1300
1301 ID of the source component class, within the plugin having the ID
1302 \bt_p{_plugin_id}, of which to set the initialization method to
1303 \bt_p{_method}.
1304 @endparblock
1305 @param[in] _method
1306 @parblock
1307 #bt_component_class_source_initialize_method
1308
1309 Source component class's initialization method.
1310 @endparblock
1311
1312 @bt_pre_not_null{_method}
1313 */
1314 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1315 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD, _plugin_id, _component_class_id, source, _method)
1316
1317 /*!
1318 @brief
1319 Alias of
1320 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID()
1321 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1322 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1323 */
1324 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _method) \
1325 BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
1326
1327 /*!
1328 @brief
1329 Sets the finalization method of the \bt_msg_iter_cls of the
1330 \bt_src_comp_cls having the ID \bt_p{_component_class_id} in the
1331 plugin having the ID \bt_p{_plugin_id} to \bt_p{_method}.
1332
1333 See the \ref api-msg-iter-cls-meth-fini "finalize" method.
1334
1335 @param[in] _plugin_id
1336 @parblock
1337 C identifier.
1338
1339 ID of the plugin which contains the source component class of which
1340 to set the finalization method of the message iterator class.
1341 @endparblock
1342 @param[in] _component_class_id
1343 @parblock
1344 C identifier.
1345
1346 ID of the source component class, within the plugin having the ID
1347 \bt_p{_plugin_id}, of which to set the finalization method of the
1348 message iterator class to \bt_p{_method}.
1349 @endparblock
1350 @param[in] _method
1351 @parblock
1352 #bt_message_iterator_class_finalize_method
1353
1354 Source component class's message iterator class's finalization method.
1355 @endparblock
1356
1357 @bt_pre_not_null{_method}
1358 */
1359 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1360 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD, _plugin_id, _component_class_id, source, _method)
1361
1362 /*!
1363 @brief
1364 Alias of
1365 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID()
1366 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1367 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1368 */
1369 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD(_name, _method) \
1370 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
1371
1372 /*!
1373 @brief
1374 Sets the initialization method of the \bt_msg_iter_cls of the
1375 \bt_src_comp_cls having the ID \bt_p{_component_class_id} in the
1376 plugin having the ID \bt_p{_plugin_id} to \bt_p{_method}.
1377
1378 See the \ref api-msg-iter-cls-meth-init "initialize" method.
1379
1380 @param[in] _plugin_id
1381 @parblock
1382 C identifier.
1383
1384 ID of the plugin which contains the source component class of which
1385 to set the initialization method of the message iterator class.
1386 @endparblock
1387 @param[in] _component_class_id
1388 @parblock
1389 C identifier.
1390
1391 ID of the source component class, within the plugin having the ID
1392 \bt_p{_plugin_id}, of which to set the initialization method of the
1393 message iterator class to \bt_p{_method}.
1394 @endparblock
1395 @param[in] _method
1396 @parblock
1397 #bt_message_iterator_class_initialize_method
1398
1399 Source component class's message iterator class's initialization
1400 method.
1401 @endparblock
1402
1403 @bt_pre_not_null{_method}
1404 */
1405 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1406 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD, _plugin_id, _component_class_id, source, _method)
1407
1408 /*!
1409 @brief
1410 Alias of
1411 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID()
1412 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1413 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1414 */
1415 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD(_name, _method) \
1416 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
1417
1418 /*!
1419 @brief
1420 Sets the "seek beginning" and "can seek beginning?" methods of the
1421 \bt_msg_iter_cls of the \bt_src_comp_cls having the ID
1422 \bt_p{_component_class_id} in the plugin having the ID
1423 \bt_p{_plugin_id} to \bt_p{_seek_method} and
1424 \bt_p{_can_seek_method}.
1425
1426 See the \ref api-msg-iter-cls-meth-seek-beg "seek beginning" and
1427 \ref api-msg-iter-cls-meth-can-seek-beg "can seek beginning?" methods.
1428
1429 @param[in] _plugin_id
1430 @parblock
1431 C identifier.
1432
1433 ID of the plugin which contains the source component class of which
1434 to set the "seek beginning" and "can seek beginning?" methods of the
1435 message iterator class.
1436 @endparblock
1437 @param[in] _component_class_id
1438 @parblock
1439 C identifier.
1440
1441 ID of the source component class, within the plugin having the ID
1442 \bt_p{_plugin_id}, of which to set the "seek beginning" and "can
1443 seek beginning" methods of the message iterator class to
1444 \bt_p{_seek_method} and \bt_p{_can_seek_method}.
1445 @endparblock
1446 @param[in] _seek_method
1447 @parblock
1448 #bt_message_iterator_class_seek_beginning_method
1449
1450 Source component class's message iterator class's "seek beginning"
1451 method.
1452 @endparblock
1453 @param[in] _can_seek_method
1454 @parblock
1455 #bt_message_iterator_class_can_seek_beginning_method
1456
1457 Source component class's message iterator class's
1458 "can seek beginning?" method.
1459
1460 Can be \c NULL, in which case it is equivalent to setting a method
1461 which always returns #BT_TRUE.
1462 @endparblock
1463
1464 @bt_pre_not_null{_seek_method}
1465 @bt_pre_not_null{_can_seek_method}
1466 */
1467 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS_WITH_ID(_plugin_id, _component_class_id, _seek_method, _can_seek_method) \
1468 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD, _plugin_id, _component_class_id, source, _seek_method); \
1469 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_can_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD, _plugin_id, _component_class_id, source, _can_seek_method)
1470
1471 /*!
1472 @brief
1473 Alias of
1474 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS()
1475 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1476 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1477 */
1478 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS(_name, _seek_method, _can_seek_method) \
1479 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
1480
1481 /*!
1482 @brief
1483 Sets the "seek ns from origin" and "can seek ns from origin?"
1484 methods of the \bt_msg_iter_cls of the \bt_src_comp_cls having the
1485 ID \bt_p{_component_class_id} in the plugin having the ID
1486 \bt_p{_plugin_id} to \bt_p{_seek_method} and
1487 \bt_p{_can_seek_method}.
1488
1489 See the \ref api-msg-iter-cls-meth-seek-ns "seek ns from origin" and
1490 \ref api-msg-iter-cls-meth-can-seek-ns "can seek ns from origin?"
1491 methods.
1492
1493 @param[in] _plugin_id
1494 @parblock
1495 C identifier.
1496
1497 ID of the plugin which contains the source component class of which
1498 to set the "seek ns from origin" and "can seek ns from origin?"
1499 methods of the message iterator class.
1500 @endparblock
1501 @param[in] _component_class_id
1502 @parblock
1503 C identifier.
1504
1505 ID of the source component class, within the plugin having the ID
1506 \bt_p{_plugin_id}, of which to set the "seek ns from origin" and
1507 "can seek ns from origin" methods of the message iterator class to
1508 \bt_p{_seek_method} and \bt_p{_can_seek_method}.
1509 @endparblock
1510 @param[in] _seek_method
1511 @parblock
1512 #bt_message_iterator_class_seek_ns_from_origin_method
1513
1514 Source component class's message iterator class's "seek ns from
1515 origin" method.
1516 @endparblock
1517 @param[in] _can_seek_method
1518 @parblock
1519 #bt_message_iterator_class_can_seek_ns_from_origin_method
1520
1521 Source component class's message iterator class's "can seek ns from
1522 origin?" method.
1523
1524 Can be \c NULL, in which case it is equivalent to setting a method
1525 which always returns #BT_TRUE.
1526 @endparblock
1527
1528 @bt_pre_not_null{_seek_method}
1529 @bt_pre_not_null{_can_seek_method}
1530 */
1531 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(_plugin_id, _component_class_id, _seek_method, _can_seek_method) \
1532 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD, _plugin_id, _component_class_id, source, _seek_method); \
1533 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_can_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD, _plugin_id, _component_class_id, source, _can_seek_method)
1534
1535 /*!
1536 @brief
1537 Alias of
1538 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID()
1539 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1540 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1541 */
1542 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS(_name, _seek_method, _can_seek_method) \
1543 BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
1544
1545 /*!
1546 @brief
1547 Sets the "output port connected" method of the \bt_src_comp_cls
1548 having the ID \bt_p{_component_class_id} in the plugin having the ID
1549 \bt_p{_plugin_id} to \bt_p{_method}.
1550
1551 See the
1552 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
1553 method.
1554
1555 @param[in] _plugin_id
1556 @parblock
1557 C identifier.
1558
1559 ID of the plugin which contains the source component class of which
1560 to set the "output port connected" method.
1561 @endparblock
1562 @param[in] _component_class_id
1563 @parblock
1564 C identifier.
1565
1566 ID of the source component class, within the plugin having the ID
1567 \bt_p{_plugin_id}, of which to set the "output port connected"
1568 method to \bt_p{_method}.
1569 @endparblock
1570 @param[in] _method
1571 @parblock
1572 #bt_component_class_source_output_port_connected_method
1573
1574 Source component class's "output port connected" method.
1575 @endparblock
1576
1577 @bt_pre_not_null{_method}
1578 */
1579 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1580 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_output_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD, _plugin_id, _component_class_id, source, _method)
1581
1582 /*!
1583 @brief
1584 Alias of
1585 BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID()
1586 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1587 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1588 */
1589 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _method) \
1590 BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _method)
1591
1592 /*!
1593 @brief
1594 Sets the query method of the \bt_src_comp_cls
1595 having the ID \bt_p{_component_class_id} in the plugin having the ID
1596 \bt_p{_plugin_id} to \bt_p{_method}.
1597
1598 See the \ref api-comp-cls-dev-meth-query "query" method.
1599
1600 @param[in] _plugin_id
1601 @parblock
1602 C identifier.
1603
1604 ID of the plugin which contains the source component class of which
1605 to set the query method.
1606 @endparblock
1607 @param[in] _component_class_id
1608 @parblock
1609 C identifier.
1610
1611 ID of the source component class, within the plugin having the ID
1612 \bt_p{_plugin_id}, of which to set the query
1613 method to \bt_p{_method}.
1614 @endparblock
1615 @param[in] _method
1616 @parblock
1617 #bt_component_class_source_query_method
1618
1619 Source component class's query method.
1620 @endparblock
1621
1622 @bt_pre_not_null{_method}
1623 */
1624 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1625 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _plugin_id, _component_class_id, source, _method)
1626
1627 /*!
1628 @brief
1629 Alias of
1630 BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID()
1631 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1632 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1633 */
1634 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(_name, _method) \
1635 BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _method)
1636
1637 /*! @} */
1638
1639 /*!
1640 @name Filter component class methods
1641 @{
1642 */
1643
1644 /*!
1645 @brief
1646 Sets the finalization method of the \bt_flt_comp_cls having the ID
1647 \bt_p{_component_class_id} in the plugin having the ID
1648 \bt_p{_plugin_id} to \bt_p{_method}.
1649
1650 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1651
1652 @param[in] _plugin_id
1653 @parblock
1654 C identifier.
1655
1656 ID of the plugin which contains the filter component class of which
1657 to set the finalization method.
1658 @endparblock
1659 @param[in] _component_class_id
1660 @parblock
1661 C identifier.
1662
1663 ID of the filter component class, within the plugin having the ID
1664 \bt_p{_plugin_id}, of which to set the finalization method to
1665 \bt_p{_method}.
1666 @endparblock
1667 @param[in] _method
1668 @parblock
1669 #bt_component_class_filter_finalize_method
1670
1671 Filter component class's finalization method.
1672 @endparblock
1673
1674 @bt_pre_not_null{_method}
1675 */
1676 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1677 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _plugin_id, _component_class_id, filter, _method)
1678
1679 /*!
1680 @brief
1681 Alias of
1682 BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID()
1683 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1684 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1685 */
1686 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(_name, _method) \
1687 BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
1688
1689 /*!
1690 @brief
1691 Sets the \"get supported \bt_mip versions\" method of the
1692 \bt_flt_comp_cls having the ID \bt_p{_component_class_id} in the
1693 plugin having the ID \bt_p{_plugin_id} to \bt_p{_method}.
1694
1695 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1696 method.
1697
1698 @param[in] _plugin_id
1699 @parblock
1700 C identifier.
1701
1702 ID of the plugin which contains the filter component class of which
1703 to set the "get supported MIP versions" method.
1704 @endparblock
1705 @param[in] _component_class_id
1706 @parblock
1707 C identifier.
1708
1709 ID of the filter component class, within the plugin having the ID
1710 \bt_p{_plugin_id}, of which to set the "get supported MIP versions"
1711 method to \bt_p{_method}.
1712 @endparblock
1713 @param[in] _method
1714 @parblock
1715 #bt_component_class_filter_get_supported_mip_versions_method
1716
1717 Filter component class's "get supported MIP versions" method.
1718 @endparblock
1719
1720 @bt_pre_not_null{_method}
1721 */
1722 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1723 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD, _plugin_id, _component_class_id, filter, _method)
1724
1725 /*!
1726 @brief
1727 Alias of
1728 BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID()
1729 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1730 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1731 */
1732 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _method) \
1733 BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _method)
1734
1735 /*!
1736 @brief
1737 Sets the initialization method of the \bt_flt_comp_cls having the ID
1738 \bt_p{_component_class_id} in the plugin having the ID
1739 \bt_p{_plugin_id} to \bt_p{_method}.
1740
1741 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1742
1743 @param[in] _plugin_id
1744 @parblock
1745 C identifier.
1746
1747 ID of the plugin which contains the filter component class of which
1748 to set the initialization method.
1749 @endparblock
1750 @param[in] _component_class_id
1751 @parblock
1752 C identifier.
1753
1754 ID of the filter component class, within the plugin having the ID
1755 \bt_p{_plugin_id}, of which to set the initialization method to
1756 \bt_p{_method}.
1757 @endparblock
1758 @param[in] _method
1759 @parblock
1760 #bt_component_class_filter_initialize_method
1761
1762 Filter component class's initialization method.
1763 @endparblock
1764
1765 @bt_pre_not_null{_method}
1766 */
1767 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1768 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD, _plugin_id, _component_class_id, filter, _method)
1769
1770 /*!
1771 @brief
1772 Alias of
1773 BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID()
1774 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1775 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1776 */
1777 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _method) \
1778 BT_PLUGIN_FILTER_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
1779
1780 /*!
1781 @brief
1782 Sets the "input port connected" method of the \bt_flt_comp_cls
1783 having the ID \bt_p{_component_class_id} in the plugin having the ID
1784 \bt_p{_plugin_id} to \bt_p{_method}.
1785
1786 See the
1787 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
1788 method.
1789
1790 @param[in] _plugin_id
1791 @parblock
1792 C identifier.
1793
1794 ID of the plugin which contains the filter component class of which
1795 to set the "input port connected" method.
1796 @endparblock
1797 @param[in] _component_class_id
1798 @parblock
1799 C identifier.
1800
1801 ID of the filter component class, within the plugin having the ID
1802 \bt_p{_plugin_id}, of which to set the "input port connected"
1803 method to \bt_p{_method}.
1804 @endparblock
1805 @param[in] _method
1806 @parblock
1807 #bt_component_class_filter_input_port_connected_method
1808
1809 Filter component class's "input port connected" method.
1810 @endparblock
1811
1812 @bt_pre_not_null{_method}
1813 */
1814 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1815 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_input_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD, _plugin_id, _component_class_id, filter, _method)
1816
1817 /*!
1818 @brief
1819 Alias of
1820 BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID()
1821 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1822 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1823 */
1824 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _method) \
1825 BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _method)
1826
1827 /*!
1828 @brief
1829 Sets the finalization method of the \bt_msg_iter_cls of the
1830 \bt_flt_comp_cls having the ID \bt_p{_component_class_id} in the
1831 plugin having the ID \bt_p{_plugin_id} to \bt_p{_method}.
1832
1833 See the \ref api-msg-iter-cls-meth-fini "finalize" method.
1834
1835 @param[in] _plugin_id
1836 @parblock
1837 C identifier.
1838
1839 ID of the plugin which contains the filter component class of which
1840 to set the finalization method of the message iterator class.
1841 @endparblock
1842 @param[in] _component_class_id
1843 @parblock
1844 C identifier.
1845
1846 ID of the filter component class, within the plugin having the ID
1847 \bt_p{_plugin_id}, of which to set the finalization method of the
1848 message iterator class to \bt_p{_method}.
1849 @endparblock
1850 @param[in] _method
1851 @parblock
1852 #bt_message_iterator_class_finalize_method
1853
1854 Filter component class's message iterator class's finalization method.
1855 @endparblock
1856
1857 @bt_pre_not_null{_method}
1858 */
1859 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1860 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD, _plugin_id, _component_class_id, filter, _method)
1861
1862 /*!
1863 @brief
1864 Alias of
1865 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID()
1866 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1867 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1868 */
1869 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD(_name, _method) \
1870 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
1871
1872 /*!
1873 @brief
1874 Sets the initialization method of the \bt_msg_iter_cls of the
1875 \bt_flt_comp_cls having the ID \bt_p{_component_class_id} in the
1876 plugin having the ID \bt_p{_plugin_id} to \bt_p{_method}.
1877
1878 See the \ref api-msg-iter-cls-meth-init "initialize" method.
1879
1880 @param[in] _plugin_id
1881 @parblock
1882 C identifier.
1883
1884 ID of the plugin which contains the filter component class of which
1885 to set the initialization method of the message iterator class.
1886 @endparblock
1887 @param[in] _component_class_id
1888 @parblock
1889 C identifier.
1890
1891 ID of the filter component class, within the plugin having the ID
1892 \bt_p{_plugin_id}, of which to set the initialization method of the
1893 message iterator class to \bt_p{_method}.
1894 @endparblock
1895 @param[in] _method
1896 @parblock
1897 #bt_message_iterator_class_initialize_method
1898
1899 Filter component class's message iterator class's initialization
1900 method.
1901 @endparblock
1902
1903 @bt_pre_not_null{_method}
1904 */
1905 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
1906 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD, _plugin_id, _component_class_id, filter, _method)
1907
1908 /*!
1909 @brief
1910 Alias of
1911 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID()
1912 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1913 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1914 */
1915 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD(_name, _method) \
1916 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
1917
1918 /*!
1919 @brief
1920 Sets the "seek beginning" and "can seek beginning?" methods of the
1921 \bt_msg_iter_cls of the \bt_flt_comp_cls having the ID
1922 \bt_p{_component_class_id} in the plugin having the ID
1923 \bt_p{_plugin_id} to \bt_p{_seek_method} and
1924 \bt_p{_can_seek_method}.
1925
1926 See the \ref api-msg-iter-cls-meth-seek-beg "seek beginning" and
1927 \ref api-msg-iter-cls-meth-can-seek-beg "can seek beginning?" methods.
1928
1929 @param[in] _plugin_id
1930 @parblock
1931 C identifier.
1932
1933 ID of the plugin which contains the filter component class of which
1934 to set the "seek beginning" and "can seek beginning?" methods of the
1935 message iterator class.
1936 @endparblock
1937 @param[in] _component_class_id
1938 @parblock
1939 C identifier.
1940
1941 ID of the filter component class, within the plugin having the ID
1942 \bt_p{_plugin_id}, of which to set the "seek beginning" and "can
1943 seek beginning" methods of the message iterator class to
1944 \bt_p{_seek_method} and \bt_p{_can_seek_method}.
1945 @endparblock
1946 @param[in] _seek_method
1947 @parblock
1948 #bt_message_iterator_class_seek_beginning_method
1949
1950 Filter component class's message iterator class's "seek beginning"
1951 method.
1952 @endparblock
1953 @param[in] _can_seek_method
1954 @parblock
1955 #bt_message_iterator_class_can_seek_beginning_method
1956
1957 Filter component class's message iterator class's
1958 "can seek beginning?" method.
1959
1960 Can be \c NULL, in which case it is equivalent to setting a method
1961 which always returns #BT_TRUE.
1962 @endparblock
1963
1964 @bt_pre_not_null{_seek_method}
1965 @bt_pre_not_null{_can_seek_method}
1966 */
1967 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS_WITH_ID(_plugin_id, _component_class_id, _seek_method, _can_seek_method) \
1968 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD, _plugin_id, _component_class_id, filter, _seek_method); \
1969 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_can_seek_beginning_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD, _plugin_id, _component_class_id, filter, _can_seek_method);
1970
1971 /*!
1972 @brief
1973 Alias of
1974 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS_WITH_ID()
1975 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
1976 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
1977 */
1978 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS(_name, _seek_method, _can_seek_method) \
1979 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
1980
1981 /*!
1982 @brief
1983 Sets the "seek ns from origin" and "can seek ns from origin?"
1984 methods of the \bt_msg_iter_cls of the \bt_flt_comp_cls having the
1985 ID \bt_p{_component_class_id} in the plugin having the ID
1986 \bt_p{_plugin_id} to \bt_p{_seek_method} and
1987 \bt_p{_can_seek_method}.
1988
1989 See the \ref api-msg-iter-cls-meth-seek-ns "seek ns from origin" and
1990 \ref api-msg-iter-cls-meth-can-seek-ns "can seek ns from origin?"
1991 methods.
1992
1993 @param[in] _plugin_id
1994 @parblock
1995 C identifier.
1996
1997 ID of the plugin which contains the filter component class of which
1998 to set the "seek ns from origin" and "can seek ns from origin?"
1999 methods of the message iterator class.
2000 @endparblock
2001 @param[in] _component_class_id
2002 @parblock
2003 C identifier.
2004
2005 ID of the filter component class, within the plugin having the ID
2006 \bt_p{_plugin_id}, of which to set the "seek ns from origin" and
2007 "can seek ns from origin" methods of the message iterator class to
2008 \bt_p{_seek_method} and \bt_p{_can_seek_method}.
2009 @endparblock
2010 @param[in] _seek_method
2011 @parblock
2012 #bt_message_iterator_class_seek_ns_from_origin_method
2013
2014 Filter component class's message iterator class's "seek ns from
2015 origin" method.
2016 @endparblock
2017 @param[in] _can_seek_method
2018 @parblock
2019 #bt_message_iterator_class_can_seek_ns_from_origin_method
2020
2021 Filter component class's message iterator class's "can seek ns from
2022 origin?" method.
2023
2024 Can be \c NULL, in which case it is equivalent to setting a method
2025 which always returns #BT_TRUE.
2026 @endparblock
2027
2028 @bt_pre_not_null{_seek_method}
2029 @bt_pre_not_null{_can_seek_method}
2030 */
2031 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(_plugin_id, _component_class_id, _seek_method, _can_seek_method) \
2032 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD, _plugin_id, _component_class_id, filter, _seek_method); \
2033 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(msg_iter_can_seek_ns_from_origin_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD, _plugin_id, _component_class_id, filter, _can_seek_method)
2034
2035 /*!
2036 @brief
2037 Alias of
2038 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID()
2039 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
2040 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
2041 */
2042 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS(_name, _seek_method, _can_seek_method) \
2043 BT_PLUGIN_FILTER_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHODS_WITH_ID(auto, _name, _seek_method, _can_seek_method)
2044
2045 /*!
2046 @brief
2047 Sets the "output port connected" method of the \bt_flt_comp_cls
2048 having the ID \bt_p{_component_class_id} in the plugin having the ID
2049 \bt_p{_plugin_id} to \bt_p{_method}.
2050
2051 See the
2052 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
2053 method.
2054
2055 @param[in] _plugin_id
2056 @parblock
2057 C identifier.
2058
2059 ID of the plugin which contains the filter component class of which
2060 to set the "output port connected" method.
2061 @endparblock
2062 @param[in] _component_class_id
2063 @parblock
2064 C identifier.
2065
2066 ID of the filter component class, within the plugin having the ID
2067 \bt_p{_plugin_id}, of which to set the "output port connected"
2068 method to \bt_p{_method}.
2069 @endparblock
2070 @param[in] _method
2071 @parblock
2072 #bt_component_class_filter_output_port_connected_method
2073
2074 Filter component class's "output port connected" method.
2075 @endparblock
2076
2077 @bt_pre_not_null{_method}
2078 */
2079 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2080 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_output_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD, _plugin_id, _component_class_id, filter, _method)
2081
2082 /*!
2083 @brief
2084 Alias of
2085 BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID()
2086 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
2087 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
2088 */
2089 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _method) \
2090 BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _method)
2091
2092 /*!
2093 @brief
2094 Sets the query method of the \bt_flt_comp_cls
2095 having the ID \bt_p{_component_class_id} in the plugin having the ID
2096 \bt_p{_plugin_id} to \bt_p{_method}.
2097
2098 See the \ref api-comp-cls-dev-meth-query "query" method.
2099
2100 @param[in] _plugin_id
2101 @parblock
2102 C identifier.
2103
2104 ID of the plugin which contains the filter component class of which
2105 to set the query method.
2106 @endparblock
2107 @param[in] _component_class_id
2108 @parblock
2109 C identifier.
2110
2111 ID of the filter component class, within the plugin having the ID
2112 \bt_p{_plugin_id}, of which to set the query
2113 method to \bt_p{_method}.
2114 @endparblock
2115 @param[in] _method
2116 @parblock
2117 #bt_component_class_filter_query_method
2118
2119 Filter component class's query method.
2120 @endparblock
2121
2122 @bt_pre_not_null{_method}
2123 */
2124 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2125 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _plugin_id, _component_class_id, filter, _method)
2126
2127 /*!
2128 @brief
2129 Alias of
2130 BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID()
2131 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
2132 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
2133 */
2134 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(_name, _method) \
2135 BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _method)
2136
2137 /*! @} */
2138
2139 /*!
2140 @name Sink component class methods
2141 @{
2142 */
2143
2144 /*!
2145 @brief
2146 Sets the finalization method of the \bt_sink_comp_cls having the ID
2147 \bt_p{_component_class_id} in the plugin having the ID
2148 \bt_p{_plugin_id} to \bt_p{_method}.
2149
2150 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
2151
2152 @param[in] _plugin_id
2153 @parblock
2154 C identifier.
2155
2156 ID of the plugin which contains the sink component class of which
2157 to set the finalization method.
2158 @endparblock
2159 @param[in] _component_class_id
2160 @parblock
2161 C identifier.
2162
2163 ID of the sink component class, within the plugin having the ID
2164 \bt_p{_plugin_id}, of which to set the finalization method to
2165 \bt_p{_method}.
2166 @endparblock
2167 @param[in] _method
2168 @parblock
2169 #bt_component_class_sink_finalize_method
2170
2171 Sink component class's finalization method.
2172 @endparblock
2173
2174 @bt_pre_not_null{_method}
2175 */
2176 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2177 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _plugin_id, _component_class_id, sink, _method)
2178
2179 /*!
2180 @brief
2181 Alias of
2182 BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID()
2183 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
2184 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
2185 */
2186 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _method) \
2187 BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _method)
2188
2189 /*!
2190 @brief
2191 Sets the \"get supported \bt_mip versions\" method of the
2192 \bt_sink_comp_cls having the ID \bt_p{_component_class_id} in the
2193 plugin having the ID \bt_p{_plugin_id} to \bt_p{_method}.
2194
2195 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
2196 method.
2197
2198 @param[in] _plugin_id
2199 @parblock
2200 C identifier.
2201
2202 ID of the plugin which contains the sink component class of which
2203 to set the "get supported MIP versions" method.
2204 @endparblock
2205 @param[in] _component_class_id
2206 @parblock
2207 C identifier.
2208
2209 ID of the sink component class, within the plugin having the ID
2210 \bt_p{_plugin_id}, of which to set the "get supported MIP versions"
2211 method to \bt_p{_method}.
2212 @endparblock
2213 @param[in] _method
2214 @parblock
2215 #bt_component_class_sink_get_supported_mip_versions_method
2216
2217 Sink component class's "get supported MIP versions" method.
2218 @endparblock
2219
2220 @bt_pre_not_null{_method}
2221 */
2222 #define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2223 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD, _plugin_id, _component_class_id, sink, _method)
2224
2225 /*!
2226 @brief
2227 Alias of
2228 BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID()
2229 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
2230 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
2231 */
2232 #define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _method) \
2233 BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _method)
2234
2235 /*!
2236 @brief
2237 Sets the "graph is configured" method of the \bt_sink_comp_cls
2238 having the ID \bt_p{_component_class_id} in the plugin having the ID
2239 \bt_p{_plugin_id} to \bt_p{_method}.
2240
2241 See the
2242 \ref api-comp-cls-dev-meth-graph-configured "graph is configured"
2243 method.
2244
2245 @param[in] _plugin_id
2246 @parblock
2247 C identifier.
2248
2249 ID of the plugin which contains the sink component class of which
2250 to set the "graph is configured" method.
2251 @endparblock
2252 @param[in] _component_class_id
2253 @parblock
2254 C identifier.
2255
2256 ID of the sink component class, within the plugin having the ID
2257 \bt_p{_plugin_id}, of which to set the "graph is configured"
2258 method to \bt_p{_method}.
2259 @endparblock
2260 @param[in] _method
2261 @parblock
2262 #bt_component_class_sink_graph_is_configured_method
2263
2264 Sink component class's "graph is configured" method.
2265 @endparblock
2266
2267 @bt_pre_not_null{_method}
2268 */
2269 #define BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2270 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_graph_is_configured_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD, _plugin_id, _component_class_id, sink, _method)
2271
2272 /*!
2273 @brief
2274 Alias of
2275 BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD_WITH_ID()
2276 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
2277 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
2278 */
2279 #define BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(_name, _method) \
2280 BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD_WITH_ID(auto, _name, _method)
2281
2282 /*!
2283 @brief
2284 Sets the initialization method of the \bt_sink_comp_cls having the
2285 ID \bt_p{_component_class_id} in the plugin having the ID
2286 \bt_p{_plugin_id} to \bt_p{_method}.
2287
2288 See the \ref api-comp-cls-dev-meth-init "initialize" method.
2289
2290 @param[in] _plugin_id
2291 @parblock
2292 C identifier.
2293
2294 ID of the plugin which contains the sink component class of which
2295 to set the initialization method.
2296 @endparblock
2297 @param[in] _component_class_id
2298 @parblock
2299 C identifier.
2300
2301 ID of the sink component class, within the plugin having the ID
2302 \bt_p{_plugin_id}, of which to set the initialization method to
2303 \bt_p{_method}.
2304 @endparblock
2305 @param[in] _method
2306 @parblock
2307 #bt_component_class_sink_initialize_method
2308
2309 Sink component class's initialization method.
2310 @endparblock
2311
2312 @bt_pre_not_null{_method}
2313 */
2314 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2315 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_initialize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD, _plugin_id, _component_class_id, sink, _method)
2316
2317 /*!
2318 @brief
2319 Alias of
2320 BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID()
2321 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
2322 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
2323 */
2324 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(_name, _method) \
2325 BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD_WITH_ID(auto, _name, _method)
2326
2327 /*!
2328 @brief
2329 Sets the "input port connected" method of the \bt_sink_comp_cls
2330 having the ID \bt_p{_component_class_id} in the plugin having the ID
2331 \bt_p{_plugin_id} to \bt_p{_method}.
2332
2333 See the
2334 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
2335 method.
2336
2337 @param[in] _plugin_id
2338 @parblock
2339 C identifier.
2340
2341 ID of the plugin which contains the sink component class of which
2342 to set the "input port connected" method.
2343 @endparblock
2344 @param[in] _component_class_id
2345 @parblock
2346 C identifier.
2347
2348 ID of the sink component class, within the plugin having the ID
2349 \bt_p{_plugin_id}, of which to set the "input port connected"
2350 method to \bt_p{_method}.
2351 @endparblock
2352 @param[in] _method
2353 @parblock
2354 #bt_component_class_sink_input_port_connected_method
2355
2356 Sink component class's "input port connected" method.
2357 @endparblock
2358
2359 @bt_pre_not_null{_method}
2360 */
2361 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2362 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_input_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD, _plugin_id, _component_class_id, sink, _method)
2363
2364 /*!
2365 @brief
2366 Alias of
2367 BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID()
2368 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
2369 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
2370 */
2371 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _method) \
2372 BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _method)
2373
2374 /*!
2375 @brief
2376 Sets the query method of the \bt_sink_comp_cls
2377 having the ID \bt_p{_component_class_id} in the plugin having the ID
2378 \bt_p{_plugin_id} to \bt_p{_method}.
2379
2380 See the \ref api-comp-cls-dev-meth-query "query" method.
2381
2382 @param[in] _plugin_id
2383 @parblock
2384 C identifier.
2385
2386 ID of the plugin which contains the sink component class of which
2387 to set the query method.
2388 @endparblock
2389 @param[in] _component_class_id
2390 @parblock
2391 C identifier.
2392
2393 ID of the sink component class, within the plugin having the ID
2394 \bt_p{_plugin_id}, of which to set the query
2395 method to \bt_p{_method}.
2396 @endparblock
2397 @param[in] _method
2398 @parblock
2399 #bt_component_class_sink_query_method
2400
2401 Sink component class's query method.
2402 @endparblock
2403
2404 @bt_pre_not_null{_method}
2405 */
2406 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_plugin_id, _component_class_id, _method) \
2407 __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _plugin_id, _component_class_id, sink, _method)
2408
2409 /*!
2410 @brief
2411 Alias of
2412 BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID()
2413 with the \bt_p{_plugin_id} parameter set to <code>auto</code> and
2414 the \bt_p{_component_class_id} parameter set to \bt_p{_name}.
2415 */
2416 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _method) \
2417 BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _method)
2418
2419 /*! @} */
2420
2421 /*! @} */
2422
2423 /* Plugin descriptor: describes a single plugin (internal use) */
2424 struct __bt_plugin_descriptor {
2425 /* Plugin's name */
2426 const char *name;
2427 } __attribute__((packed));
2428
2429 /* Type of a plugin attribute (internal use) */
2430 enum __bt_plugin_descriptor_attribute_type {
2431 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT = 0,
2432 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT = 1,
2433 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR = 2,
2434 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE = 3,
2435 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 4,
2436 BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION = 5,
2437 };
2438
2439 /* Plugin (user) version */
2440 struct __bt_plugin_descriptor_version {
2441 uint32_t major;
2442 uint32_t minor;
2443 uint32_t patch;
2444 const char *extra;
2445 };
2446
2447 /* Plugin attribute (internal use) */
2448 struct __bt_plugin_descriptor_attribute {
2449 /* Plugin descriptor to which to associate this attribute */
2450 const struct __bt_plugin_descriptor *plugin_descriptor;
2451
2452 /* Name of the attribute's type for debug purposes */
2453 const char *type_name;
2454
2455 /* Attribute's type */
2456 enum __bt_plugin_descriptor_attribute_type type;
2457
2458 /* Attribute's value (depends on attribute's type) */
2459 union {
2460 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_INIT */
2461 bt_plugin_initialize_func init;
2462
2463 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_EXIT */
2464 bt_plugin_finalize_func exit;
2465
2466 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_AUTHOR */
2467 const char *author;
2468
2469 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_LICENSE */
2470 const char *license;
2471
2472 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
2473 const char *description;
2474
2475 /* BT_PLUGIN_DESCRIPTOR_ATTRIBUTE_TYPE_VERSION */
2476 struct __bt_plugin_descriptor_version version;
2477 } value;
2478 } __attribute__((packed));
2479
2480 /* Component class descriptor (internal use) */
2481 struct __bt_plugin_component_class_descriptor {
2482 /*
2483 * Plugin descriptor to which to associate this component
2484 * class descriptor.
2485 */
2486 const struct __bt_plugin_descriptor *plugin_descriptor;
2487
2488 /* Component class name */
2489 const char *name;
2490
2491 /* Component class type */
2492 bt_component_class_type type;
2493
2494 /* Mandatory methods (depends on component class type) */
2495 union {
2496 /* BT_COMPONENT_CLASS_TYPE_SOURCE */
2497 struct {
2498 bt_message_iterator_class_next_method msg_iter_next;
2499 } source;
2500
2501 /* BT_COMPONENT_CLASS_TYPE_FILTER */
2502 struct {
2503 bt_message_iterator_class_next_method msg_iter_next;
2504 } filter;
2505
2506 /* BT_COMPONENT_CLASS_TYPE_SINK */
2507 struct {
2508 bt_component_class_sink_consume_method consume;
2509 } sink;
2510 } methods;
2511 } __attribute__((packed));
2512
2513 /* Type of a component class attribute (internal use) */
2514 enum __bt_plugin_component_class_descriptor_attribute_type {
2515 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 0,
2516 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP = 1,
2517 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD = 2,
2518 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD = 3,
2519 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD = 4,
2520 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD = 5,
2521 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD = 6,
2522 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD = 7,
2523 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD = 8,
2524 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD = 9,
2525 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD = 10,
2526 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD = 11,
2527 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD = 12,
2528 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD = 13,
2529 BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD = 14,
2530 };
2531
2532 /* Component class attribute (internal use) */
2533 struct __bt_plugin_component_class_descriptor_attribute {
2534 /*
2535 * Component class plugin attribute to which to associate this
2536 * component class attribute.
2537 */
2538 const struct __bt_plugin_component_class_descriptor *comp_class_descriptor;
2539
2540 /* Name of the attribute's type for debug purposes */
2541 const char *type_name;
2542
2543 /* Attribute's type */
2544 enum __bt_plugin_component_class_descriptor_attribute_type type;
2545
2546 /* Attribute's value (depends on attribute's type) */
2547 union {
2548 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION */
2549 const char *description;
2550
2551 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
2552 const char *help;
2553
2554 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD */
2555 bt_component_class_source_get_supported_mip_versions_method source_get_supported_mip_versions_method;
2556 bt_component_class_filter_get_supported_mip_versions_method filter_get_supported_mip_versions_method;
2557 bt_component_class_sink_get_supported_mip_versions_method sink_get_supported_mip_versions_method;
2558
2559 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD */
2560 bt_component_class_source_initialize_method source_initialize_method;
2561 bt_component_class_filter_initialize_method filter_initialize_method;
2562 bt_component_class_sink_initialize_method sink_initialize_method;
2563
2564 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */
2565 bt_component_class_source_finalize_method source_finalize_method;
2566 bt_component_class_filter_finalize_method filter_finalize_method;
2567 bt_component_class_sink_finalize_method sink_finalize_method;
2568
2569 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD */
2570 bt_component_class_source_query_method source_query_method;
2571 bt_component_class_filter_query_method filter_query_method;
2572 bt_component_class_sink_query_method sink_query_method;
2573
2574 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD */
2575 bt_component_class_filter_input_port_connected_method filter_input_port_connected_method;
2576 bt_component_class_sink_input_port_connected_method sink_input_port_connected_method;
2577
2578 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD */
2579 bt_component_class_source_output_port_connected_method source_output_port_connected_method;
2580 bt_component_class_filter_output_port_connected_method filter_output_port_connected_method;
2581
2582 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD */
2583 bt_component_class_sink_graph_is_configured_method sink_graph_is_configured_method;
2584
2585 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD */
2586 bt_message_iterator_class_initialize_method msg_iter_initialize_method;
2587
2588 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD */
2589 bt_message_iterator_class_finalize_method msg_iter_finalize_method;
2590
2591 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD */
2592 bt_message_iterator_class_seek_ns_from_origin_method msg_iter_seek_ns_from_origin_method;
2593
2594 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD */
2595 bt_message_iterator_class_seek_beginning_method msg_iter_seek_beginning_method;
2596
2597 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD */
2598 bt_message_iterator_class_can_seek_ns_from_origin_method msg_iter_can_seek_ns_from_origin_method;
2599
2600 /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD */
2601 bt_message_iterator_class_can_seek_beginning_method msg_iter_can_seek_beginning_method;
2602 } value;
2603 } __attribute__((packed));
2604
2605 struct __bt_plugin_descriptor const * const *__bt_get_begin_section_plugin_descriptors(void);
2606 struct __bt_plugin_descriptor const * const *__bt_get_end_section_plugin_descriptors(void);
2607 struct __bt_plugin_descriptor_attribute const * const *__bt_get_begin_section_plugin_descriptor_attributes(void);
2608 struct __bt_plugin_descriptor_attribute const * const *__bt_get_end_section_plugin_descriptor_attributes(void);
2609 struct __bt_plugin_component_class_descriptor const * const *__bt_get_begin_section_component_class_descriptors(void);
2610 struct __bt_plugin_component_class_descriptor const * const *__bt_get_end_section_component_class_descriptors(void);
2611 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_begin_section_component_class_descriptor_attributes(void);
2612 struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_end_section_component_class_descriptor_attributes(void);
2613
2614 /*
2615 * Defines a plugin attribute (generic, internal use).
2616 *
2617 * _attr_name: Name of the attribute (C identifier).
2618 * _attr_type: Type of the attribute (enum __bt_plugin_descriptor_attribute_type).
2619 * _id: Plugin descriptor ID (C identifier).
2620 * _x: Value.
2621 */
2622 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _x) \
2623 static struct __bt_plugin_descriptor_attribute __bt_plugin_descriptor_attribute_##_id##_##_attr_name = { \
2624 .plugin_descriptor = &__bt_plugin_descriptor_##_id, \
2625 .type_name = #_attr_name, \
2626 .type = _attr_type, \
2627 .value = { ._attr_name = _x }, \
2628 }; \
2629 static struct __bt_plugin_descriptor_attribute const * const __bt_plugin_descriptor_attribute_##_id##_##_attr_name##_ptr __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS = &__bt_plugin_descriptor_attribute_##_id##_##_attr_name
2630
2631 #define __BT_PLUGIN_VERSION_STRUCT_VALUE(_major, _minor, _patch, _extra) \
2632 {.major = _major, .minor = _minor, .patch = _patch, .extra = _extra,}
2633
2634 /*
2635 * Defines a component class descriptor attribute (generic, internal
2636 * use).
2637 *
2638 * _id: Plugin descriptor ID (C identifier).
2639 * _component_class_id: Component class ID (C identifier).
2640 * _type: Component class type (`source`, `filter`, or `sink`).
2641 * _attr_name: Name of the attribute (C identifier).
2642 * _attr_type: Type of the attribute
2643 * (enum __bt_plugin_descriptor_attribute_type).
2644 * _x: Value.
2645 */
2646 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(_attr_name, _attr_type, _id, _component_class_id, _type, _x) \
2647 static struct __bt_plugin_component_class_descriptor_attribute __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_component_class_id##_##_attr_name = { \
2648 .comp_class_descriptor = &__bt_plugin_##_type##_component_class_descriptor_##_id##_##_component_class_id, \
2649 .type_name = #_attr_name, \
2650 .type = _attr_type, \
2651 .value = { ._attr_name = _x }, \
2652 }; \
2653 static struct __bt_plugin_component_class_descriptor_attribute const * const __bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_component_class_id##_##_attr_name##_ptr __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS = &__bt_plugin_##_type##_component_class_descriptor_attribute_##_id##_##_component_class_id##_##_attr_name
2654
2655 /*
2656 * Clang supports the no_sanitize variable attribute on global variables.
2657 * GCC only supports the no_sanitize_address function attribute, which is
2658 * not what we need. This is fine because, as far as we have seen, gcc
2659 * does not insert red zones around global variables.
2660 */
2661 #if defined(__clang__)
2662 # if __has_feature(address_sanitizer)
2663 # define __bt_plugin_variable_attribute_no_sanitize_address \
2664 __attribute__((no_sanitize("address")))
2665 # else
2666 # define __bt_plugin_variable_attribute_no_sanitize_address
2667 # endif
2668 #else
2669 # define __bt_plugin_variable_attribute_no_sanitize_address
2670 #endif
2671
2672 /*
2673 * Variable attributes for a plugin descriptor pointer to be added to
2674 * the plugin descriptor section (internal use).
2675 */
2676 #ifdef __APPLE__
2677 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
2678 __attribute__((section("__DATA,btp_desc"), used)) \
2679 __bt_plugin_variable_attribute_no_sanitize_address
2680
2681 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
2682 __start___bt_plugin_descriptors
2683
2684 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
2685 __stop___bt_plugin_descriptors
2686
2687 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA \
2688 __asm("section$start$__DATA$btp_desc")
2689
2690 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA \
2691 __asm("section$end$__DATA$btp_desc")
2692
2693 #else
2694
2695 #define __BT_PLUGIN_DESCRIPTOR_ATTRS \
2696 __attribute__((section("__bt_plugin_descriptors"), used)) \
2697 __bt_plugin_variable_attribute_no_sanitize_address
2698
2699 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_SYMBOL \
2700 __start___bt_plugin_descriptors
2701
2702 #define __BT_PLUGIN_DESCRIPTOR_END_SYMBOL \
2703 __stop___bt_plugin_descriptors
2704
2705 #define __BT_PLUGIN_DESCRIPTOR_BEGIN_EXTRA
2706
2707 #define __BT_PLUGIN_DESCRIPTOR_END_EXTRA
2708 #endif
2709
2710 /*
2711 * Variable attributes for a plugin attribute pointer to be added to
2712 * the plugin attribute section (internal use).
2713 */
2714 #ifdef __APPLE__
2715 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
2716 __attribute__((section("__DATA,btp_desc_att"), used)) \
2717 __bt_plugin_variable_attribute_no_sanitize_address
2718
2719 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2720 __start___bt_plugin_descriptor_attributes
2721
2722 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
2723 __stop___bt_plugin_descriptor_attributes
2724
2725 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
2726 __asm("section$start$__DATA$btp_desc_att")
2727
2728 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
2729 __asm("section$end$__DATA$btp_desc_att")
2730
2731 #else
2732
2733 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_ATTRS \
2734 __attribute__((section("__bt_plugin_descriptor_attributes"), used)) \
2735 __bt_plugin_variable_attribute_no_sanitize_address
2736
2737 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2738 __start___bt_plugin_descriptor_attributes
2739
2740 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
2741 __stop___bt_plugin_descriptor_attributes
2742
2743 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
2744
2745 #define __BT_PLUGIN_DESCRIPTOR_ATTRIBUTES_END_EXTRA
2746 #endif
2747
2748 /*
2749 * Variable attributes for a component class descriptor pointer to be
2750 * added to the component class descriptor section (internal use).
2751 */
2752 #ifdef __APPLE__
2753 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
2754 __attribute__((section("__DATA,btp_cc_desc"), used)) \
2755 __bt_plugin_variable_attribute_no_sanitize_address
2756
2757 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
2758 __start___bt_plugin_component_class_descriptors
2759
2760 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
2761 __stop___bt_plugin_component_class_descriptors
2762
2763 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA \
2764 __asm("section$start$__DATA$btp_cc_desc")
2765
2766 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA \
2767 __asm("section$end$__DATA$btp_cc_desc")
2768
2769 #else
2770
2771 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRS \
2772 __attribute__((section("__bt_plugin_component_class_descriptors"), used)) \
2773 __bt_plugin_variable_attribute_no_sanitize_address
2774
2775 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_SYMBOL \
2776 __start___bt_plugin_component_class_descriptors
2777
2778 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_SYMBOL \
2779 __stop___bt_plugin_component_class_descriptors
2780
2781 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_BEGIN_EXTRA
2782
2783 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_END_EXTRA
2784 #endif
2785
2786 /*
2787 * Variable attributes for a component class descriptor attribute
2788 * pointer to be added to the component class descriptor attribute
2789 * section (internal use).
2790 */
2791 #ifdef __APPLE__
2792 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
2793 __attribute__((section("__DATA,btp_cc_desc_att"), used)) \
2794 __bt_plugin_variable_attribute_no_sanitize_address
2795
2796 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2797 __start___bt_plugin_component_class_descriptor_attributes
2798
2799 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
2800 __stop___bt_plugin_component_class_descriptor_attributes
2801
2802 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA \
2803 __asm("section$start$__DATA$btp_cc_desc_att")
2804
2805 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA \
2806 __asm("section$end$__DATA$btp_cc_desc_att")
2807
2808 #else
2809
2810 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_ATTRS \
2811 __attribute__((section("__bt_plugin_component_class_descriptor_attributes"), used)) \
2812 __bt_plugin_variable_attribute_no_sanitize_address
2813
2814 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_SYMBOL \
2815 __start___bt_plugin_component_class_descriptor_attributes
2816
2817 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_SYMBOL \
2818 __stop___bt_plugin_component_class_descriptor_attributes
2819
2820 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_BEGIN_EXTRA
2821
2822 #define __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTES_END_EXTRA
2823 #endif
2824
2825 #ifdef __cplusplus
2826 }
2827 #endif
2828
2829 #endif /* BABELTRACE2_PLUGIN_PLUGIN_DEV_H */
This page took 0.14887 seconds and 4 git commands to generate.