Move to kernel style SPDX license identifiers
[babeltrace.git] / src / lib / graph / component-class.c
index 8b5abf9b31a4a1b52b8209eae0104d3383cf0904..6415c39ffbc10eedb9eb116cfb3cb54dc0998476 100644 (file)
@@ -1,24 +1,8 @@
 /*
+ * SPDX-License-Identifier: MIT
+ *
  * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
  * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
  */
 
 #define BT_LOG_TAG "LIB/COMPONENT-CLASS"
 #include "lib/assert-pre.h"
 #include "compat/compiler.h"
 #include <babeltrace2/graph/component-class.h>
-#include <babeltrace2/graph/component-class-const.h>
-#include <babeltrace2/graph/component-class-source.h>
-#include <babeltrace2/graph/component-class-source-const.h>
-#include <babeltrace2/graph/component-class-filter.h>
-#include <babeltrace2/graph/component-class-filter-const.h>
-#include <babeltrace2/graph/component-class-sink.h>
-#include <babeltrace2/graph/component-class-sink-const.h>
 #include <babeltrace2/types.h>
 #include <glib.h>
 
 #include "component-class.h"
 #include "lib/func-status.h"
+#include "lib/graph/message-iterator-class.h"
 
 #define BT_ASSERT_PRE_DEV_COMP_CLS_HOT(_cc) \
        BT_ASSERT_PRE_DEV_HOT(((const struct bt_component_class *) (_cc)), \
@@ -93,6 +71,15 @@ void destroy_component_class(struct bt_object *obj)
                class->destroy_listeners = NULL;
        }
 
+       if (bt_component_class_has_message_iterator_class(class)) {
+               struct bt_component_class_with_iterator_class *class_with_iter_class =
+                       container_of(class, struct bt_component_class_with_iterator_class, parent);
+
+               BT_ASSERT(class_with_iter_class->msg_iter_cls);
+               bt_message_iterator_class_put_ref(class_with_iter_class->msg_iter_cls);
+               class_with_iter_class->msg_iter_cls = NULL;
+       }
+
        g_free(class);
 }
 
@@ -145,18 +132,40 @@ end:
        return ret;
 }
 
