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