extern "C" {
#endif
+typedef bt_component_class_get_supported_mip_versions_method_status
+(*bt_component_class_filter_get_supported_mip_versions_method)(
+ bt_self_component_class_filter *comp_class,
+ const bt_value *params, void *init_method_data,
+ bt_logging_level log_level,
+ bt_integer_range_set_unsigned *supported_versions);
+
typedef bt_component_class_init_method_status
(*bt_component_class_filter_init_method)(
bt_self_component_filter *self_component,
const char *name,
bt_component_class_filter_message_iterator_next_method method);
+extern bt_component_class_set_method_status
+bt_component_class_filter_set_get_supported_mip_versions_method(
+ bt_component_class_filter *comp_class,
+ bt_component_class_filter_get_supported_mip_versions_method method);
+
extern bt_component_class_set_method_status
bt_component_class_filter_set_init_method(
bt_component_class_filter *comp_class,
extern "C" {
#endif
+typedef bt_component_class_get_supported_mip_versions_method_status
+(*bt_component_class_sink_get_supported_mip_versions_method)(
+ bt_self_component_class_sink *comp_class,
+ const bt_value *params, void *init_method_data,
+ bt_logging_level log_level,
+ bt_integer_range_set_unsigned *supported_versions);
+
typedef bt_component_class_init_method_status
(*bt_component_class_sink_init_method)(
bt_self_component_sink *self_component,
return __BT_UPCAST(bt_component_class, comp_cls_sink);
}
+extern bt_component_class_set_method_status
+bt_component_class_sink_set_get_supported_mip_versions_method(
+ bt_component_class_sink *comp_class,
+ bt_component_class_sink_get_supported_mip_versions_method method);
+
extern
bt_component_class_sink *bt_component_class_sink_create(
const char *name,
extern "C" {
#endif
+typedef bt_component_class_get_supported_mip_versions_method_status
+(*bt_component_class_source_get_supported_mip_versions_method)(
+ bt_self_component_class_source *comp_class,
+ const bt_value *params, void *init_method_data,
+ bt_logging_level log_level,
+ bt_integer_range_set_unsigned *supported_versions);
+
typedef bt_component_class_init_method_status
(*bt_component_class_source_init_method)(
bt_self_component_source *self_component,
const char *name,
bt_component_class_source_message_iterator_next_method method);
+extern bt_component_class_set_method_status
+bt_component_class_source_set_get_supported_mip_versions_method(
+ bt_component_class_source *comp_class,
+ bt_component_class_source_get_supported_mip_versions_method method);
+
extern bt_component_class_set_method_status
bt_component_class_source_set_init_method(
bt_component_class_source *comp_class,
extern "C" {
#endif
+typedef enum bt_component_class_get_supported_mip_versions_method_status {
+ BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
+ BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
+ BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
+} bt_component_class_get_supported_mip_versions_method_status;
+
typedef enum bt_component_class_init_method_status {
BT_COMPONENT_CLASS_INIT_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK,
BT_COMPONENT_CLASS_INIT_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR,
enum __bt_plugin_component_class_descriptor_attribute_type {
BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_DESCRIPTION = 0,
BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP = 1,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD = 2,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD = 3,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD = 4,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD = 5,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD = 6,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD = 7,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD = 8,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD = 9,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD = 10,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD = 11,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD = 12,
- BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD = 13,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD = 2,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD = 3,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD = 4,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD = 5,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD = 6,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD = 7,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD = 8,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INIT_METHOD = 9,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD = 10,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD = 11,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD = 12,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD = 13,
+ BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD = 14,
};
/* Component class attribute (internal use) */
/* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_HELP */
const char *help;
+ /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD */
+ bt_component_class_source_get_supported_mip_versions_method source_get_supported_mip_versions_method;
+ bt_component_class_filter_get_supported_mip_versions_method filter_get_supported_mip_versions_method;
+ bt_component_class_sink_get_supported_mip_versions_method sink_get_supported_mip_versions_method;
+
/* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
bt_component_class_source_init_method source_init_method;
bt_component_class_filter_init_method filter_init_method;
#define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
__BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, sink, _x)
+/*
+ * Defines a "get supported MIP versions" attribute attached to a
+ * specific source component class descriptor.
+ *
+ * _id: Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _x: "Get supported MIP versions" method (bt_component_class_source_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_WITH_ID(_id, _comp_class_id, _x) \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _id, _comp_class_id, source, _x)
+
+/*
+ * Defines a "get supported MIP versions" attribute attached to a
+ * specific filter component class descriptor.
+ *
+ * _id: Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _x: "Get supported MIP versions" method (bt_component_class_filter_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_WITH_ID(_id, _comp_class_id, _x) \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _id, _comp_class_id, filter, _x)
+
+/*
+ * Defines a "get supported MIP versions" attribute attached to a
+ * specific sink component class descriptor.
+ *
+ * _id: Plugin descriptor ID (C identifier).
+ * _comp_class_id: Component class descriptor ID (C identifier).
+ * _x: "Get supported MIP versions" method (bt_component_class_sink_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_WITH_ID(_id, _comp_class_id, _x) \
+ __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_get_supported_mip_versions_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS, _id, _comp_class_id, sink, _x)
+
/*
* Defines a finalization method attribute attached to a specific source
* component class descriptor.
#define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
+/*
+ * Defines a "get supported MIP versions" method attribute attached to a
+ * source component class descriptor which is attached to the automatic
+ * plugin descriptor.
+ *
+ * _name: Component class name (C identifier).
+ * _x: Initialization method (bt_component_class_source_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _x) \
+ BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _x)
+
+/*
+ * Defines a "get supported MIP versions" method attribute attached to a
+ * filter component class descriptor which is attached to the automatic
+ * plugin descriptor.
+ *
+ * _name: Component class name (C identifier).
+ * _x: Initialization method (bt_component_class_filter_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _x) \
+ BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _x)
+
+/*
+ * Defines a "get supported MIP versions" method attribute attached to a
+ * sink component class descriptor which is attached to the automatic
+ * plugin descriptor.
+ *
+ * _name: Component class name (C identifier).
+ * _x: Initialization method (bt_component_class_sink_get_supported_mip_versions_method).
+ */
+#define BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(_name, _x) \
+ BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_WITH_ID(auto, _name, _x)
+
/*
* Defines a finalization method attribute attached to a source component
* class descriptor which is attached to the automatic plugin
return (void *) sink_class;
}
+enum bt_component_class_set_method_status
+bt_component_class_source_set_get_supported_mip_versions_method(
+ struct bt_component_class_source *comp_cls,
+ bt_component_class_source_get_supported_mip_versions_method method)
+{
+ BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+ comp_cls->methods.get_supported_mip_versions = method;
+ BT_LIB_LOGD("Set source component class's \"get supported MIP versions\" method: "
+ "%!+C", comp_cls);
+ return BT_FUNC_STATUS_OK;
+}
+
+enum bt_component_class_set_method_status
+bt_component_class_filter_set_get_supported_mip_versions_method(
+ struct bt_component_class_filter *comp_cls,
+ bt_component_class_filter_get_supported_mip_versions_method method)
+{
+ BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+ comp_cls->methods.get_supported_mip_versions = method;
+ BT_LIB_LOGD("Set filter component class's \"get supported MIP versions\" method: "
+ "%!+C", comp_cls);
+ return BT_FUNC_STATUS_OK;
+}
+
+enum bt_component_class_set_method_status
+bt_component_class_sink_set_get_supported_mip_versions_method(
+ struct bt_component_class_sink *comp_cls,
+ bt_component_class_sink_get_supported_mip_versions_method method)
+{
+ BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_NON_NULL(method, "Method");
+ BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
+ comp_cls->methods.get_supported_mip_versions = method;
+ BT_LIB_LOGD("Set sink component class's \"get supported MIP versions\" method: "
+ "%!+C", comp_cls);
+ return BT_FUNC_STATUS_OK;
+}
+
enum bt_component_class_set_method_status
bt_component_class_source_set_init_method(
struct bt_component_class_source *comp_cls,
struct bt_component_class_source {
struct bt_component_class parent;
struct {
+ bt_component_class_source_get_supported_mip_versions_method get_supported_mip_versions;
bt_component_class_source_init_method init;
bt_component_class_source_finalize_method finalize;
bt_component_class_source_message_iterator_init_method msg_iter_init;
struct bt_component_class_sink {
struct bt_component_class parent;
struct {
+ bt_component_class_sink_get_supported_mip_versions_method get_supported_mip_versions;
bt_component_class_sink_init_method init;
bt_component_class_sink_finalize_method finalize;
bt_component_class_sink_query_method query;
struct bt_component_class_filter {
struct bt_component_class parent;
struct {
+ bt_component_class_filter_get_supported_mip_versions_method get_supported_mip_versions;
bt_component_class_filter_init_method init;
bt_component_class_filter_finalize_method finalize;
bt_component_class_filter_message_iterator_init_method msg_iter_init;
union {
struct {
+ bt_component_class_source_get_supported_mip_versions_method get_supported_mip_versions;
bt_component_class_source_init_method init;
bt_component_class_source_finalize_method finalize;
bt_component_class_source_query_method query;
} source;
struct {
+ bt_component_class_filter_get_supported_mip_versions_method get_supported_mip_versions;
bt_component_class_filter_init_method init;
bt_component_class_filter_finalize_method finalize;
bt_component_class_filter_query_method query;
} filter;
struct {
+ bt_component_class_sink_get_supported_mip_versions_method get_supported_mip_versions;
bt_component_class_sink_init_method init;
bt_component_class_sink_finalize_method finalize;
bt_component_class_sink_query_method query;
cc_full_descr->help =
cur_cc_descr_attr->value.help;
break;
+ case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GET_SUPPORTED_MIP_VERSIONS_METHOD:
+ switch (cc_type) {
+ case BT_COMPONENT_CLASS_TYPE_SOURCE:
+ cc_full_descr->methods.source.get_supported_mip_versions =
+ cur_cc_descr_attr->value.source_get_supported_mip_versions_method;
+ break;
+ case BT_COMPONENT_CLASS_TYPE_FILTER:
+ cc_full_descr->methods.filter.get_supported_mip_versions =
+ cur_cc_descr_attr->value.filter_get_supported_mip_versions_method;
+ break;
+ case BT_COMPONENT_CLASS_TYPE_SINK:
+ cc_full_descr->methods.sink.get_supported_mip_versions =
+ cur_cc_descr_attr->value.sink_get_supported_mip_versions_method;
+ break;
+ default:
+ abort();
+ }
+ break;
case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD:
switch (cc_type) {
case BT_COMPONENT_CLASS_TYPE_SOURCE:
switch (cc_full_descr->descriptor->type) {
case BT_COMPONENT_CLASS_TYPE_SOURCE:
+ if (cc_full_descr->methods.source.get_supported_mip_versions) {
+ ret = bt_component_class_source_set_get_supported_mip_versions_method(
+ src_comp_class,
+ cc_full_descr->methods.source.get_supported_mip_versions);
+ if (ret) {
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Cannot set source component class's \"get supported MIP versions\" method.");
+ status = BT_FUNC_STATUS_MEMORY_ERROR;
+ BT_OBJECT_PUT_REF_AND_RESET(src_comp_class);
+ goto end;
+ }
+ }
+
if (cc_full_descr->methods.source.init) {
ret = bt_component_class_source_set_init_method(
src_comp_class,
break;
case BT_COMPONENT_CLASS_TYPE_FILTER:
+ if (cc_full_descr->methods.filter.get_supported_mip_versions) {
+ ret = bt_component_class_filter_set_get_supported_mip_versions_method(
+ flt_comp_class,
+ cc_full_descr->methods.filter.get_supported_mip_versions);
+ if (ret) {
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Cannot set filter component class's \"get supported MIP versions\" method.");
+ status = BT_FUNC_STATUS_MEMORY_ERROR;
+ BT_OBJECT_PUT_REF_AND_RESET(flt_comp_class);
+ goto end;
+ }
+ }
+
if (cc_full_descr->methods.filter.init) {
ret = bt_component_class_filter_set_init_method(
flt_comp_class,
break;
case BT_COMPONENT_CLASS_TYPE_SINK:
+ if (cc_full_descr->methods.sink.get_supported_mip_versions) {
+ ret = bt_component_class_sink_set_get_supported_mip_versions_method(
+ sink_comp_class,
+ cc_full_descr->methods.sink.get_supported_mip_versions);
+ if (ret) {
+ BT_LIB_LOGE_APPEND_CAUSE(
+ "Cannot set sink component class's \"get supported MIP versions\" method.");
+ status = BT_FUNC_STATUS_MEMORY_ERROR;
+ BT_OBJECT_PUT_REF_AND_RESET(sink_comp_class);
+ goto end;
+ }
+ }
+
if (cc_full_descr->methods.sink.init) {
ret = bt_component_class_sink_set_init_method(
sink_comp_class,