+static
+int bt_component_class_with_iterator_class_init(
+               struct bt_component_class_with_iterator_class *class,
+               enum bt_component_class_type type, const char *name,
+               struct bt_message_iterator_class *message_iterator_class)
+{
+       int ret;
+
+       ret = bt_component_class_init(&class->parent, type, name);
+       if (ret != 0) {
+               goto end;
+       }
+
+       class->msg_iter_cls = message_iterator_class;
+       bt_message_iterator_class_get_ref(class->msg_iter_cls);
+       bt_message_iterator_class_freeze(class->msg_iter_cls);
+
+end:
+       return ret;
+}
+
 struct bt_component_class_source *bt_component_class_source_create(
                const char *name,
-               bt_component_class_source_message_iterator_next_method method)
+               struct bt_message_iterator_class *message_iterator_class)
 {
        struct bt_component_class_source *source_class = NULL;
        int ret;
 
+       BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_NON_NULL(name, "Name");
-       BT_ASSERT_PRE_NON_NULL(method, "Message iterator next method");
-       BT_LOGI("Creating source component class: "
-               "name=\"%s\", msg-iter-next-method-addr=%p",
-               name, method);
+       BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
+       BT_LIB_LOGI("Creating source component class: "
+               "name=\"%s\", %![msg-iter-cls-]+I",
+               name, message_iterator_class);
        source_class = g_new0(struct bt_component_class_source, 1);
        if (!source_class) {
                BT_LIB_LOGE_APPEND_CAUSE(
@@ -165,8 +174,8 @@ struct bt_component_class_source *bt_component_class_source_create(
        }
 
        /* bt_component_class_init() logs errors */
-       ret = bt_component_class_init(&source_class->parent,
-               BT_COMPONENT_CLASS_TYPE_SOURCE, name);
+       ret = bt_component_class_with_iterator_class_init(&source_class->parent,
+               BT_COMPONENT_CLASS_TYPE_SOURCE, name, message_iterator_class);
        if (ret) {
                /*
                 * If bt_component_class_init() fails, the component
@@ -177,7 +186,6 @@ struct bt_component_class_source *bt_component_class_source_create(
                goto end;
        }
 
-       source_class->methods.msg_iter_next = method;
        BT_LIB_LOGI("Created source component class: %!+C", source_class);
 
 end:
@@ -186,16 +194,17 @@ end:
 
 struct bt_component_class_filter *bt_component_class_filter_create(
                const char *name,
-               bt_component_class_filter_message_iterator_next_method method)
+               struct bt_message_iterator_class *message_iterator_class)
 {
        struct bt_component_class_filter *filter_class = NULL;
        int ret;
 
+       BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_NON_NULL(name, "Name");
-       BT_ASSERT_PRE_NON_NULL(method, "Message iterator next method");
-       BT_LOGI("Creating filter component class: "
-               "name=\"%s\", msg-iter-next-method-addr=%p",
-               name, method);
+       BT_ASSERT_PRE_NON_NULL(message_iterator_class, "Message iterator class");
+       BT_LIB_LOGI("Creating filter component class: "
+               "name=\"%s\", %![msg-iter-cls-]+I",
+               name, message_iterator_class);
        filter_class = g_new0(struct bt_component_class_filter, 1);
        if (!filter_class) {
                BT_LIB_LOGE_APPEND_CAUSE(
@@ -204,8 +213,8 @@ struct bt_component_class_filter *bt_component_class_filter_create(
        }
 
        /* bt_component_class_init() logs errors */
-       ret = bt_component_class_init(&filter_class->parent,
-               BT_COMPONENT_CLASS_TYPE_FILTER, name);
+       ret = bt_component_class_with_iterator_class_init(&filter_class->parent,
+               BT_COMPONENT_CLASS_TYPE_FILTER, name, message_iterator_class);
        if (ret) {
                /*
                 * If bt_component_class_init() fails, the component
@@ -216,7 +225,6 @@ struct bt_component_class_filter *bt_component_class_filter_create(
                goto end;
        }
 
-       filter_class->methods.msg_iter_next = method;
        BT_LIB_LOGI("Created filter component class: %!+C", filter_class);
 
 end:
@@ -229,6 +237,7 @@ struct bt_component_class_sink *bt_component_class_sink_create(
        struct bt_component_class_sink *sink_class = NULL;
        int ret;
 
+       BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_NON_NULL(name, "Name");
        BT_ASSERT_PRE_NON_NULL(method, "Consume next method");
        BT_LOGI("Creating sink component class: "
@@ -266,6 +275,7 @@ 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_NO_ERROR();
        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);
@@ -280,6 +290,7 @@ 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_NO_ERROR();
        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);
@@ -294,6 +305,7 @@ 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_NO_ERROR();
        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);
@@ -304,10 +316,11 @@ bt_component_class_sink_set_get_supported_mip_versions_method(
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_source_set_init_method(
+bt_component_class_source_set_initialize_method(
                struct bt_component_class_source *comp_cls,
-               bt_component_class_source_init_method method)
+               bt_component_class_source_initialize_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -318,10 +331,11 @@ bt_component_class_source_set_init_method(
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_filter_set_init_method(
+bt_component_class_filter_set_initialize_method(
                struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_init_method method)
+               bt_component_class_filter_initialize_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -332,10 +346,11 @@ bt_component_class_filter_set_init_method(
 }
 
 enum bt_component_class_set_method_status
-bt_component_class_sink_set_init_method(
+bt_component_class_sink_set_initialize_method(
                struct bt_component_class_sink *comp_cls,
-               bt_component_class_sink_init_method method)
+               bt_component_class_sink_initialize_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -350,6 +365,7 @@ bt_component_class_source_set_finalize_method(
                struct bt_component_class_source *comp_cls,
                bt_component_class_source_finalize_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -364,6 +380,7 @@ bt_component_class_filter_set_finalize_method(
                struct bt_component_class_filter *comp_cls,
                bt_component_class_filter_finalize_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -378,6 +395,7 @@ bt_component_class_sink_set_finalize_method(
                struct bt_component_class_sink *comp_cls,
                bt_component_class_sink_finalize_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -392,6 +410,7 @@ bt_component_class_source_set_query_method(
                struct bt_component_class_source *comp_cls,
                bt_component_class_source_query_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -406,6 +425,7 @@ bt_component_class_filter_set_query_method(
                struct bt_component_class_filter *comp_cls,
                bt_component_class_filter_query_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -420,6 +440,7 @@ bt_component_class_sink_set_query_method(
                struct bt_component_class_sink *comp_cls,
                bt_component_class_sink_query_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -434,6 +455,7 @@ bt_component_class_filter_set_input_port_connected_method(
                struct bt_component_class_filter *comp_cls,
                bt_component_class_filter_input_port_connected_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -448,6 +470,7 @@ bt_component_class_sink_set_input_port_connected_method(
                struct bt_component_class_sink *comp_cls,
                bt_component_class_sink_input_port_connected_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -462,6 +485,7 @@ bt_component_class_source_set_output_port_connected_method(
                struct bt_component_class_source *comp_cls,
                bt_component_class_source_output_port_connected_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -476,6 +500,7 @@ bt_component_class_filter_set_output_port_connected_method(
                struct bt_component_class_filter *comp_cls,
                bt_component_class_filter_output_port_connected_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -490,6 +515,7 @@ bt_component_class_sink_set_graph_is_configured_method(
                struct bt_component_class_sink *comp_cls,
                bt_component_class_sink_graph_is_configured_method method)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        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);
@@ -499,179 +525,12 @@ bt_component_class_sink_set_graph_is_configured_method(
        return BT_FUNC_STATUS_OK;
 }
 
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_init_method(
-               struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_init_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.msg_iter_init = method;
-       BT_LIB_LOGD("Set source component class's message iterator initialization method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_init_method(
-               struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_init_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.msg_iter_init = method;
-       BT_LIB_LOGD("Set filter component class's message iterator initialization method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_finalize_method(
-               struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_finalize_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.msg_iter_finalize = method;
-       BT_LIB_LOGD("Set source component class's message iterator finalization method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_finalize_method(
-               struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_finalize_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.msg_iter_finalize = method;
-       BT_LIB_LOGD("Set filter component class's message iterator finalization method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method(
-               struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_seek_ns_from_origin_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.msg_iter_seek_ns_from_origin = method;
-       BT_LIB_LOGD("Set filter component class's message iterator \"seek nanoseconds from origin\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_seek_ns_from_origin_method(
-               struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_seek_ns_from_origin_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.msg_iter_seek_ns_from_origin = method;
-       BT_LIB_LOGD("Set source component class's message iterator \"seek nanoseconds from origin\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_seek_beginning_method(
-               struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_seek_beginning_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.msg_iter_seek_beginning = method;
-       BT_LIB_LOGD("Set filter component class's message iterator \"seek beginning\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_seek_beginning_method(
-               struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_seek_beginning_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.msg_iter_seek_beginning = method;
-       BT_LIB_LOGD("Set source component class's message iterator \"seek beginning\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_can_seek_beginning_method(
-               struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_can_seek_beginning_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.msg_iter_can_seek_beginning = method;
-       BT_LIB_LOGD("Set filter component class's message iterator \"can seek beginning\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_can_seek_beginning_method(
-               struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_can_seek_beginning_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.msg_iter_can_seek_beginning = method;
-       BT_LIB_LOGD("Set source component class's message iterator \"can seek beginning\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method(
-               struct bt_component_class_filter *comp_cls,
-               bt_component_class_filter_message_iterator_can_seek_ns_from_origin_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.msg_iter_can_seek_ns_from_origin = method;
-       BT_LIB_LOGD("Set filter component class's message iterator \"can seek nanoseconds from origin\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
-enum bt_component_class_set_method_status
-bt_component_class_source_set_message_iterator_can_seek_ns_from_origin_method(
-               struct bt_component_class_source *comp_cls,
-               bt_component_class_source_message_iterator_can_seek_ns_from_origin_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.msg_iter_can_seek_ns_from_origin = method;
-       BT_LIB_LOGD("Set source component class's message iterator \"can seek nanoseconds from origin\" method"
-               ": %!+C", comp_cls);
-       return BT_FUNC_STATUS_OK;
-}
-
 enum bt_component_class_set_description_status
 bt_component_class_set_description(
                struct bt_component_class *comp_cls,
                const char *description)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(description, "Description");
        BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
@@ -688,6 +547,7 @@ enum bt_component_class_set_help_status bt_component_class_set_help(
                struct bt_component_class *comp_cls,
                const char *help)
 {
+       BT_ASSERT_PRE_NO_ERROR();
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(help, "Help");
        BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
This page took 0.029608 seconds and 4 git commands to generate.