lib: make graph API const-correct
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 4 Dec 2018 22:07:29 +0000 (17:07 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
134 files changed:
cli/babeltrace.c
include/Makefile.am
include/babeltrace/babeltrace.h
include/babeltrace/ctf-writer/fields-internal.h
include/babeltrace/ctf-writer/stream-internal.h
include/babeltrace/graph/component-class-const.h [new file with mode: 0644]
include/babeltrace/graph/component-class-filter-const.h [new file with mode: 0644]
include/babeltrace/graph/component-class-filter.h
include/babeltrace/graph/component-class-internal.h
include/babeltrace/graph/component-class-sink-colander-internal.h
include/babeltrace/graph/component-class-sink-const.h [new file with mode: 0644]
include/babeltrace/graph/component-class-sink.h
include/babeltrace/graph/component-class-source-const.h [new file with mode: 0644]
include/babeltrace/graph/component-class-source.h
include/babeltrace/graph/component-class.h
include/babeltrace/graph/component-const.h [new file with mode: 0644]
include/babeltrace/graph/component-filter-const.h [new file with mode: 0644]
include/babeltrace/graph/component-filter-internal.h
include/babeltrace/graph/component-filter.h [deleted file]
include/babeltrace/graph/component-internal.h
include/babeltrace/graph/component-sink-const.h [new file with mode: 0644]
include/babeltrace/graph/component-sink-internal.h
include/babeltrace/graph/component-sink.h [deleted file]
include/babeltrace/graph/component-source-const.h [new file with mode: 0644]
include/babeltrace/graph/component-source-internal.h
include/babeltrace/graph/component-source.h [deleted file]
include/babeltrace/graph/component.h [deleted file]
include/babeltrace/graph/connection-const.h [new file with mode: 0644]
include/babeltrace/graph/connection-internal.h
include/babeltrace/graph/connection.h [deleted file]
include/babeltrace/graph/const-notification.h [new file with mode: 0644]
include/babeltrace/graph/graph-const.h [new file with mode: 0644]
include/babeltrace/graph/graph-internal.h
include/babeltrace/graph/graph.h
include/babeltrace/graph/notification-const.h [new file with mode: 0644]
include/babeltrace/graph/notification-event-const.h [new file with mode: 0644]
include/babeltrace/graph/notification-event.h
include/babeltrace/graph/notification-inactivity-const.h [new file with mode: 0644]
include/babeltrace/graph/notification-inactivity-internal.h
include/babeltrace/graph/notification-inactivity.h
include/babeltrace/graph/notification-internal.h
include/babeltrace/graph/notification-iterator-internal.h
include/babeltrace/graph/notification-packet-const.h [new file with mode: 0644]
include/babeltrace/graph/notification-packet.h
include/babeltrace/graph/notification-stream-const.h [new file with mode: 0644]
include/babeltrace/graph/notification-stream.h
include/babeltrace/graph/notification.h [deleted file]
include/babeltrace/graph/port-const.h [new file with mode: 0644]
include/babeltrace/graph/port-input-const.h [new file with mode: 0644]
include/babeltrace/graph/port-input.h [deleted file]
include/babeltrace/graph/port-internal.h
include/babeltrace/graph/port-output-const.h [new file with mode: 0644]
include/babeltrace/graph/port-output-notification-iterator.h
include/babeltrace/graph/port-output.h [deleted file]
include/babeltrace/graph/port.h [deleted file]
include/babeltrace/graph/private-component-class-filter.h [deleted file]
include/babeltrace/graph/private-component-class-sink.h [deleted file]
include/babeltrace/graph/private-component-class-source.h [deleted file]
include/babeltrace/graph/private-component-class.h [deleted file]
include/babeltrace/graph/private-graph.h [deleted file]
include/babeltrace/graph/private-notification-event.h [deleted file]
include/babeltrace/graph/private-notification-inactivity.h [deleted file]
include/babeltrace/graph/private-notification-packet.h [deleted file]
include/babeltrace/graph/private-notification-stream.h [deleted file]
include/babeltrace/graph/private-notification.h [deleted file]
include/babeltrace/graph/private-query-executor.h [deleted file]
include/babeltrace/graph/query-executor-const.h [new file with mode: 0644]
include/babeltrace/graph/query-executor-internal.h
include/babeltrace/graph/query-executor.h
include/babeltrace/graph/self-component-class-filter.h
include/babeltrace/graph/self-component-class-sink.h
include/babeltrace/graph/self-component-class-source.h
include/babeltrace/graph/self-component-filter.h
include/babeltrace/graph/self-component-port-input-notification-iterator.h
include/babeltrace/graph/self-component-port-input.h
include/babeltrace/graph/self-component-port-output.h
include/babeltrace/graph/self-component-port.h
include/babeltrace/graph/self-component-sink.h
include/babeltrace/graph/self-component-source.h
include/babeltrace/graph/self-component.h
include/babeltrace/graph/self-notification-iterator.h
include/babeltrace/plugin/plugin-const.h
include/babeltrace/plugin/plugin-dev.h
lib/babeltrace.c
lib/graph/component-class-sink-colander.c
lib/graph/component-class.c
lib/graph/component-filter.c
lib/graph/component-sink.c
lib/graph/component-source.c
lib/graph/component.c
lib/graph/connection.c
lib/graph/graph.c
lib/graph/iterator.c
lib/graph/notification/event.c
lib/graph/notification/inactivity.c
lib/graph/notification/notification.c
lib/graph/notification/packet.c
lib/graph/notification/stream.c
lib/graph/port.c
lib/graph/query-executor.c
lib/plugin/plugin-so.c
lib/plugin/plugin.c
lib/trace-ir/event-header-field.c
lib/trace-ir/packet-context-field.c
lib/trace-ir/packet-header-field.c
plugins/ctf/common/notif-iter/notif-iter.c
plugins/ctf/common/notif-iter/notif-iter.h
plugins/ctf/fs-sink/writer.c
plugins/ctf/fs-sink/writer.h
plugins/ctf/fs-src/data-stream-file.c
plugins/ctf/fs-src/data-stream-file.h
plugins/ctf/fs-src/fs.c
plugins/ctf/fs-src/fs.h
plugins/ctf/lttng-live/lttng-live-internal.h
plugins/ctf/lttng-live/lttng-live.c
plugins/lttng-utils/debug-info.h
plugins/lttng-utils/plugin.c
plugins/text/dmesg/dmesg.c
plugins/text/dmesg/dmesg.h
plugins/text/pretty/pretty.c
plugins/text/pretty/pretty.h
plugins/text/pretty/print.c
plugins/utils/counter/counter.c
plugins/utils/counter/counter.h
plugins/utils/dummy/dummy.c
plugins/utils/dummy/dummy.h
plugins/utils/muxer/muxer.c
plugins/utils/muxer/muxer.h
plugins/utils/trimmer/iterator.c
plugins/utils/trimmer/iterator.h
tests/lib/test-plugin-plugins/sfs.c
tests/lib/test_bt_notification_iterator.c
tests/lib/test_graph_topo.c
tests/lib/test_plugin.c

index a8b5b372ce481f2d3ccd00ed7186539134daf0cf..537ab44da224818b850d69cf9778dd50595ea2a5 100644 (file)
@@ -69,8 +69,8 @@ static const char* log_level_env_var_names[] = {
 };
 
 /* Application's processing graph (weak) */
-static struct bt_private_graph *the_graph;
-static struct bt_private_query_executor *the_query_executor;
+static struct bt_graph *the_graph;
+static struct bt_query_executor *the_query_executor;
 static bool canceled = false;
 
 GPtrArray *loaded_plugins;
@@ -82,7 +82,7 @@ GPtrArray *loaded_plugins;
 static
 BOOL WINAPI signal_handler(DWORD signal) {
        if (the_graph) {
-               bt_private_graph_cancel(the_graph);
+               bt_graph_cancel(the_graph);
        }
 
        canceled = true;
@@ -108,11 +108,11 @@ void signal_handler(int signum)
        }
 
        if (the_graph) {
-               bt_private_graph_cancel(the_graph);
+               bt_graph_cancel(the_graph);
        }
 
        if (the_query_executor) {
-               bt_private_query_executor_cancel(the_query_executor);
+               bt_query_executor_cancel(the_query_executor);
        }
 
        canceled = true;
@@ -153,7 +153,7 @@ int create_the_query_executor(void)
 {
        int ret = 0;
 
-       the_query_executor = bt_private_query_executor_create();
+       the_query_executor = bt_query_executor_create();
        if (!the_query_executor) {
                BT_LOGE_STR("Cannot create a query executor.");
                ret = -1;
@@ -169,7 +169,7 @@ void destroy_the_query_executor(void)
 }
 
 static
-int query(struct bt_component_class *comp_cls, const char *obj,
+int query(const struct bt_component_class *comp_cls, const char *obj,
                const struct bt_value *params, const struct bt_value **user_result,
                const char **fail_reason)
 {
@@ -196,7 +196,7 @@ int query(struct bt_component_class *comp_cls, const char *obj,
        }
 
        while (true) {
-               status = bt_private_query_executor_query(the_query_executor,
+               status = bt_query_executor_query(the_query_executor,
                        comp_cls, obj, params, &result);
                switch (status) {
                case BT_QUERY_EXECUTOR_STATUS_OK:
@@ -210,8 +210,7 @@ int query(struct bt_component_class *comp_cls, const char *obj,
                                "time-us=%" PRIu64, sleep_time_us);
 
                        if (usleep(sleep_time_us)) {
-                               if (bt_query_executor_is_canceled(
-                                               bt_private_query_executor_as_query_executor(the_query_executor))) {
+                               if (bt_query_executor_is_canceled(the_query_executor)) {
                                        BT_LOGI("Query was canceled by user: "
                                                "comp-cls-addr=%p, comp-cls-name=\"%s\", "
                                                "query-obj=\"%s\"", comp_cls,
@@ -292,15 +291,15 @@ const struct bt_plugin *find_plugin(const char *name)
        return plugin;
 }
 
-typedef void *(*plugin_borrow_comp_cls_func_t)(const struct bt_plugin *,
-       const char *);
+typedef const void *(*plugin_borrow_comp_cls_func_t)(
+               const struct bt_plugin *, const char *);
 
 static
-void *find_component_class_from_plugin(const char *plugin_name,
+const void *find_component_class_from_plugin(const char *plugin_name,
                const char *comp_class_name,
                plugin_borrow_comp_cls_func_t plugin_borrow_comp_cls_func)
 {
-       void *comp_class = NULL;
+       const void *comp_class = NULL;
        const struct bt_plugin *plugin;
 
        BT_LOGD("Finding component class: plugin-name=\"%s\", "
@@ -329,57 +328,51 @@ end:
 }
 
 static
-struct bt_component_class_source *find_source_component_class(
+const struct bt_component_class_source *find_source_component_class(
                const char *plugin_name, const char *comp_class_name)
 {
-       return (void *) find_component_class_from_plugin(plugin_name,
-               comp_class_name,
+       return (const void *) find_component_class_from_plugin(
+               plugin_name, comp_class_name,
                (plugin_borrow_comp_cls_func_t)
                        bt_plugin_borrow_source_component_class_by_name_const);
 }
 
 static
-struct bt_component_class_filter *find_filter_component_class(
+const struct bt_component_class_filter *find_filter_component_class(
                const char *plugin_name, const char *comp_class_name)
 {
-       return (void *) find_component_class_from_plugin(plugin_name,
-               comp_class_name,
+       return (const void *) find_component_class_from_plugin(
+               plugin_name, comp_class_name,
                (plugin_borrow_comp_cls_func_t)
                        bt_plugin_borrow_filter_component_class_by_name_const);
 }
 
 static
-struct bt_component_class_sink *find_sink_component_class(
+const struct bt_component_class_sink *find_sink_component_class(
                const char *plugin_name, const char *comp_class_name)
 {
-       return (void *) find_component_class_from_plugin(plugin_name,
+       return (const void *) find_component_class_from_plugin(plugin_name,
                comp_class_name,
                (plugin_borrow_comp_cls_func_t)
                        bt_plugin_borrow_sink_component_class_by_name_const);
 }
 
 static
-struct bt_component_class *find_component_class(const char *plugin_name,
+const struct bt_component_class *find_component_class(const char *plugin_name,
                const char *comp_class_name,
                enum bt_component_class_type comp_class_type)
 {
-       struct bt_component_class *comp_cls = NULL;
+       const struct bt_component_class *comp_cls = NULL;
 
        switch (comp_class_type) {
        case BT_COMPONENT_CLASS_TYPE_SOURCE:
-               comp_cls = bt_component_class_source_as_component_class(
-                       find_source_component_class(plugin_name,
-                               comp_class_name));
+               comp_cls = bt_component_class_source_as_component_class_const(find_source_component_class(plugin_name, comp_class_name));
                break;
        case BT_COMPONENT_CLASS_TYPE_FILTER:
-               comp_cls = bt_component_class_filter_as_component_class(
-                       find_filter_component_class(plugin_name,
-                               comp_class_name));
+               comp_cls = bt_component_class_filter_as_component_class_const(find_filter_component_class(plugin_name, comp_class_name));
                break;
        case BT_COMPONENT_CLASS_TYPE_SINK:
-               comp_cls = bt_component_class_sink_as_component_class(
-                       find_sink_component_class(plugin_name,
-                               comp_class_name));
+               comp_cls = bt_component_class_sink_as_component_class_const(find_sink_component_class(plugin_name, comp_class_name));
                break;
        default:
                abort();
@@ -940,7 +933,7 @@ static
 int cmd_query(struct bt_config *cfg)
 {
        int ret = 0;
-       struct bt_component_class *comp_cls = NULL;
+       const struct bt_component_class *comp_cls = NULL;
        const struct bt_value *results = NULL;
        const char *fail_reason = NULL;
 
@@ -1009,7 +1002,7 @@ end:
 
 static
 void print_component_class_help(const char *plugin_name,
-               struct bt_component_class *comp_cls)
+               const struct bt_component_class *comp_cls)
 {
        const char *comp_class_name =
                bt_component_class_get_name(comp_cls);
@@ -1036,7 +1029,7 @@ int cmd_help(struct bt_config *cfg)
 {
        int ret = 0;
        const struct bt_plugin *plugin = NULL;
-       struct bt_component_class *needed_comp_cls = NULL;
+       const struct bt_component_class *needed_comp_cls = NULL;
 
        plugin = find_plugin(cfg->cmd_data.help.cfg_component->plugin_name->str);
        if (!plugin) {
@@ -1106,7 +1099,7 @@ end:
 
 typedef void *(* plugin_borrow_comp_cls_by_index_func_t)(const struct bt_plugin *,
        uint64_t);
-typedef struct bt_component_class *(* spec_comp_cls_borrow_comp_cls_func_t)(
+typedef const struct bt_component_class *(* spec_comp_cls_borrow_comp_cls_func_t)(
        void *);
 
 void cmd_list_plugins_print_component_classes(const struct bt_plugin *plugin,
@@ -1128,7 +1121,7 @@ void cmd_list_plugins_print_component_classes(const struct bt_plugin *plugin,
        }
 
        for (i = 0; i < count; i++) {
-               struct bt_component_class *comp_class =
+               const struct bt_component_class *comp_class =
                        spec_comp_cls_borrow_comp_cls_func(
                                borrow_comp_cls_by_index_func(plugin, i));
                const char *comp_class_name =
@@ -1219,7 +1212,7 @@ static
 int cmd_print_lttng_live_sessions(struct bt_config *cfg)
 {
        int ret = 0;
-       struct bt_component_class *comp_cls = NULL;
+       const struct bt_component_class *comp_cls = NULL;
        const struct bt_value *results = NULL;
        struct bt_value *params = NULL;
        const struct bt_value *map = NULL;
@@ -1371,7 +1364,7 @@ static
 int cmd_print_ctf_metadata(struct bt_config *cfg)
 {
        int ret = 0;
-       struct bt_component_class *comp_cls = NULL;
+       const struct bt_component_class *comp_cls = NULL;
        const struct bt_value *results = NULL;
        struct bt_value *params = NULL;
        const struct bt_value *metadata_text_value = NULL;
@@ -1537,7 +1530,7 @@ struct cmd_run_ctx {
        GHashTable *sink_components;
 
        /* Owned by this */
-       struct bt_private_graph *graph;
+       struct bt_graph *graph;
 
        /* Weak */
        struct bt_config *cfg;
@@ -1600,15 +1593,15 @@ char *s_from_ns(int64_t ns)
 static
 int cmd_run_ctx_connect_upstream_port_to_downstream_component(
                struct cmd_run_ctx *ctx,
-               struct bt_component *upstream_comp,
-               struct bt_port_output *out_upstream_port,
+               const struct bt_component *upstream_comp,
+               const struct bt_port_output *out_upstream_port,
                struct bt_config_connection *cfg_conn)
 {
        typedef uint64_t (*input_port_count_func_t)(void *);
-       typedef struct bt_port_input *(*borrow_input_port_by_index_func_t)(
-               void *, uint64_t);
-       struct bt_port *upstream_port =
-               bt_port_output_as_port(out_upstream_port);
+       typedef const struct bt_port_input *(*borrow_input_port_by_index_func_t)(
+               const void *, uint64_t);
+       const struct bt_port *upstream_port =
+               bt_port_output_as_port_const(out_upstream_port);
 
        int ret = 0;
        GQuark downstreamp_comp_name_quark;
@@ -1622,10 +1615,10 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
        struct bt_value *trimmer_params = NULL;
        char *intersection_begin = NULL;
        char *intersection_end = NULL;
-       struct bt_component_filter *trimmer = NULL;
-       struct bt_component_class_filter *trimmer_class = NULL;
-       struct bt_port_input *trimmer_input = NULL;
-       struct bt_port_output *trimmer_output = NULL;
+       const struct bt_component_filter *trimmer = NULL;
+       const struct bt_component_class_filter *trimmer_class = NULL;
+       const struct bt_port_input *trimmer_input = NULL;
+       const struct bt_port_output *trimmer_output = NULL;
 
        if (ctx->intersections &&
                bt_component_get_class_type(upstream_comp) ==
@@ -1693,7 +1686,7 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
        port_count_fn = (input_port_count_func_t)
                bt_component_filter_get_input_port_count;
        port_by_index_fn = (borrow_input_port_by_index_func_t)
-               bt_component_filter_borrow_input_port_by_index;
+               bt_component_filter_borrow_input_port_by_index_const;
 
        if (!downstream_comp) {
                downstream_comp = g_hash_table_lookup(ctx->sink_components,
@@ -1701,7 +1694,7 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
                port_count_fn = (input_port_count_func_t)
                        bt_component_sink_get_input_port_count;
                port_by_index_fn = (borrow_input_port_by_index_func_t)
-                       bt_component_sink_borrow_input_port_by_index;
+                       bt_component_sink_borrow_input_port_by_index_const;
        }
 
        if (!downstream_comp) {
@@ -1717,10 +1710,10 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
        BT_ASSERT(downstream_port_count >= 0);
 
        for (i = 0; i < downstream_port_count; i++) {
-               struct bt_port_input *in_downstream_port =
+               const struct bt_port_input *in_downstream_port =
                        port_by_index_fn(downstream_comp, i);
-               struct bt_port *downstream_port =
-                       bt_port_input_as_port(in_downstream_port);
+               const struct bt_port *downstream_port =
+                       bt_port_input_as_port_const(in_downstream_port);
                const char *upstream_port_name;
                const char *downstream_port_name;
 
@@ -1774,10 +1767,9 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
                        ret = 0;
 
                        ctx->connect_ports = false;
-                       graph_status = bt_private_graph_add_filter_component(
+                       graph_status = bt_graph_add_filter_component(
                                ctx->graph, trimmer_class, trimmer_name,
-                               trimmer_params,
-                               &trimmer);
+                               trimmer_params, &trimmer);
                        free(trimmer_name);
                        if (graph_status != BT_GRAPH_STATUS_OK) {
                                goto error;
@@ -1785,13 +1777,13 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
                        BT_ASSERT(trimmer);
 
                        trimmer_input =
-                               bt_component_filter_borrow_input_port_by_index(
+                               bt_component_filter_borrow_input_port_by_index_const(
                                        trimmer, 0);
                        if (!trimmer_input) {
                                goto error;
                        }
                        trimmer_output =
-                               bt_component_filter_borrow_output_port_by_index(
+                               bt_component_filter_borrow_output_port_by_index_const(
                                        trimmer, 0);
                        if (!trimmer_output) {
                                goto error;
@@ -1803,14 +1795,14 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
                         */
                        in_downstream_port = trimmer_input;
                        downstream_port =
-                               bt_port_input_as_port(in_downstream_port);
+                               bt_port_input_as_port_const(in_downstream_port);
                        downstream_port_name = bt_port_get_name(
                                downstream_port);
                        BT_ASSERT(downstream_port_name);
                }
 
                /* We have a winner! */
-               status = bt_private_graph_connect_ports(ctx->graph,
+               status = bt_graph_connect_ports(ctx->graph,
                        out_upstream_port, in_downstream_port, NULL);
                downstream_port = NULL;
                switch (status) {
@@ -1878,7 +1870,7 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
                         */
                        ret = cmd_run_ctx_connect_upstream_port_to_downstream_component(
                                ctx,
-                               bt_component_filter_as_component(trimmer),
+                               bt_component_filter_as_component_const(trimmer),
                                trimmer_output, cfg_conn);
                        if (ret) {
                                goto error;
@@ -1918,21 +1910,21 @@ end:
 
 static
 int cmd_run_ctx_connect_upstream_port(struct cmd_run_ctx *ctx,
-               struct bt_port_output *upstream_port)
+               const struct bt_port_output *upstream_port)
 {
        int ret = 0;
        const char *upstream_port_name;
        const char *upstream_comp_name;
-       struct bt_component *upstream_comp = NULL;
+       const struct bt_component *upstream_comp = NULL;
        size_t i;
 
        BT_ASSERT(ctx);
        BT_ASSERT(upstream_port);
        upstream_port_name = bt_port_get_name(
-               bt_port_output_as_port(upstream_port));
+               bt_port_output_as_port_const(upstream_port));
        BT_ASSERT(upstream_port_name);
-       upstream_comp = bt_port_borrow_component(
-               bt_port_output_as_port(upstream_port));
+       upstream_comp = bt_port_borrow_component_const(
+               bt_port_output_as_port_const(upstream_port));
        if (!upstream_comp) {
                BT_LOGW("Upstream port to connect is not part of a component: "
                        "port-addr=%p, port-name=\"%s\"",
@@ -1997,12 +1989,12 @@ end:
 
 static
 void graph_output_port_added_listener(struct cmd_run_ctx *ctx,
-               struct bt_port_output *out_port)
+               const struct bt_port_output *out_port)
 {
-       struct bt_component *comp;
-       struct bt_port *port = bt_port_output_as_port(out_port);
+       const struct bt_component *comp;
+       const struct bt_port *port = bt_port_output_as_port_const(out_port);
 
-       comp = bt_port_borrow_component(port);
+       comp = bt_port_borrow_component_const(port);
        BT_LOGI("Port added to a graph's component: comp-addr=%p, "
                "comp-name=\"%s\", port-addr=%p, port-name=\"%s\"",
                comp, comp ? bt_component_get_name(comp) : "",
@@ -2034,16 +2026,16 @@ end:
 
 static
 void graph_source_output_port_added_listener(
-               struct bt_component_source *component,
-               struct bt_port_output *port, void *data)
+               const struct bt_component_source *component,
+               const struct bt_port_output *port, void *data)
 {
        graph_output_port_added_listener(data, port);
 }
 
 static
 void graph_filter_output_port_added_listener(
-               struct bt_component_filter *component,
-               struct bt_port_output *port, void *data)
+               const struct bt_component_filter *component,
+               const struct bt_port_output *port, void *data)
 {
        graph_output_port_added_listener(data, port);
 }
@@ -2115,13 +2107,13 @@ int cmd_run_ctx_init(struct cmd_run_ctx *ctx, struct bt_config *cfg)
                }
        }
 
-       ctx->graph = bt_private_graph_create();
+       ctx->graph = bt_graph_create();
        if (!ctx->graph) {
                goto error;
        }
 
        the_graph = ctx->graph;
-       status = bt_private_graph_add_source_component_output_port_added_listener(
+       status = bt_graph_add_source_component_output_port_added_listener(
                ctx->graph, graph_source_output_port_added_listener, NULL, ctx,
                NULL);
        if (status != BT_GRAPH_STATUS_OK) {
@@ -2129,7 +2121,7 @@ int cmd_run_ctx_init(struct cmd_run_ctx *ctx, struct bt_config *cfg)
                goto error;
        }
 
-       status = bt_private_graph_add_filter_component_output_port_added_listener(
+       status = bt_graph_add_filter_component_output_port_added_listener(
                ctx->graph, graph_filter_output_port_added_listener, NULL, ctx,
                NULL);
        if (status != BT_GRAPH_STATUS_OK) {
@@ -2150,7 +2142,7 @@ end:
 static
 int set_stream_intersections(struct cmd_run_ctx *ctx,
                struct bt_config_component *cfg_comp,
-               struct bt_component_class_source *src_comp_cls)
+               const struct bt_component_class_source *src_comp_cls)
 {
        int ret = 0;
        uint64_t trace_idx;
@@ -2171,8 +2163,8 @@ int set_stream_intersections(struct cmd_run_ctx *ctx,
        struct port_id *port_id = NULL;
        struct trace_range *trace_range = NULL;
        const char *fail_reason = NULL;
-       struct bt_component_class *comp_cls =
-               bt_component_class_source_as_component_class(src_comp_cls);
+       const struct bt_component_class *comp_cls =
+               bt_component_class_source_as_component_class_const(src_comp_cls);
 
        component_path_value = bt_value_map_borrow_entry_value(cfg_comp->params,
                                                               "path");
@@ -2390,8 +2382,8 @@ int cmd_run_ctx_create_components_from_config_components(
                struct cmd_run_ctx *ctx, GPtrArray *cfg_components)
 {
        size_t i;
-       void *comp_cls = NULL;
-       void *comp = NULL;
+       const void *comp_cls = NULL;
+       const void *comp = NULL;
        int ret = 0;
 
        for (i = 0; i < cfg_components->len; i++) {
@@ -2439,19 +2431,19 @@ int cmd_run_ctx_create_components_from_config_components(
 
                switch (cfg_comp->type) {
                case BT_COMPONENT_CLASS_TYPE_SOURCE:
-                       ret = bt_private_graph_add_source_component(ctx->graph,
+                       ret = bt_graph_add_source_component(ctx->graph,
                                comp_cls, cfg_comp->instance_name->str,
                                cfg_comp->params,
                                (void *) &comp);
                        break;
                case BT_COMPONENT_CLASS_TYPE_FILTER:
-                       ret = bt_private_graph_add_filter_component(ctx->graph,
+                       ret = bt_graph_add_filter_component(ctx->graph,
                                comp_cls, cfg_comp->instance_name->str,
                                cfg_comp->params,
                                (void *) &comp);
                        break;
                case BT_COMPONENT_CLASS_TYPE_SINK:
-                       ret = bt_private_graph_add_sink_component(ctx->graph,
+                       ret = bt_graph_add_sink_component(ctx->graph,
                                comp_cls, cfg_comp->instance_name->str,
                                cfg_comp->params,
                                (void *) &comp);
@@ -2491,15 +2483,15 @@ int cmd_run_ctx_create_components_from_config_components(
                switch (cfg_comp->type) {
                case BT_COMPONENT_CLASS_TYPE_SOURCE:
                        g_hash_table_insert(ctx->src_components,
-                               GUINT_TO_POINTER(quark), comp);
+                               GUINT_TO_POINTER(quark), (void *) comp);
                        break;
                case BT_COMPONENT_CLASS_TYPE_FILTER:
                        g_hash_table_insert(ctx->flt_components,
-                               GUINT_TO_POINTER(quark), comp);
+                               GUINT_TO_POINTER(quark), (void *) comp);
                        break;
                case BT_COMPONENT_CLASS_TYPE_SINK:
                        g_hash_table_insert(ctx->sink_components,
-                               GUINT_TO_POINTER(quark), comp);
+                               GUINT_TO_POINTER(quark), (void *) comp);
                        break;
                default:
                        abort();
@@ -2558,9 +2550,9 @@ end:
        return ret;
 }
 
-typedef uint64_t (*output_port_count_func_t)(void *);
-typedef struct bt_port_output *(*borrow_output_port_by_index_func_t)(
-       void *, uint64_t);
+typedef uint64_t (*output_port_count_func_t)(const void *);
+typedef const struct bt_port_output *(*borrow_output_port_by_index_func_t)(
+       const void *, uint64_t);
 
 static
 int cmd_run_ctx_connect_comp_ports(struct cmd_run_ctx *ctx,
@@ -2575,7 +2567,7 @@ int cmd_run_ctx_connect_comp_ports(struct cmd_run_ctx *ctx,
        BT_ASSERT(count >= 0);
 
        for (i = 0; i < count; i++) {
-               struct bt_port_output *upstream_port = port_by_index_fn(comp, i);
+               const struct bt_port_output *upstream_port = port_by_index_fn(comp, i);
 
                BT_ASSERT(upstream_port);
                ret = cmd_run_ctx_connect_upstream_port(ctx, upstream_port);
@@ -2603,7 +2595,7 @@ int cmd_run_ctx_connect_ports(struct cmd_run_ctx *ctx)
                        (output_port_count_func_t)
                                bt_component_source_get_output_port_count,
                        (borrow_output_port_by_index_func_t)
-                               bt_component_source_borrow_output_port_by_index);
+                               bt_component_source_borrow_output_port_by_index_const);
                if (ret) {
                        goto end;
                }
@@ -2616,7 +2608,7 @@ int cmd_run_ctx_connect_ports(struct cmd_run_ctx *ctx)
                        (output_port_count_func_t)
                                bt_component_filter_get_output_port_count,
                        (borrow_output_port_by_index_func_t)
-                               bt_component_filter_borrow_output_port_by_index);
+                               bt_component_filter_borrow_output_port_by_index_const);
                if (ret) {
                        goto end;
                }
@@ -2701,7 +2693,7 @@ int cmd_run(struct bt_config *cfg)
 
        /* Run the graph */
        while (true) {
-               enum bt_graph_status graph_status = bt_private_graph_run(ctx.graph);
+               enum bt_graph_status graph_status = bt_graph_run(ctx.graph);
 
                /*
                 * Reset console in case something messed with console
@@ -2710,7 +2702,7 @@ int cmd_run(struct bt_config *cfg)
                printf("%s", bt_common_color_reset());
                fflush(stdout);
                fprintf(stderr, "%s", bt_common_color_reset());
-               BT_LOGV("bt_private_graph_run() returned: status=%s",
+               BT_LOGV("bt_graph_run() returned: status=%s",
                        bt_graph_status_str(graph_status));
 
                switch (graph_status) {
@@ -2720,8 +2712,7 @@ int cmd_run(struct bt_config *cfg)
                        BT_LOGI_STR("Graph was canceled by user.");
                        goto error;
                case BT_GRAPH_STATUS_AGAIN:
-                       if (bt_graph_is_canceled(
-                                       bt_private_graph_as_graph(ctx.graph))) {
+                       if (bt_graph_is_canceled(ctx.graph)) {
                                BT_LOGI_STR("Graph was canceled by user.");
                                goto error;
                        }
@@ -2732,8 +2723,7 @@ int cmd_run(struct bt_config *cfg)
                                        cfg->cmd_data.run.retry_duration_us);
 
                                if (usleep(cfg->cmd_data.run.retry_duration_us)) {
-                                       if (bt_graph_is_canceled(
-                                                       bt_private_graph_as_graph(ctx.graph))) {
+                                       if (bt_graph_is_canceled(ctx.graph)) {
                                                BT_LOGI_STR("Graph was canceled by user.");
                                                goto error;
                                        }
index 7a716590a0187428ea06b3d7fcb9b0b714099bf4..d3eb841df73fe332ee986d2d95ad22501011bc9a 100644 (file)
@@ -152,37 +152,35 @@ babeltraceplugininclude_HEADERS = \
 # Graph, component, and notification API
 babeltracegraphincludedir = "$(includedir)/babeltrace/graph"
 babeltracegraphinclude_HEADERS = \
+       babeltrace/graph/component-class-const.h \
+       babeltrace/graph/component-class-filter-const.h \
        babeltrace/graph/component-class-filter.h \
-       babeltrace/graph/component-class.h \
+       babeltrace/graph/component-class-sink-const.h \
        babeltrace/graph/component-class-sink.h \
+       babeltrace/graph/component-class-source-const.h \
        babeltrace/graph/component-class-source.h \
-       babeltrace/graph/component-filter.h \
-       babeltrace/graph/component.h \
-       babeltrace/graph/component-sink.h \
-       babeltrace/graph/component-source.h \
-       babeltrace/graph/connection.h \
+       babeltrace/graph/component-class.h \
+       babeltrace/graph/component-const.h \
+       babeltrace/graph/component-filter-const.h \
+       babeltrace/graph/component-sink-const.h \
+       babeltrace/graph/component-source-const.h \
+       babeltrace/graph/connection-const.h \
+       babeltrace/graph/graph-const.h \
        babeltrace/graph/graph.h \
+       babeltrace/graph/notification-const.h \
+       babeltrace/graph/notification-event-const.h \
        babeltrace/graph/notification-event.h \
+       babeltrace/graph/notification-inactivity-const.h \
        babeltrace/graph/notification-inactivity.h \
-       babeltrace/graph/notification-iterator.h \
+       babeltrace/graph/notification-packet-const.h \
        babeltrace/graph/notification-packet.h \
+       babeltrace/graph/notification-stream-const.h \
        babeltrace/graph/notification-stream.h \
-       babeltrace/graph/notification.h \
-       babeltrace/graph/port-input.h \
+       babeltrace/graph/port-const.h \
+       babeltrace/graph/port-input-const.h \
+       babeltrace/graph/port-output-const.h \
        babeltrace/graph/port-output-notification-iterator.h \
-       babeltrace/graph/port-output.h \
-       babeltrace/graph/port.h \
-       babeltrace/graph/private-component-class-filter.h \
-       babeltrace/graph/private-component-class-sink.h \
-       babeltrace/graph/private-component-class-source.h \
-       babeltrace/graph/private-component-class.h \
-       babeltrace/graph/private-graph.h \
-       babeltrace/graph/private-notification-event.h \
-       babeltrace/graph/private-notification-inactivity.h \
-       babeltrace/graph/private-notification-packet.h \
-       babeltrace/graph/private-notification-stream.h \
-       babeltrace/graph/private-notification.h \
-       babeltrace/graph/private-query-executor.h \
+       babeltrace/graph/query-executor-const.h \
        babeltrace/graph/query-executor.h \
        babeltrace/graph/self-component-class-filter.h \
        babeltrace/graph/self-component-class-sink.h \
index 1a2f58313285817abe1734f6e8090c6d4e2f69ac..dc77567f5955e4d07ac490bd0894510323c27ea1 100644 (file)
 #include <babeltrace/plugin/plugin-set-const.h>
 
 /* Graph, component, and notification API */
+#include <babeltrace/graph/component-class-const.h>
+#include <babeltrace/graph/component-class-filter-const.h>
 #include <babeltrace/graph/component-class-filter.h>
+#include <babeltrace/graph/component-class-sink-const.h>
 #include <babeltrace/graph/component-class-sink.h>
+#include <babeltrace/graph/component-class-source-const.h>
 #include <babeltrace/graph/component-class-source.h>
 #include <babeltrace/graph/component-class.h>
-#include <babeltrace/graph/component-filter.h>
-#include <babeltrace/graph/component-sink.h>
-#include <babeltrace/graph/component-source.h>
-#include <babeltrace/graph/component.h>
-#include <babeltrace/graph/connection.h>
+#include <babeltrace/graph/component-const.h>
+#include <babeltrace/graph/component-filter-const.h>
+#include <babeltrace/graph/component-sink-const.h>
+#include <babeltrace/graph/component-source-const.h>
+#include <babeltrace/graph/connection-const.h>
+#include <babeltrace/graph/graph-const.h>
 #include <babeltrace/graph/graph.h>
+#include <babeltrace/graph/notification-const.h>
+#include <babeltrace/graph/notification-event-const.h>
 #include <babeltrace/graph/notification-event.h>
+#include <babeltrace/graph/notification-inactivity-const.h>
 #include <babeltrace/graph/notification-inactivity.h>
-#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/notification-packet-const.h>
 #include <babeltrace/graph/notification-packet.h>
+#include <babeltrace/graph/notification-stream-const.h>
 #include <babeltrace/graph/notification-stream.h>
-#include <babeltrace/graph/notification.h>
-#include <babeltrace/graph/port-input.h>
+#include <babeltrace/graph/port-const.h>
+#include <babeltrace/graph/port-input-const.h>
+#include <babeltrace/graph/port-output-const.h>
 #include <babeltrace/graph/port-output-notification-iterator.h>
-#include <babeltrace/graph/port-output.h>
-#include <babeltrace/graph/port.h>
-#include <babeltrace/graph/private-component-class-filter.h>
-#include <babeltrace/graph/private-component-class-sink.h>
-#include <babeltrace/graph/private-component-class-source.h>
-#include <babeltrace/graph/private-component-class.h>
-#include <babeltrace/graph/private-graph.h>
-#include <babeltrace/graph/private-notification-event.h>
-#include <babeltrace/graph/private-notification-inactivity.h>
-#include <babeltrace/graph/private-notification-packet.h>
-#include <babeltrace/graph/private-notification-stream.h>
-#include <babeltrace/graph/private-notification.h>
-#include <babeltrace/graph/private-query-executor.h>
+#include <babeltrace/graph/query-executor-const.h>
 #include <babeltrace/graph/query-executor.h>
 #include <babeltrace/graph/self-component-class-filter.h>
 #include <babeltrace/graph/self-component-class-sink.h>
index 97e14484ccc7428dd2a26a08fad9ed5d8802d27c..b4c1f224bca748967cedef8369fbfa24af273e51 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <babeltrace/assert-pre-internal.h>
 #include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/babeltrace.h>
 #include <babeltrace/common-internal.h>
 #include <babeltrace/ctf-writer/field-types-internal.h>
 #include <babeltrace/ctf-writer/fields.h>
index 1b74770cef0eec5dbd5539510bcc641df4017e56..7985947831734bab6094f721ce69da0f368b01e9 100644 (file)
@@ -31,7 +31,6 @@
 #include <babeltrace/assert-internal.h>
 #include <babeltrace/assert-pre-internal.h>
 #include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/babeltrace.h>
 #include <babeltrace/ctf-writer/serialize-internal.h>
 #include <babeltrace/ctf-writer/stream-internal.h>
 #include <babeltrace/ctf-writer/stream.h>
diff --git a/include/babeltrace/graph/component-class-const.h b/include/babeltrace/graph/component-class-const.h
new file mode 100644 (file)
index 0000000..9cad4c8
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_CONST_H
+#define BABELTRACE_GRAPH_COMPONENT_CLASS_CONST_H
+
+/*
+ * 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.
+ */
+
+/* For bt_bool */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+
+enum bt_component_class_type {
+       BT_COMPONENT_CLASS_TYPE_SOURCE =        0,
+       BT_COMPONENT_CLASS_TYPE_FILTER =        1,
+       BT_COMPONENT_CLASS_TYPE_SINK =          2,
+};
+
+extern const char *bt_component_class_get_name(
+               const struct bt_component_class *component_class);
+
+extern const char *bt_component_class_get_description(
+               const struct bt_component_class *component_class);
+
+extern const char *bt_component_class_get_help(
+               const struct bt_component_class *component_class);
+
+extern enum bt_component_class_type bt_component_class_get_type(
+               const struct bt_component_class *component_class);
+
+static inline
+bt_bool bt_component_class_is_source(
+               const struct bt_component_class *component_class)
+{
+       return bt_component_class_get_type(component_class) ==
+               BT_COMPONENT_CLASS_TYPE_SOURCE;
+}
+
+static inline
+bt_bool bt_component_class_is_filter(
+               const struct bt_component_class *component_class)
+{
+       return bt_component_class_get_type(component_class) ==
+               BT_COMPONENT_CLASS_TYPE_FILTER;
+}
+
+static inline
+bt_bool bt_component_class_is_sink(
+               const struct bt_component_class *component_class)
+{
+       return bt_component_class_get_type(component_class) ==
+               BT_COMPONENT_CLASS_TYPE_SINK;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_CONST_H */
diff --git a/include/babeltrace/graph/component-class-filter-const.h b/include/babeltrace/graph/component-class-filter-const.h
new file mode 100644 (file)
index 0000000..0c12457
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_CONST_H
+#define BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_CONST_H
+
+/*
+ * 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+struct bt_component_class_filter;
+
+static inline
+const struct bt_component_class *
+bt_component_class_filter_as_component_class_const(
+               const struct bt_component_class_filter *comp_cls_filter)
+{
+       return (const void *) comp_cls_filter;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_CONST_H */
index 83365be3705cffb162fb5e62fb88d2174ac1aae7..2dec11caf4048b4d3fcaf89ac2fcc0189d14ad06 100644 (file)
  * SOFTWARE.
  */
 
+#include <stdint.h>
+
+/* For enum bt_notification_array_const */
+#include <babeltrace/graph/notification-const.h>
+
+/* For enum bt_self_component_status */
+#include <babeltrace/graph/self-component.h>
+
+/* For enum bt_self_notification_iterator_status */
+#include <babeltrace/graph/self-notification-iterator.h>
+
+/* For enum bt_query_status */
+#include <babeltrace/graph/component-class.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct bt_component_class;
 struct bt_component_class_filter;
+struct bt_port_input;
+struct bt_port_output;
+struct bt_query_executor;
+struct bt_self_component_class_filter;
+struct bt_self_component_filter;
+struct bt_self_component_port_input;
+struct bt_self_component_port_output;
+struct bt_value;
+
+typedef enum bt_self_component_status
+(*bt_component_class_filter_init_method)(
+               struct bt_self_component_filter *self_component,
+               const struct bt_value *params, void *init_method_data);
+
+typedef void (*bt_component_class_filter_finalize_method)(
+               struct bt_self_component_filter *self_component);
+
+typedef enum bt_self_notification_iterator_status
+(*bt_component_class_filter_notification_iterator_init_method)(
+               struct bt_self_notification_iterator *notification_iterator,
+               struct bt_self_component_filter *self_component,
+               struct bt_self_component_port_output *port);
+
+typedef void
+(*bt_component_class_filter_notification_iterator_finalize_method)(
+               struct bt_self_notification_iterator *notification_iterator);
+
+typedef enum bt_self_notification_iterator_status
+(*bt_component_class_filter_notification_iterator_next_method)(
+               struct bt_self_notification_iterator *notification_iterator,
+               bt_notification_array_const notifs, uint64_t capacity,
+               uint64_t *count);
+
+typedef enum bt_query_status
+(*bt_component_class_filter_query_method)(
+               struct bt_self_component_class_filter *comp_class,
+               const struct bt_query_executor *query_executor,
+               const char *object, const struct bt_value *params,
+               const struct bt_value **result);
+
+typedef enum bt_self_component_status
+(*bt_component_class_filter_accept_input_port_connection_method)(
+               struct bt_self_component_filter *self_component,
+               struct bt_self_component_port_input *self_port,
+               const struct bt_port_output *other_port);
+
+typedef enum bt_self_component_status
+(*bt_component_class_filter_accept_output_port_connection_method)(
+               struct bt_self_component_filter *self_component,
+               struct bt_self_component_port_output *self_port,
+               const struct bt_port_input *other_port);
+
+typedef enum bt_self_component_status
+(*bt_component_class_filter_input_port_connected_method)(
+               struct bt_self_component_filter *self_component,
+               struct bt_self_component_port_input *self_port,
+               const struct bt_port_output *other_port);
+
+typedef enum bt_self_component_status
+(*bt_component_class_filter_output_port_connected_method)(
+               struct bt_self_component_filter *self_component,
+               struct bt_self_component_port_output *self_port,
+               const struct bt_port_input *other_port);
+
+typedef void
+(*bt_component_class_filter_input_port_disconnected_method)(
+               struct bt_self_component_filter *self_component,
+               struct bt_self_component_port_input *self_port);
+
+typedef void
+(*bt_component_class_filter_output_port_disconnected_method)(
+               struct bt_self_component_filter *self_component,
+               struct bt_self_component_port_output *self_port);
 
 static inline
-struct bt_component_class *
-bt_component_class_filter_as_component_class(
+struct bt_component_class *bt_component_class_filter_as_component_class(
                struct bt_component_class_filter *comp_cls_filter)
 {
        return (void *) comp_cls_filter;
 }
 
+extern
+struct bt_component_class_filter *bt_component_class_filter_create(
+               const char *name,
+               bt_component_class_filter_notification_iterator_next_method method);
+
+extern int bt_component_class_filter_set_init_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_init_method method);
+
+extern int bt_component_class_filter_set_finalize_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_finalize_method method);
+
+extern int bt_component_class_filter_set_accept_input_port_connection_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_accept_input_port_connection_method method);
+
+extern int bt_component_class_filter_set_accept_output_port_connection_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_accept_output_port_connection_method method);
+
+extern int bt_component_class_filter_set_input_port_connected_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_input_port_connected_method method);
+
+extern int bt_component_class_filter_set_output_port_connected_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_output_port_connected_method method);
+
+extern int bt_component_class_filter_set_input_port_disconnected_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_input_port_disconnected_method method);
+
+extern int bt_component_class_filter_set_output_port_disconnected_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_output_port_disconnected_method method);
+
+extern int bt_component_class_filter_set_query_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_query_method method);
+
+extern int bt_component_class_filter_set_notification_iterator_init_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_notification_iterator_init_method method);
+
+extern int bt_component_class_filter_set_notification_iterator_finalize_method(
+               struct bt_component_class_filter *comp_class,
+               bt_component_class_filter_notification_iterator_finalize_method method);
+
 #ifdef __cplusplus
 }
 #endif
index e5185739c9bcc3b860b35576589b73a087978271..d347d2c253bfaccce021c03ff4160bc5fce061f6 100644 (file)
  * SOFTWARE.
  */
 
-#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-const.h>
 #include <babeltrace/graph/component-class.h>
-#include <babeltrace/graph/private-component-class-source.h>
-#include <babeltrace/graph/private-component-class-filter.h>
-#include <babeltrace/graph/private-component-class-sink.h>
+#include <babeltrace/graph/component-class-source.h>
+#include <babeltrace/graph/component-class-filter.h>
+#include <babeltrace/graph/component-class-sink.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/list-internal.h>
@@ -65,46 +65,46 @@ struct bt_component_class {
 struct bt_component_class_source {
        struct bt_component_class parent;
        struct {
-               bt_private_component_class_source_init_method init;
-               bt_private_component_class_source_finalize_method finalize;
-               bt_private_component_class_source_notification_iterator_init_method notif_iter_init;
-               bt_private_component_class_source_notification_iterator_finalize_method notif_iter_finalize;
-               bt_private_component_class_source_notification_iterator_next_method notif_iter_next;
-               bt_private_component_class_source_query_method query;
-               bt_private_component_class_source_accept_output_port_connection_method accept_output_port_connection;
-               bt_private_component_class_source_output_port_connected_method output_port_connected;
-               bt_private_component_class_source_output_port_disconnected_method output_port_disconnected;
+               bt_component_class_source_init_method init;
+               bt_component_class_source_finalize_method finalize;
+               bt_component_class_source_notification_iterator_init_method notif_iter_init;
+               bt_component_class_source_notification_iterator_finalize_method notif_iter_finalize;
+               bt_component_class_source_notification_iterator_next_method notif_iter_next;
+               bt_component_class_source_query_method query;
+               bt_component_class_source_accept_output_port_connection_method accept_output_port_connection;
+               bt_component_class_source_output_port_connected_method output_port_connected;
+               bt_component_class_source_output_port_disconnected_method output_port_disconnected;
        } methods;
 };
 
 struct bt_component_class_sink {
        struct bt_component_class parent;
        struct {
-               bt_private_component_class_sink_init_method init;
-               bt_private_component_class_sink_finalize_method finalize;
-               bt_private_component_class_sink_query_method query;
-               bt_private_component_class_sink_accept_input_port_connection_method accept_input_port_connection;
-               bt_private_component_class_sink_input_port_connected_method input_port_connected;
-               bt_private_component_class_sink_input_port_disconnected_method input_port_disconnected;
-               bt_private_component_class_sink_consume_method consume;
+               bt_component_class_sink_init_method init;
+               bt_component_class_sink_finalize_method finalize;
+               bt_component_class_sink_query_method query;
+               bt_component_class_sink_accept_input_port_connection_method accept_input_port_connection;
+               bt_component_class_sink_input_port_connected_method input_port_connected;
+               bt_component_class_sink_input_port_disconnected_method input_port_disconnected;
+               bt_component_class_sink_consume_method consume;
        } methods;
 };
 
 struct bt_component_class_filter {
        struct bt_component_class parent;
        struct {
-               bt_private_component_class_filter_init_method init;
-               bt_private_component_class_filter_finalize_method finalize;
-               bt_private_component_class_filter_notification_iterator_init_method notif_iter_init;
-               bt_private_component_class_filter_notification_iterator_finalize_method notif_iter_finalize;
-               bt_private_component_class_filter_notification_iterator_next_method notif_iter_next;
-               bt_private_component_class_filter_query_method query;
-               bt_private_component_class_filter_accept_input_port_connection_method accept_input_port_connection;
-               bt_private_component_class_filter_accept_output_port_connection_method accept_output_port_connection;
-               bt_private_component_class_filter_input_port_connected_method input_port_connected;
-               bt_private_component_class_filter_output_port_connected_method output_port_connected;
-               bt_private_component_class_filter_input_port_disconnected_method input_port_disconnected;
-               bt_private_component_class_filter_output_port_disconnected_method output_port_disconnected;
+               bt_component_class_filter_init_method init;
+               bt_component_class_filter_finalize_method finalize;
+               bt_component_class_filter_notification_iterator_init_method notif_iter_init;
+               bt_component_class_filter_notification_iterator_finalize_method notif_iter_finalize;
+               bt_component_class_filter_notification_iterator_next_method notif_iter_next;
+               bt_component_class_filter_query_method query;
+               bt_component_class_filter_accept_input_port_connection_method accept_input_port_connection;
+               bt_component_class_filter_accept_output_port_connection_method accept_output_port_connection;
+               bt_component_class_filter_input_port_connected_method input_port_connected;
+               bt_component_class_filter_output_port_connected_method output_port_connected;
+               bt_component_class_filter_input_port_disconnected_method input_port_disconnected;
+               bt_component_class_filter_output_port_disconnected_method output_port_disconnected;
        } methods;
 };
 
@@ -113,7 +113,8 @@ void bt_component_class_add_destroy_listener(struct bt_component_class *class,
                bt_component_class_destroy_listener_func func, void *data);
 
 BT_HIDDEN
-void _bt_component_class_freeze(struct bt_component_class *component_class);
+void _bt_component_class_freeze(
+               const struct bt_component_class *component_class);
 
 #ifdef BT_DEV_MODE
 # define bt_component_class_freeze     _bt_component_class_freeze
index 0e86ff4b9311a1b17016d2624409bf08317869ce..b794f74ea254c1b955eff937956cab21dfaf86ed 100644 (file)
 
 #include <stdint.h>
 #include <babeltrace/types.h>
+#include <babeltrace/graph/notification-const.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-struct bt_component_class;
-struct bt_notification;
-
 struct bt_component_class_sink_colander_data {
-       bt_notification_array notifs;
+       bt_notification_array_const notifs;
        uint64_t *count_addr;
 };
 
diff --git a/include/babeltrace/graph/component-class-sink-const.h b/include/babeltrace/graph/component-class-sink-const.h
new file mode 100644 (file)
index 0000000..d862221
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_CONST_H
+#define BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_CONST_H
+
+/*
+ * 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+struct bt_component_class_sink;
+
+static inline
+const struct bt_component_class *
+bt_component_class_sink_as_component_class_const(
+               const struct bt_component_class_sink *comp_cls_sink)
+{
+       return (const void *) comp_cls_sink;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_SINK_CONST_H */
index db28fe839ddafa3d9911d2848e80ea3c881cac6b..6164c0cc28622362cba1987ef17b4f8f0c236595 100644 (file)
  * SOFTWARE.
  */
 
+#include <stdint.h>
+
+/* For enum bt_self_component_status */
+#include <babeltrace/graph/self-component.h>
+
+/* For enum bt_query_status */
+#include <babeltrace/graph/component-class.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct bt_component_class;
 struct bt_component_class_sink;
+struct bt_port_output;
+struct bt_query_executor;
+struct bt_self_component_class_sink;
+struct bt_self_component_port_input;
+struct bt_self_component_sink;
+struct bt_value;
+
+typedef enum bt_self_component_status
+(*bt_component_class_sink_init_method)(
+               struct bt_self_component_sink *self_component,
+               const struct bt_value *params, void *init_method_data);
+
+typedef void (*bt_component_class_sink_finalize_method)(
+               struct bt_self_component_sink *self_component);
+
+typedef enum bt_query_status
+(*bt_component_class_sink_query_method)(
+               struct bt_self_component_class_sink *comp_class,
+               const struct bt_query_executor *query_executor,
+               const char *object, const struct bt_value *params,
+               const struct bt_value **result);
+
+typedef enum bt_self_component_status
+(*bt_component_class_sink_accept_input_port_connection_method)(
+               struct bt_self_component_sink *self_component,
+               struct bt_self_component_port_input *self_port,
+               const struct bt_port_output *other_port);
+
+typedef enum bt_self_component_status
+(*bt_component_class_sink_input_port_connected_method)(
+               struct bt_self_component_sink *self_component,
+               struct bt_self_component_port_input *self_port,
+               const struct bt_port_output *other_port);
+
+typedef void
+(*bt_component_class_sink_input_port_disconnected_method)(
+               struct bt_self_component_sink *self_component,
+               struct bt_self_component_port_input *self_port);
+
+typedef enum bt_self_component_status
+(*bt_component_class_sink_consume_method)(
+       struct bt_self_component_sink *self_component);
 
 static inline
-struct bt_component_class *
-bt_component_class_sink_as_component_class(
+struct bt_component_class *bt_component_class_sink_as_component_class(
                struct bt_component_class_sink *comp_cls_sink)
 {
        return (void *) comp_cls_sink;
 }
 
+extern
+struct bt_component_class_sink *bt_component_class_sink_create(
+               const char *name,
+               bt_component_class_sink_consume_method method);
+
+extern int bt_component_class_sink_set_init_method(
+               struct bt_component_class_sink *comp_class,
+               bt_component_class_sink_init_method method);
+
+extern int bt_component_class_sink_set_finalize_method(
+               struct bt_component_class_sink *comp_class,
+               bt_component_class_sink_finalize_method method);
+
+extern int bt_component_class_sink_set_accept_input_port_connection_method(
+               struct bt_component_class_sink *comp_class,
+               bt_component_class_sink_accept_input_port_connection_method method);
+
+extern int bt_component_class_sink_set_input_port_connected_method(
+               struct bt_component_class_sink *comp_class,
+               bt_component_class_sink_input_port_connected_method method);
+
+extern int bt_component_class_sink_set_input_port_disconnected_method(
+               struct bt_component_class_sink *comp_class,
+               bt_component_class_sink_input_port_disconnected_method method);
+
+extern int bt_component_class_sink_set_query_method(
+               struct bt_component_class_sink *comp_class,
+               bt_component_class_sink_query_method method);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/babeltrace/graph/component-class-source-const.h b/include/babeltrace/graph/component-class-source-const.h
new file mode 100644 (file)
index 0000000..6491239
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_SOURCE_CONST_H
+#define BABELTRACE_GRAPH_COMPONENT_CLASS_SOURCE_CONST_H
+
+/*
+ * 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+struct bt_component_class_source;
+
+static inline
+const struct bt_component_class *
+bt_component_class_source_as_component_class_const(
+               const struct bt_component_class_source *comp_cls_source)
+{
+       return (const void *) comp_cls_source;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_SOURCE_CONST_H */
index 8e24e9c0648dae8645123b8d861b3fcb844c0f0d..418b9c532d79495df3492211f98223609487cd06 100644 (file)
  * SOFTWARE.
  */
 
+#include <stdint.h>
+
+/* For enum bt_notification_array_const */
+#include <babeltrace/graph/notification-const.h>
+
+/* For enum bt_self_component_status */
+#include <babeltrace/graph/self-component.h>
+
+/* For enum bt_self_notification_iterator_status */
+#include <babeltrace/graph/self-notification-iterator.h>
+
+/* For enum bt_query_status */
+#include <babeltrace/graph/component-class.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-struct bt_component_class;
+struct bt_self_component_class_source;
+struct bt_component_class_source;
+struct bt_self_component_source;
 struct bt_component_class_source;
+struct bt_self_component_port_output;
+struct bt_port_input;
+struct bt_query_executor;
+struct bt_value;
+
+typedef enum bt_self_component_status
+(*bt_component_class_source_init_method)(
+               struct bt_self_component_source *self_component,
+               const struct bt_value *params, void *init_method_data);
+
+typedef void (*bt_component_class_source_finalize_method)(
+               struct bt_self_component_source *self_component);
+
+typedef enum bt_self_notification_iterator_status
+(*bt_component_class_source_notification_iterator_init_method)(
+               struct bt_self_notification_iterator *notification_iterator,
+               struct bt_self_component_source *self_component,
+               struct bt_self_component_port_output *port);
+
+typedef void
+(*bt_component_class_source_notification_iterator_finalize_method)(
+               struct bt_self_notification_iterator *notification_iterator);
+
+typedef enum bt_self_notification_iterator_status
+(*bt_component_class_source_notification_iterator_next_method)(
+               struct bt_self_notification_iterator *notification_iterator,
+               bt_notification_array_const notifs, uint64_t capacity,
+               uint64_t *count);
+
+typedef enum bt_query_status
+(*bt_component_class_source_query_method)(
+               struct bt_self_component_class_source *comp_class,
+               const struct bt_query_executor *query_executor,
+               const char *object, const struct bt_value *params,
+               const struct bt_value **result);
+
+typedef enum bt_self_component_status
+(*bt_component_class_source_accept_output_port_connection_method)(
+               struct bt_self_component_source *self_component,
+               struct bt_self_component_port_output *self_port,
+               const struct bt_port_input *other_port);
+
+typedef enum bt_self_component_status
+(*bt_component_class_source_output_port_connected_method)(
+               struct bt_self_component_source *self_component,
+               struct bt_self_component_port_output *self_port,
+               const struct bt_port_input *other_port);
+
+typedef void
+(*bt_component_class_source_output_port_disconnected_method)(
+               struct bt_self_component_source *self_component,
+               struct bt_self_component_port_output *self_port);
 
 static inline
-struct bt_component_class *
-bt_component_class_source_as_component_class(
+struct bt_component_class *bt_component_class_source_as_component_class(
                struct bt_component_class_source *comp_cls_source)
 {
        return (void *) comp_cls_source;
 }
 
+extern
+struct bt_component_class_source *bt_component_class_source_create(
+               const char *name,
+               bt_component_class_source_notification_iterator_next_method method);
+
+extern int bt_component_class_source_set_init_method(
+               struct bt_component_class_source *comp_class,
+               bt_component_class_source_init_method method);
+
+extern int bt_component_class_source_set_finalize_method(
+               struct bt_component_class_source *comp_class,
+               bt_component_class_source_finalize_method method);
+
+extern int bt_component_class_source_set_accept_output_port_connection_method(
+               struct bt_component_class_source *comp_class,
+               bt_component_class_source_accept_output_port_connection_method method);
+
+extern int bt_component_class_source_set_output_port_connected_method(
+               struct bt_component_class_source *comp_class,
+               bt_component_class_source_output_port_connected_method method);
+
+extern int bt_component_class_source_set_output_port_disconnected_method(
+               struct bt_component_class_source *comp_class,
+               bt_component_class_source_output_port_disconnected_method method);
+
+extern int bt_component_class_source_set_query_method(
+               struct bt_component_class_source *comp_class,
+               bt_component_class_source_query_method method);
+
+extern int bt_component_class_source_set_notification_iterator_init_method(
+               struct bt_component_class_source *comp_class,
+               bt_component_class_source_notification_iterator_init_method method);
+
+extern int bt_component_class_source_set_notification_iterator_finalize_method(
+               struct bt_component_class_source *comp_class,
+               bt_component_class_source_notification_iterator_finalize_method method);
+
 #ifdef __cplusplus
 }
 #endif
index 46cb59d2e08b559e216db9bd7d353622423369b5..454abba81534b5962599a6976943c38b2462808c 100644 (file)
@@ -23,8 +23,8 @@
  * SOFTWARE.
  */
 
-/* For bt_bool */
-#include <babeltrace/types.h>
+/* For enum bt_query_executor_status */
+#include <babeltrace/graph/query-executor-const.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -32,44 +32,22 @@ extern "C" {
 
 struct bt_component_class;
 
-enum bt_component_class_type {
-       BT_COMPONENT_CLASS_TYPE_SOURCE =        0,
-       BT_COMPONENT_CLASS_TYPE_FILTER =        1,
-       BT_COMPONENT_CLASS_TYPE_SINK =          2,
+enum bt_query_status {
+       BT_QUERY_STATUS_OK = BT_QUERY_EXECUTOR_STATUS_OK,
+       BT_QUERY_STATUS_AGAIN = BT_QUERY_EXECUTOR_STATUS_AGAIN,
+       BT_QUERY_STATUS_ERROR = BT_QUERY_EXECUTOR_STATUS_ERROR,
+       BT_QUERY_STATUS_NOMEM = BT_QUERY_EXECUTOR_STATUS_NOMEM,
+       BT_QUERY_STATUS_INVALID_OBJECT = BT_QUERY_EXECUTOR_STATUS_INVALID_OBJECT,
+       BT_QUERY_STATUS_INVALID_PARAMS = BT_QUERY_EXECUTOR_STATUS_INVALID_PARAMS,
 };
 
-extern const char *bt_component_class_get_name(
-               struct bt_component_class *component_class);
+extern int bt_component_class_set_description(
+               struct bt_component_class *component_class,
+               const char *description);
 
-extern const char *bt_component_class_get_description(
-               struct bt_component_class *component_class);
-
-extern const char *bt_component_class_get_help(
-               struct bt_component_class *component_class);
-
-extern enum bt_component_class_type bt_component_class_get_type(
-               struct bt_component_class *component_class);
-
-static inline
-bt_bool bt_component_class_is_source(struct bt_component_class *component_class)
-{
-       return bt_component_class_get_type(component_class) ==
-               BT_COMPONENT_CLASS_TYPE_SOURCE;
-}
-
-static inline
-bt_bool bt_component_class_is_filter(struct bt_component_class *component_class)
-{
-       return bt_component_class_get_type(component_class) ==
-               BT_COMPONENT_CLASS_TYPE_FILTER;
-}
-
-static inline
-bt_bool bt_component_class_is_sink(struct bt_component_class *component_class)
-{
-       return bt_component_class_get_type(component_class) ==
-               BT_COMPONENT_CLASS_TYPE_SINK;
-}
+extern int bt_component_class_set_help(
+               struct bt_component_class *component_class,
+               const char *help);
 
 #ifdef __cplusplus
 }
diff --git a/include/babeltrace/graph/component-const.h b/include/babeltrace/graph/component-const.h
new file mode 100644 (file)
index 0000000..3f6182e
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef BABELTRACE_GRAPH_COMPONENT_CONST_H
+#define BABELTRACE_GRAPH_COMPONENT_CONST_H
+
+/*
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+/* For enum bt_component_class_type */
+#include <babeltrace/graph/component-class-const.h>
+
+/* For bt_bool */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component_class;
+struct bt_component_graph;
+struct bt_component;
+struct bt_value;
+struct bt_port;
+
+/**
+ * Get component's name.
+ *
+ * @param component    Component instance of which to get the name
+ * @returns            Returns a pointer to the component's name
+ */
+extern const char *bt_component_get_name(const struct bt_component *component);
+
+/**
+ * Get component's class.
+ *
+ * @param component    Component instance of which to get the class
+ * @returns            The component's class
+ */
+extern const struct bt_component_class *bt_component_borrow_class_const(
+               const struct bt_component *component);
+
+extern enum bt_component_class_type bt_component_get_class_type(
+               const struct bt_component *component);
+
+static inline
+bt_bool bt_component_is_source(const struct bt_component *component)
+{
+       return bt_component_get_class_type(component) ==
+               BT_COMPONENT_CLASS_TYPE_SOURCE;
+}
+
+static inline
+bt_bool bt_component_is_filter(const struct bt_component *component)
+{
+       return bt_component_get_class_type(component) ==
+               BT_COMPONENT_CLASS_TYPE_FILTER;
+}
+
+static inline
+bt_bool bt_component_is_sink(const struct bt_component *component)
+{
+       return bt_component_get_class_type(component) ==
+               BT_COMPONENT_CLASS_TYPE_SINK;
+}
+
+extern bt_bool bt_component_graph_is_canceled(
+               const struct bt_component *component);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_COMPONENT_CONST_H */
diff --git a/include/babeltrace/graph/component-filter-const.h b/include/babeltrace/graph/component-filter-const.h
new file mode 100644 (file)
index 0000000..015ae22
--- /dev/null
@@ -0,0 +1,72 @@
+#ifndef BABELTRACE_GRAPH_COMPONENT_FILTER_CONST_H
+#define BABELTRACE_GRAPH_COMPONENT_FILTER_CONST_H
+
+/*
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component;
+struct bt_component_filter;
+struct bt_port_input;
+struct bt_port_output;
+
+static inline
+const struct bt_component *bt_component_filter_as_component_const(
+               const struct bt_component_filter *component)
+{
+       return (const void *) component;
+}
+
+extern uint64_t bt_component_filter_get_input_port_count(
+               const struct bt_component_filter *component);
+
+extern const struct bt_port_input *
+bt_component_filter_borrow_input_port_by_name_const(
+               const struct bt_component_filter *component, const char *name);
+
+extern const struct bt_port_input *
+bt_component_filter_borrow_input_port_by_index_const(
+               const struct bt_component_filter *component, uint64_t index);
+
+extern uint64_t bt_component_filter_get_output_port_count(
+               const struct bt_component_filter *component);
+
+extern const struct bt_port_output *
+bt_component_filter_borrow_output_port_by_name_const(
+               const struct bt_component_filter *component, const char *name);
+
+extern const struct bt_port_output *
+bt_component_filter_borrow_output_port_by_index_const(
+               const struct bt_component_filter *component, uint64_t index);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_COMPONENT_FILTER_CONST_H */
index a31a881dc3512047c6565d2bbee7165dfc5d4e2d..79a7b0003749a9a3b01ff45dd9e8af92a2067b21 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 #include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/graph/component-filter-const.h>
 #include <babeltrace/graph/component-internal.h>
 #include <babeltrace/graph/component-class-internal.h>
 
@@ -35,7 +36,7 @@ struct bt_component_filter {
 
 BT_HIDDEN
 struct bt_component *bt_component_filter_create(
-               struct bt_component_class *class);
+               const struct bt_component_class *class);
 
 BT_HIDDEN
 void bt_component_filter_destroy(struct bt_component *component);
diff --git a/include/babeltrace/graph/component-filter.h b/include/babeltrace/graph/component-filter.h
deleted file mode 100644 (file)
index 89238f2..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef BABELTRACE_GRAPH_COMPONENT_FILTER_H
-#define BABELTRACE_GRAPH_COMPONENT_FILTER_H
-
-/*
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component;
-struct bt_component_filter;
-struct bt_port_input;
-struct bt_port_output;
-
-static inline
-struct bt_component *bt_component_filter_as_component(
-               struct bt_component_filter *component)
-{
-       return (void *) component;
-}
-
-extern uint64_t bt_component_filter_get_input_port_count(
-               struct bt_component_filter *component);
-
-extern struct bt_port_input *bt_component_filter_borrow_input_port_by_name(
-               struct bt_component_filter *component, const char *name);
-
-extern struct bt_port_input *bt_component_filter_borrow_input_port_by_index(
-               struct bt_component_filter *component, uint64_t index);
-
-extern uint64_t bt_component_filter_get_output_port_count(
-               struct bt_component_filter *component);
-
-extern struct bt_port_output *bt_component_filter_borrow_output_port_by_name(
-               struct bt_component_filter *component, const char *name);
-
-extern struct bt_port_output *bt_component_filter_borrow_output_port_by_index(
-               struct bt_component_filter *component, uint64_t index);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_COMPONENT_FILTER_H */
index d186425e7a4f1be7b6483d0ebe15e1281d04b3dc..4ba2fe542093da9a19e0644f8eb87b6af8c7be40 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-const.h>
 #include <babeltrace/graph/component-class-internal.h>
 #include <babeltrace/graph/port-internal.h>
 #include <babeltrace/object-internal.h>
@@ -99,10 +99,10 @@ void bt_component_set_graph(struct bt_component *component,
                struct bt_graph *graph);
 
 BT_HIDDEN
-uint64_t bt_component_get_input_port_count(struct bt_component *comp);
+uint64_t bt_component_get_input_port_count(const struct bt_component *comp);
 
 BT_HIDDEN
-uint64_t bt_component_get_output_port_count(struct bt_component *comp);
+uint64_t bt_component_get_output_port_count(const struct bt_component *comp);
 
 BT_HIDDEN
 struct bt_port_input *bt_component_borrow_input_port_by_index(
diff --git a/include/babeltrace/graph/component-sink-const.h b/include/babeltrace/graph/component-sink-const.h
new file mode 100644 (file)
index 0000000..af69be8
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef BABELTRACE_GRAPH_COMPONENT_SINK_CONST_H
+#define BABELTRACE_GRAPH_COMPONENT_SINK_CONST_H
+
+/*
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component;
+struct bt_component_sink;
+struct bt_port_input;
+
+static inline
+const struct bt_component *bt_component_sink_as_component_const(
+               const struct bt_component_sink *component)
+{
+       return (const void *) component;
+}
+
+extern uint64_t bt_component_sink_get_input_port_count(
+               const struct bt_component_sink *component);
+
+extern const struct bt_port_input *
+bt_component_sink_borrow_input_port_by_name_const(
+               const struct bt_component_sink *component, const char *name);
+
+extern const struct bt_port_input *
+bt_component_sink_borrow_input_port_by_index_const(
+               const struct bt_component_sink *component, uint64_t index);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_COMPONENT_SINK_CONST_H */
index 7b67e2fdf5ee3e1e2f731030f0490d941ca896ba..a5880fef22f84d02a97bfb701c2282d0bb861d4f 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/compiler-internal.h>
-#include <babeltrace/graph/component-sink.h>
+#include <babeltrace/graph/component-sink-const.h>
 #include <babeltrace/graph/component-internal.h>
 #include <babeltrace/graph/component-class-internal.h>
 
@@ -37,7 +37,7 @@ struct bt_component_sink {
 
 BT_HIDDEN
 struct bt_component *bt_component_sink_create(
-               struct bt_component_class *class);
+               const struct bt_component_class *class);
 
 BT_HIDDEN
 void bt_component_sink_destroy(struct bt_component *component);
diff --git a/include/babeltrace/graph/component-sink.h b/include/babeltrace/graph/component-sink.h
deleted file mode 100644 (file)
index 12fe73d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef BABELTRACE_GRAPH_COMPONENT_SINK_H
-#define BABELTRACE_GRAPH_COMPONENT_SINK_H
-
-/*
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component;
-struct bt_component_sink;
-struct bt_port_input;
-
-static inline
-struct bt_component *bt_component_sink_as_component(
-               struct bt_component_sink *component)
-{
-       return (void *) component;
-}
-
-extern uint64_t bt_component_sink_get_input_port_count(
-               struct bt_component_sink *component);
-
-extern struct bt_port_input *bt_component_sink_borrow_input_port_by_name(
-               struct bt_component_sink *component, const char *name);
-
-extern struct bt_port_input *bt_component_sink_borrow_input_port_by_index(
-               struct bt_component_sink *component, uint64_t index);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_COMPONENT_SINK_H */
diff --git a/include/babeltrace/graph/component-source-const.h b/include/babeltrace/graph/component-source-const.h
new file mode 100644 (file)
index 0000000..06e014f
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef BABELTRACE_GRAPH_COMPONENT_SOURCE_CONST_H
+#define BABELTRACE_GRAPH_COMPONENT_SOURCE_CONST_H
+
+/*
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component;
+struct bt_component_source;
+struct bt_port_output;
+
+static inline
+const struct bt_component *bt_component_source_as_component_const(
+               const struct bt_component_source *component)
+{
+       return (void *) component;
+}
+
+extern uint64_t bt_component_source_get_output_port_count(
+               const struct bt_component_source *component);
+
+extern const struct bt_port_output *
+bt_component_source_borrow_output_port_by_name_const(
+               const struct bt_component_source *component, const char *name);
+
+extern const struct bt_port_output *
+bt_component_source_borrow_output_port_by_index_const(
+               const struct bt_component_source *component, uint64_t index);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_COMPONENT_SOURCE_CONST_H */
index 08c08296d89a7ad232520715d152f658ecbc5998..21e4da2c016e06a5165a6f124601cc9986526d7b 100644 (file)
@@ -35,7 +35,7 @@ struct bt_component_source {
 
 BT_HIDDEN
 struct bt_component *bt_component_source_create(
-               struct bt_component_class *class);
+               const struct bt_component_class *class);
 
 BT_HIDDEN
 void bt_component_source_destroy(struct bt_component *component);
diff --git a/include/babeltrace/graph/component-source.h b/include/babeltrace/graph/component-source.h
deleted file mode 100644 (file)
index cfdd41f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef BABELTRACE_GRAPH_COMPONENT_SOURCE_H
-#define BABELTRACE_GRAPH_COMPONENT_SOURCE_H
-
-/*
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component;
-struct bt_component_source;
-struct bt_port_output;
-
-static inline
-struct bt_component *bt_component_source_as_component(
-               struct bt_component_source *component)
-{
-       return (void *) component;
-}
-
-extern uint64_t bt_component_source_get_output_port_count(
-               struct bt_component_source *component);
-
-extern struct bt_port_output *bt_component_source_borrow_output_port_by_name(
-               struct bt_component_source *component, const char *name);
-
-extern struct bt_port_output *bt_component_source_borrow_output_port_by_index(
-               struct bt_component_source *component, uint64_t index);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_COMPONENT_SOURCE_H */
diff --git a/include/babeltrace/graph/component.h b/include/babeltrace/graph/component.h
deleted file mode 100644 (file)
index 7edbc0c..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef BABELTRACE_GRAPH_COMPONENT_H
-#define BABELTRACE_GRAPH_COMPONENT_H
-
-/*
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-/* For BT_COMPONENT_CLASS_TYPE_* */
-#include <babeltrace/graph/component-class.h>
-
-/* For bt_bool */
-#include <babeltrace/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component_class;
-struct bt_component_graph;
-struct bt_component;
-struct bt_value;
-struct bt_port;
-
-/**
- * Get component's name.
- *
- * @param component    Component instance of which to get the name
- * @returns            Returns a pointer to the component's name
- */
-extern const char *bt_component_get_name(struct bt_component *component);
-
-/**
- * Get component's class.
- *
- * @param component    Component instance of which to get the class
- * @returns            The component's class
- */
-extern struct bt_component_class *bt_component_get_class(
-               struct bt_component *component);
-
-extern enum bt_component_class_type bt_component_get_class_type(
-               struct bt_component *component);
-
-static inline
-bt_bool bt_component_is_source(struct bt_component *component)
-{
-       return bt_component_get_class_type(component) ==
-               BT_COMPONENT_CLASS_TYPE_SOURCE;
-}
-
-static inline
-bt_bool bt_component_is_filter(struct bt_component *component)
-{
-       return bt_component_get_class_type(component) ==
-               BT_COMPONENT_CLASS_TYPE_FILTER;
-}
-
-static inline
-bt_bool bt_component_is_sink(struct bt_component *component)
-{
-       return bt_component_get_class_type(component) ==
-               BT_COMPONENT_CLASS_TYPE_SINK;
-}
-
-extern bt_bool bt_component_graph_is_canceled(struct bt_component *component);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_COMPONENT_H */
diff --git a/include/babeltrace/graph/connection-const.h b/include/babeltrace/graph/connection-const.h
new file mode 100644 (file)
index 0000000..1d93c64
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef BABELTRACE_GRAPH_CONNECTION_CONST_H
+#define BABELTRACE_GRAPH_CONNECTION_CONST_H
+
+/*
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+/* For bt_bool */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_port_input;
+struct bt_port_output;
+struct bt_connection;
+
+extern const struct bt_port_input *bt_connection_borrow_downstream_port_const(
+               const struct bt_connection *connection);
+
+extern const struct bt_port_output *bt_connection_borrow_upstream_port_const(
+               const struct bt_connection *connection);
+
+extern bt_bool bt_connection_is_ended(const struct bt_connection *connection);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_CONNECTION_CONST_H */
index 98222c04316a55b2949e892b5084849b8c335570..784ca643a4864e5908325cb29377303755e6c6b3 100644 (file)
@@ -25,7 +25,7 @@
  * SOFTWARE.
  */
 
-#include <babeltrace/graph/connection.h>
+#include <babeltrace/graph/connection-const.h>
 #include <babeltrace/graph/notification-iterator.h>
 #include <babeltrace/graph/notification-iterator-internal.h>
 #include <babeltrace/object-internal.h>
diff --git a/include/babeltrace/graph/connection.h b/include/babeltrace/graph/connection.h
deleted file mode 100644 (file)
index c49de37..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef BABELTRACE_GRAPH_CONNECTION_H
-#define BABELTRACE_GRAPH_CONNECTION_H
-
-/*
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-/* For bt_bool */
-#include <babeltrace/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_port_input;
-struct bt_port_output;
-struct bt_connection;
-
-extern struct bt_port_input *bt_connection_borrow_downstream_port(
-               struct bt_connection *connection);
-
-extern struct bt_port_output *bt_connection_borrow_upstream_port(
-               struct bt_connection *connection);
-
-extern bt_bool bt_connection_is_ended(struct bt_connection *connection);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_CONNECTION_H */
diff --git a/include/babeltrace/graph/const-notification.h b/include/babeltrace/graph/const-notification.h
new file mode 100644 (file)
index 0000000..44c50d3
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef BABELTRACE_GRAPH_NOTIFICATION_CONST_H
+#define BABELTRACE_GRAPH_NOTIFICATION_CONST_H
+
+/*
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+
+typedef struct bt_notification **bt_notification_array;
+
+/**
+ * Notification types. Unhandled notification types should be ignored.
+ */
+enum bt_notification_type {
+       BT_NOTIFICATION_TYPE_EVENT =                    0,
+       BT_NOTIFICATION_TYPE_INACTIVITY =               1,
+       BT_NOTIFICATION_TYPE_STREAM_BEGIN =             2,
+       BT_NOTIFICATION_TYPE_STREAM_END =               3,
+       BT_NOTIFICATION_TYPE_PACKET_BEGIN =             4,
+       BT_NOTIFICATION_TYPE_PACKET_END =               5,
+};
+
+/**
+ * Get a notification's type.
+ *
+ * @param notification Notification instance
+ * @returns            One of #bt_notification_type
+ */
+extern enum bt_notification_type bt_notification_get_type(
+               const struct bt_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_NOTIFICATION_CONST_H */
diff --git a/include/babeltrace/graph/graph-const.h b/include/babeltrace/graph/graph-const.h
new file mode 100644 (file)
index 0000000..e2f24e0
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef BABELTRACE_GRAPH_GRAPH_CONST_H
+#define BABELTRACE_GRAPH_GRAPH_CONST_H
+
+/*
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+/* For bt_bool */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_graph;
+
+enum bt_graph_status {
+       BT_GRAPH_STATUS_OK = 0,
+       BT_GRAPH_STATUS_END = 1,
+       BT_GRAPH_STATUS_AGAIN = 11,
+       BT_GRAPH_STATUS_COMPONENT_REFUSES_PORT_CONNECTION = 111,
+       BT_GRAPH_STATUS_CANCELED = 125,
+       BT_GRAPH_STATUS_ERROR = -1,
+       BT_GRAPH_STATUS_NO_SINK = -6,
+       BT_GRAPH_STATUS_NOMEM = -12,
+};
+
+extern bt_bool bt_graph_is_canceled(const struct bt_graph *graph);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_GRAPH_CONST_H */
index 80a661b4fa711090ecc29fc3ccf77589b34bf881..cb2da872534672c01786ab8050b4c7d547f03686 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <babeltrace/graph/graph.h>
 #include <babeltrace/graph/connection-internal.h>
-#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-const.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/object-pool-internal.h>
index 440fe58b66222d56ae2efd132d21882d46e52031..57a394fd6313cc945a8ecf253695bdb463a898dd 100644 (file)
 /* For bt_bool */
 #include <babeltrace/types.h>
 
+/* For enum bt_graph_status */
+#include <babeltrace/graph/graph-const.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct bt_component;
+struct bt_component_class;
+struct bt_component_class_filter;
+struct bt_component_class_sink;
+struct bt_component_class_source;
+struct bt_component_filter;
+struct bt_component_sink;
+struct bt_component_source;
+struct bt_connection;
 struct bt_graph;
+struct bt_port_input;
+struct bt_port_output;
+struct bt_value;
+
+typedef void (*bt_graph_filter_component_input_port_added_listener_func)(
+               const struct bt_component_filter *component,
+               const struct bt_port_input *port, void *data);
+
+typedef void (*bt_graph_sink_component_input_port_added_listener_func)(
+               const struct bt_component_sink *component,
+               const struct bt_port_input *port, void *data);
+
+typedef void (*bt_graph_source_component_output_port_added_listener_func)(
+               const struct bt_component_source *component,
+               const struct bt_port_output *port, void *data);
+
+typedef void (*bt_graph_filter_component_output_port_added_listener_func)(
+               const struct bt_component_filter *component,
+               const struct bt_port_output *port, void *data);
+
+typedef void (*bt_graph_filter_component_input_port_removed_listener_func)(
+               const struct bt_component_filter *component,
+               const struct bt_port_input *port, void *data);
+
+typedef void (*bt_graph_sink_component_input_port_removed_listener_func)(
+               const struct bt_component_sink *component,
+               const struct bt_port_input *port, void *data);
+
+typedef void (*bt_graph_source_component_output_port_removed_listener_func)(
+               const struct bt_component_source *component,
+               const struct bt_port_output *port, void *data);
+
+typedef void (*bt_graph_filter_component_output_port_removed_listener_func)(
+               const struct bt_component_filter *component,
+               const struct bt_port_output *port, void *data);
+
+typedef void (*bt_graph_source_filter_component_ports_connected_listener_func)(
+               const struct bt_component_source *source_component,
+               const struct bt_component_filter *filter_component,
+               const struct bt_port_output *upstream_port,
+               const struct bt_port_input *downstream_port, void *data);
+
+typedef void (*bt_graph_source_sink_component_ports_connected_listener_func)(
+               const struct bt_component_source *source_component,
+               const struct bt_component_sink *sink_component,
+               const struct bt_port_output *upstream_port,
+               const struct bt_port_input *downstream_port, void *data);
+
+typedef void (*bt_graph_filter_sink_component_ports_connected_listener_func)(
+               const struct bt_component_filter *filter_component,
+               const struct bt_component_sink *sink_component,
+               const struct bt_port_output *upstream_port,
+               const struct bt_port_input *downstream_port, void *data);
+
+typedef void (*bt_graph_source_filter_component_ports_disconnected_listener_func)(
+               const struct bt_component_source *source_component,
+               const struct bt_component_filter *filter_component,
+               const struct bt_port_output *upstream_port,
+               const struct bt_port_input *downstream_port,
+               void *data);
+
+typedef void (*bt_graph_source_sink_component_ports_disconnected_listener_func)(
+               const struct bt_component_source *source_component,
+               const struct bt_component_sink *sink_component,
+               const struct bt_port_output *upstream_port,
+               const struct bt_port_input *downstream_port,
+               void *data);
+
+typedef void (*bt_graph_filter_sink_component_ports_disconnected_listener_func)(
+               const struct bt_component_filter *filter_component,
+               const struct bt_component_sink *sink_component,
+               const struct bt_port_output *upstream_port,
+               const struct bt_port_input *downstream_port,
+               void *data);
+
+typedef void (* bt_graph_listener_removed_func)(void *data);
+
+extern struct bt_graph *bt_graph_create(void);
+
+extern enum bt_graph_status bt_graph_add_source_component(
+               struct bt_graph *graph,
+               const struct bt_component_class_source *component_class,
+               const char *name, const struct bt_value *params,
+               const struct bt_component_source **component);
+
+extern enum bt_graph_status
+bt_graph_add_source_component_with_init_method_data(
+               struct bt_graph *graph,
+               const struct bt_component_class_source *component_class,
+               const char *name, const struct bt_value *params,
+               void *init_method_data,
+               const struct bt_component_source **component);
+
+extern enum bt_graph_status bt_graph_add_filter_component(
+               struct bt_graph *graph,
+               const struct bt_component_class_filter *component_class,
+               const char *name, const struct bt_value *params,
+               const struct bt_component_filter **component);
+
+extern enum bt_graph_status
+bt_graph_add_filter_component_with_init_method_data(
+               struct bt_graph *graph,
+               const struct bt_component_class_filter *component_class,
+               const char *name, const struct bt_value *params,
+               void *init_method_data,
+               const struct bt_component_filter **component);
+
+extern enum bt_graph_status bt_graph_add_sink_component(
+               struct bt_graph *graph,
+               const struct bt_component_class_sink *component_class,
+               const char *name, const struct bt_value *params,
+               const struct bt_component_sink **component);
+
+extern enum bt_graph_status
+bt_graph_add_sink_component_with_init_method_data(
+               struct bt_graph *graph,
+               const struct bt_component_class_sink *component_class,
+               const char *name, const struct bt_value *params,
+               void *init_method_data,
+               const struct bt_component_sink **component);
+
+extern enum bt_graph_status bt_graph_connect_ports(
+               struct bt_graph *graph,
+               const struct bt_port_output *upstream,
+               const struct bt_port_input *downstream,
+               const struct bt_connection **connection);
+
+extern enum bt_graph_status bt_graph_run(struct bt_graph *graph);
+
+extern enum bt_graph_status bt_graph_consume(
+               struct bt_graph *graph);
+
+extern enum bt_graph_status
+bt_graph_add_filter_component_input_port_added_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_component_input_port_added_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_sink_component_input_port_added_listener(
+               struct bt_graph *graph,
+               bt_graph_sink_component_input_port_added_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_source_component_output_port_added_listener(
+               struct bt_graph *graph,
+               bt_graph_source_component_output_port_added_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_filter_component_output_port_added_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_component_output_port_added_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_filter_component_input_port_removed_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_component_input_port_removed_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_sink_component_input_port_removed_listener(
+               struct bt_graph *graph,
+               bt_graph_sink_component_input_port_removed_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_source_component_output_port_removed_listener(
+               struct bt_graph *graph,
+               bt_graph_source_component_output_port_removed_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_filter_component_output_port_removed_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_component_output_port_removed_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_source_filter_component_ports_connected_listener(
+               struct bt_graph *graph,
+               bt_graph_source_filter_component_ports_connected_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_source_sink_component_ports_connected_listener(
+               struct bt_graph *graph,
+               bt_graph_source_sink_component_ports_connected_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_filter_sink_component_ports_connected_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_sink_component_ports_connected_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_source_filter_component_ports_disconnected_listener(
+               struct bt_graph *graph,
+               bt_graph_source_filter_component_ports_disconnected_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_source_sink_component_ports_disconnected_listener(
+               struct bt_graph *graph,
+               bt_graph_source_sink_component_ports_disconnected_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
+
+extern enum bt_graph_status
+bt_graph_add_filter_sink_component_ports_disconnected_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_sink_component_ports_disconnected_listener_func listener,
+               bt_graph_listener_removed_func listener_removed, void *data,
+               int *listener_id);
 
-enum bt_graph_status {
-       BT_GRAPH_STATUS_OK = 0,
-       BT_GRAPH_STATUS_END = 1,
-       BT_GRAPH_STATUS_AGAIN = 11,
-       BT_GRAPH_STATUS_COMPONENT_REFUSES_PORT_CONNECTION = 111,
-       BT_GRAPH_STATUS_CANCELED = 125,
-       BT_GRAPH_STATUS_ERROR = -1,
-       BT_GRAPH_STATUS_NO_SINK = -6,
-       BT_GRAPH_STATUS_NOMEM = -12,
-};
-
-extern bt_bool bt_graph_is_canceled(struct bt_graph *graph);
+extern enum bt_graph_status bt_graph_cancel(struct bt_graph *graph);
 
 #ifdef __cplusplus
 }
diff --git a/include/babeltrace/graph/notification-const.h b/include/babeltrace/graph/notification-const.h
new file mode 100644 (file)
index 0000000..4ab0bb9
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef BABELTRACE_GRAPH_NOTIFICATION_CONST_H
+#define BABELTRACE_GRAPH_NOTIFICATION_CONST_H
+
+/*
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+
+typedef const struct bt_notification **bt_notification_array_const;
+
+/**
+ * Notification types. Unhandled notification types should be ignored.
+ */
+enum bt_notification_type {
+       BT_NOTIFICATION_TYPE_EVENT =                    0,
+       BT_NOTIFICATION_TYPE_INACTIVITY =               1,
+       BT_NOTIFICATION_TYPE_STREAM_BEGIN =             2,
+       BT_NOTIFICATION_TYPE_STREAM_END =               3,
+       BT_NOTIFICATION_TYPE_PACKET_BEGIN =             4,
+       BT_NOTIFICATION_TYPE_PACKET_END =               5,
+};
+
+/**
+ * Get a notification's type.
+ *
+ * @param notification Notification instance
+ * @returns            One of #bt_notification_type
+ */
+extern enum bt_notification_type bt_notification_get_type(
+               const struct bt_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_NOTIFICATION_CONST_H */
diff --git a/include/babeltrace/graph/notification-event-const.h b/include/babeltrace/graph/notification-event-const.h
new file mode 100644 (file)
index 0000000..30edaf8
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef BABELTRACE_GRAPH_NOTIFICATION_EVENT_CONST_H
+#define BABELTRACE_GRAPH_NOTIFICATION_EVENT_CONST_H
+
+/*
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+struct bt_event;
+
+extern const struct bt_event *bt_notification_event_borrow_event_const(
+               const struct bt_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_NOTIFICATION_EVENT_CONST_H */
index 3bcc6c88284a590bcd435e213e7afd5ce82b7cfd..7fb9c0904ba5014e12b413771c689b2b89ec7460 100644 (file)
 extern "C" {
 #endif
 
-struct bt_notification;
+struct bt_self_notification_iterator;
 struct bt_event;
+struct bt_packet;
+struct bt_event_class;
 
-extern const struct bt_event *bt_notification_event_borrow_event(
+extern
+struct bt_notification *bt_notification_event_create(
+               struct bt_self_notification_iterator *notification_iterator,
+               struct bt_event_class *event_class,
+               struct bt_packet *packet);
+
+extern struct bt_event *bt_notification_event_borrow_event(
                struct bt_notification *notification);
 
 #ifdef __cplusplus
diff --git a/include/babeltrace/graph/notification-inactivity-const.h b/include/babeltrace/graph/notification-inactivity-const.h
new file mode 100644 (file)
index 0000000..11af899
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef BABELTRACE_GRAPH_NOTIFICATION_INACTIVITY_CONST_H
+#define BABELTRACE_GRAPH_NOTIFICATION_INACTIVITY_CONST_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+struct bt_clock_value;
+
+extern const struct bt_clock_value *
+bt_notification_inactivity_borrow_default_clock_value_const(
+               const struct bt_notification *notif);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_NOTIFICATION_INACTIVITY_CONST_H */
index 9a74e8fdb4446a5f8e1a742a37fbb3e34e1bf148..15bfbf2534d2b8f7a77cba81fd5f1aa0a9ba4c2a 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <glib.h>
 #include <babeltrace/trace-ir/clock-value-internal.h>
-#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-const.h>
 
 struct bt_notification_inactivity {
        struct bt_notification parent;
index 947634cfc71a2067fa828265ec22adfa1237c42a..c0c4938203173d27518bec25a8b16c353081767d 100644 (file)
  * SOFTWARE.
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct bt_notification;
-struct bt_clock_value;
+struct bt_self_notification_iterator;
+struct bt_clock_class;
+
+extern
+struct bt_notification *bt_notification_inactivity_create(
+               struct bt_self_notification_iterator *notification_iterator,
+               struct bt_clock_class *default_clock_class);
 
-extern struct bt_clock_value *bt_notification_inactivity_borrow_default_clock_value(
-               struct bt_notification *notif);
+extern void bt_notification_inactivity_set_default_clock_value(
+               struct bt_notification *notif, uint64_t raw_value);
 
 #ifdef __cplusplus
 }
index f776f5ec95c7023b050ae3aad9e7f823732a55a8..4ef04290bfed9a09bfa4020a859c1a68c2f73814 100644 (file)
@@ -29,7 +29,7 @@
 #include <babeltrace/object-internal.h>
 #include <babeltrace/assert-internal.h>
 #include <babeltrace/graph/graph.h>
-#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/notification-const.h>
 #include <babeltrace/trace-ir/stream.h>
 #include <babeltrace/object-pool-internal.h>
 #include <babeltrace/types.h>
index 28c3f8f4ead3439665a023b802b8f67a5d4b1692..5222b4ff1f6654cf6f67594c077aa25b9fd5aeec 100644 (file)
@@ -26,8 +26,8 @@
 
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/object-internal.h>
-#include <babeltrace/graph/connection.h>
-#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/connection-const.h>
+#include <babeltrace/graph/notification-const.h>
 #include <babeltrace/graph/notification-iterator.h>
 #include <babeltrace/types.h>
 #include <babeltrace/assert-internal.h>
diff --git a/include/babeltrace/graph/notification-packet-const.h b/include/babeltrace/graph/notification-packet-const.h
new file mode 100644 (file)
index 0000000..aa75c2f
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef BABELTRACE_GRAPH_NOTIFICATION_PACKET_CONST_H
+#define BABELTRACE_GRAPH_NOTIFICATION_PACKET_CONST_H
+
+/*
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+struct bt_packet;
+
+extern const struct bt_packet *bt_notification_packet_begin_borrow_packet_const(
+               const struct bt_notification *notification);
+
+extern const struct bt_packet *bt_notification_packet_end_borrow_packet_const(
+               const struct bt_notification *notification);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_NOTIFICATION_PACKET_CONST_H */
index a6d6c7fa015470909e622c62aac5214833e2a815..b56e9e7a112f97214f64203ec0107865cd057b0a 100644 (file)
@@ -30,12 +30,23 @@ extern "C" {
 #endif
 
 struct bt_notification;
+struct bt_self_notification_iterator;
 struct bt_packet;
 
-extern const struct bt_packet *bt_notification_packet_begin_borrow_packet(
+extern
+struct bt_notification *bt_notification_packet_begin_create(
+               struct bt_self_notification_iterator *notification_iterator,
+               struct bt_packet *packet);
+
+extern
+struct bt_notification *bt_notification_packet_end_create(
+               struct bt_self_notification_iterator *notification_iterator,
+               struct bt_packet *packet);
+
+extern struct bt_packet *bt_notification_packet_begin_borrow_packet(
                struct bt_notification *notification);
 
-extern const struct bt_packet *bt_notification_packet_end_borrow_packet(
+extern struct bt_packet *bt_notification_packet_end_borrow_packet(
                struct bt_notification *notification);
 
 #ifdef __cplusplus
diff --git a/include/babeltrace/graph/notification-stream-const.h b/include/babeltrace/graph/notification-stream-const.h
new file mode 100644 (file)
index 0000000..f0fd960
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef BABELTRACE_GRAPH_NOTIFICATION_STREAM_CONST_H
+#define BABELTRACE_GRAPH_NOTIFICATION_STREAM_CONST_H
+
+/*
+ * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_notification;
+struct bt_self_notification_iterator;
+struct bt_clock_value;
+struct bt_stream;
+
+extern const struct bt_stream *bt_notification_stream_begin_borrow_stream_const(
+               const struct bt_notification *notification);
+
+extern const struct bt_clock_value *
+bt_notification_stream_begin_borrow_default_clock_value_const(
+               const struct bt_notification *notif);
+
+extern const struct bt_stream *bt_notification_stream_end_borrow_stream_const(
+               const struct bt_notification *notification);
+
+extern const struct bt_clock_value *
+bt_notification_stream_end_borrow_default_clock_value_const(
+               const struct bt_notification *notif);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_NOTIFICATION_STREAM_CONST_H */
index 2dea094cf790135b9dc74cb7dd2fecf0d5f270de..2f98f82f00ae35df4b7fa4454fc8d6919030d248 100644 (file)
  * SOFTWARE.
  */
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct bt_notification;
 struct bt_self_notification_iterator;
-struct bt_clock_value;
 struct bt_stream;
 
-extern const struct bt_stream *bt_notification_stream_begin_borrow_stream(
+extern
+struct bt_notification *bt_notification_stream_begin_create(
+               struct bt_self_notification_iterator *notification_iterator,
+               struct bt_stream *stream);
+
+extern
+struct bt_notification *bt_notification_stream_end_create(
+               struct bt_self_notification_iterator *notification_iterator,
+               struct bt_stream *stream);
+
+extern struct bt_stream *bt_notification_stream_begin_borrow_stream(
                struct bt_notification *notification);
 
-extern const struct bt_clock_value *
-bt_notification_stream_begin_borrow_default_clock_value(
-               struct bt_notification *notif);
+extern void bt_notification_stream_begin_set_default_clock_value(
+               struct bt_notification *notif, uint64_t value_cycles);
 
-extern const struct bt_stream *bt_notification_stream_end_borrow_stream(
+extern struct bt_stream *bt_notification_stream_end_borrow_stream(
                struct bt_notification *notification);
 
-extern const struct bt_clock_value *
-bt_notification_stream_end_borrow_default_clock_value(
-               struct bt_notification *notif);
+extern void bt_notification_stream_end_set_default_clock_value(
+               struct bt_notification *notif, uint64_t value_cycles);
 
 #ifdef __cplusplus
 }
diff --git a/include/babeltrace/graph/notification.h b/include/babeltrace/graph/notification.h
deleted file mode 100644 (file)
index 658fe0e..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef BABELTRACE_GRAPH_NOTIFICATION_H
-#define BABELTRACE_GRAPH_NOTIFICATION_H
-
-/*
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_notification;
-
-typedef struct bt_notification **bt_notification_array;
-
-/**
- * Notification types. Unhandled notification types should be ignored.
- */
-enum bt_notification_type {
-       BT_NOTIFICATION_TYPE_EVENT =                    0,
-       BT_NOTIFICATION_TYPE_INACTIVITY =               1,
-       BT_NOTIFICATION_TYPE_STREAM_BEGIN =             2,
-       BT_NOTIFICATION_TYPE_STREAM_END =               3,
-       BT_NOTIFICATION_TYPE_PACKET_BEGIN =             4,
-       BT_NOTIFICATION_TYPE_PACKET_END =               5,
-};
-
-/**
- * Get a notification's type.
- *
- * @param notification Notification instance
- * @returns            One of #bt_notification_type
- */
-extern enum bt_notification_type bt_notification_get_type(
-               struct bt_notification *notification);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_NOTIFICATION_H */
diff --git a/include/babeltrace/graph/port-const.h b/include/babeltrace/graph/port-const.h
new file mode 100644 (file)
index 0000000..eb3e932
--- /dev/null
@@ -0,0 +1,74 @@
+#ifndef BABELTRACE_GRAPH_PORT_CONST_H
+#define BABELTRACE_GRAPH_PORT_CONST_H
+
+/*
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#include <stdint.h>
+
+/* For bt_bool */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_port;
+struct bt_connection;
+struct bt_component;
+
+enum bt_port_type {
+       BT_PORT_TYPE_INPUT = 0,
+       BT_PORT_TYPE_OUTPUT = 1,
+};
+
+extern const char *bt_port_get_name(const struct bt_port *port);
+
+extern enum bt_port_type bt_port_get_type(const struct bt_port *port);
+
+extern const struct bt_connection *bt_port_borrow_connection_const(
+               const struct bt_port *port);
+
+extern const struct bt_component *bt_port_borrow_component_const(
+               const struct bt_port *port);
+
+extern bt_bool bt_port_is_connected(const struct bt_port *port);
+
+static inline
+bt_bool bt_port_is_input(const struct bt_port *port)
+{
+       return bt_port_get_type(port) == BT_PORT_TYPE_INPUT;
+}
+
+static inline
+bt_bool bt_port_is_output(const struct bt_port *port)
+{
+       return bt_port_get_type(port) == BT_PORT_TYPE_OUTPUT;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PORT_CONST_H */
diff --git a/include/babeltrace/graph/port-input-const.h b/include/babeltrace/graph/port-input-const.h
new file mode 100644 (file)
index 0000000..85a201d
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef BABELTRACE_GRAPH_PORT_INPUT_CONST_H
+#define BABELTRACE_GRAPH_PORT_INPUT_CONST_H
+
+/*
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_port;
+struct bt_port_input;
+
+static inline
+const struct bt_port *bt_port_input_as_port_const(
+               const struct bt_port_input *port_input)
+{
+       return (const void *) port_input;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PORT_INPUT_CONST_H */
diff --git a/include/babeltrace/graph/port-input.h b/include/babeltrace/graph/port-input.h
deleted file mode 100644 (file)
index 9e55f82..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PORT_INPUT_H
-#define BABELTRACE_GRAPH_PORT_INPUT_H
-
-/*
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_port;
-struct bt_port_input;
-
-static inline
-struct bt_port *bt_port_input_as_port(struct bt_port_input *port_input)
-{
-       return (void *) port_input;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PORT_INPUT_H */
index 2a681dda069922c906b3f7fbc2d9823849951fb3..d7a48e7331a05edb816177b1619048e546f14c1c 100644 (file)
@@ -25,7 +25,7 @@
  * SOFTWARE.
  */
 
-#include <babeltrace/graph/port.h>
+#include <babeltrace/graph/port-const.h>
 
 struct bt_port {
        struct bt_object base;
@@ -35,6 +35,8 @@ struct bt_port {
        void *user_data;
 };
 
+struct bt_component;
+
 BT_HIDDEN
 struct bt_port *bt_port_create(struct bt_component *parent_component,
                enum bt_port_type type, const char *name, void *user_data);
@@ -43,6 +45,13 @@ BT_HIDDEN
 void bt_port_set_connection(struct bt_port *port,
                struct bt_connection *connection);
 
+static inline
+struct bt_component *bt_port_borrow_component_inline(const struct bt_port *port)
+{
+       BT_ASSERT(port);
+       return (void *) bt_object_borrow_parent(&port->base);
+}
+
 static inline
 const char *bt_port_type_string(enum bt_port_type port_type)
 {
diff --git a/include/babeltrace/graph/port-output-const.h b/include/babeltrace/graph/port-output-const.h
new file mode 100644 (file)
index 0000000..4d44914
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef BABELTRACE_GRAPH_PORT_OUTPUT_CONST_H
+#define BABELTRACE_GRAPH_PORT_OUTPUT_CONST_H
+
+/*
+ * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ *
+ * Author: 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.
+ */
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_port;
+struct bt_port_output;
+
+static inline
+const struct bt_port *bt_port_output_as_port_const(
+               const struct bt_port_output *port_output)
+{
+       return (const void *) port_output;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PORT_OUTPUT_CONST_H */
index ddfb3f912ffbcce9cb9a30236eeabb77cf70264b..edf0da0ae6543fb39c53d690af9593d320e48d6f 100644 (file)
@@ -28,8 +28,8 @@
 /* For enum bt_notification_iterator_status */
 #include <babeltrace/graph/notification-iterator.h>
 
-/* For bt_notification_array */
-#include <babeltrace/graph/notification.h>
+/* For bt_notification_array_const */
+#include <babeltrace/graph/notification-const.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -39,7 +39,7 @@ struct bt_port;
 struct bt_notification;
 struct bt_notification_iterator;
 struct bt_port_output_notification_iterator;
-struct bt_private_graph;
+struct bt_graph;
 struct bt_port_output;
 
 static inline
@@ -50,14 +50,15 @@ bt_port_output_notification_iterator_as_notification_iterator(
        return (void *) iterator;
 }
 
-extern struct bt_port_output_notification_iterator *bt_port_output_notification_iterator_create(
-               struct bt_private_graph *graph,
-               struct bt_port_output *output_port);
+extern struct bt_port_output_notification_iterator *
+bt_port_output_notification_iterator_create(
+               struct bt_graph *graph,
+               const struct bt_port_output *output_port);
 
 extern enum bt_notification_iterator_status
 bt_port_output_notification_iterator_next(
                struct bt_port_output_notification_iterator *iterator,
-               bt_notification_array *notifs, uint64_t *count);
+               bt_notification_array_const *notifs, uint64_t *count);
 
 #ifdef __cplusplus
 }
diff --git a/include/babeltrace/graph/port-output.h b/include/babeltrace/graph/port-output.h
deleted file mode 100644 (file)
index 986abb9..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PORT_OUTPUT_H
-#define BABELTRACE_GRAPH_PORT_OUTPUT_H
-
-/*
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_port;
-struct bt_port_output;
-
-static inline
-struct bt_port *bt_port_output_as_port(struct bt_port_output *port_output)
-{
-       return (void *) port_output;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PORT_OUTPUT_H */
diff --git a/include/babeltrace/graph/port.h b/include/babeltrace/graph/port.h
deleted file mode 100644 (file)
index c70ca5e..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PORT_H
-#define BABELTRACE_GRAPH_PORT_H
-
-/*
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#include <stdint.h>
-
-/* For bt_bool */
-#include <babeltrace/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_port;
-struct bt_connection;
-struct bt_component;
-
-enum bt_port_type {
-       BT_PORT_TYPE_INPUT = 0,
-       BT_PORT_TYPE_OUTPUT = 1,
-};
-
-extern const char *bt_port_get_name(struct bt_port *port);
-
-extern enum bt_port_type bt_port_get_type(struct bt_port *port);
-
-extern struct bt_connection *bt_port_borrow_connection(struct bt_port *port);
-
-extern struct bt_component *bt_port_borrow_component(struct bt_port *port);
-
-extern bt_bool bt_port_is_connected(struct bt_port *port);
-
-static inline
-bt_bool bt_port_is_input(struct bt_port *port)
-{
-       return bt_port_get_type(port) == BT_PORT_TYPE_INPUT;
-}
-
-static inline
-bt_bool bt_port_is_output(struct bt_port *port)
-{
-       return bt_port_get_type(port) == BT_PORT_TYPE_OUTPUT;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PORT_H */
diff --git a/include/babeltrace/graph/private-component-class-filter.h b/include/babeltrace/graph/private-component-class-filter.h
deleted file mode 100644 (file)
index 01e6cc8..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H
-#define BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H
-
-/*
- * 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.
- */
-
-#include <stdint.h>
-
-/* For enum bt_notification_array */
-#include <babeltrace/graph/notification.h>
-
-/* For enum bt_self_component_status */
-#include <babeltrace/graph/self-component.h>
-
-
-/* For enum bt_self_notification_iterator_status */
-#include <babeltrace/graph/self-notification-iterator.h>
-
-/* For enum bt_query_status */
-#include <babeltrace/graph/private-component-class.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_self_component_class_filter;
-struct bt_component_class_filter;
-struct bt_self_component_filter;
-struct bt_private_component_class;
-struct bt_private_component_class_filter;
-struct bt_self_component_port_input;
-struct bt_self_component_port_output;
-struct bt_port_input;
-struct bt_port_output;
-struct bt_query_executor;
-struct bt_value;
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_filter_init_method)(
-               struct bt_self_component_filter *self_component,
-               const struct bt_value *params, void *init_method_data);
-
-typedef void (*bt_private_component_class_filter_finalize_method)(
-               struct bt_self_component_filter *self_component);
-
-typedef enum bt_self_notification_iterator_status
-(*bt_private_component_class_filter_notification_iterator_init_method)(
-               struct bt_self_notification_iterator *notification_iterator,
-               struct bt_self_component_filter *self_component,
-               struct bt_self_component_port_output *port);
-
-typedef void
-(*bt_private_component_class_filter_notification_iterator_finalize_method)(
-               struct bt_self_notification_iterator *notification_iterator);
-
-typedef enum bt_self_notification_iterator_status
-(*bt_private_component_class_filter_notification_iterator_next_method)(
-               struct bt_self_notification_iterator *notification_iterator,
-               bt_notification_array notifs, uint64_t capacity,
-               uint64_t *count);
-
-typedef enum bt_query_status
-(*bt_private_component_class_filter_query_method)(
-               struct bt_self_component_class_filter *comp_class,
-               struct bt_query_executor *query_executor,
-               const char *object, const struct bt_value *params,
-               const struct bt_value **result);
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_filter_accept_input_port_connection_method)(
-               struct bt_self_component_filter *self_component,
-               struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port);
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_filter_accept_output_port_connection_method)(
-               struct bt_self_component_filter *self_component,
-               struct bt_self_component_port_output *self_port,
-               struct bt_port_input *other_port);
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_filter_input_port_connected_method)(
-               struct bt_self_component_filter *self_component,
-               struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port);
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_filter_output_port_connected_method)(
-               struct bt_self_component_filter *self_component,
-               struct bt_self_component_port_output *self_port,
-               struct bt_port_input *other_port);
-
-typedef void
-(*bt_private_component_class_filter_input_port_disconnected_method)(
-               struct bt_self_component_filter *self_component,
-               struct bt_self_component_port_input *self_port);
-
-typedef void
-(*bt_private_component_class_filter_output_port_disconnected_method)(
-               struct bt_self_component_filter *self_component,
-               struct bt_self_component_port_output *self_port);
-
-static inline
-struct bt_private_component_class *
-bt_private_component_class_filter_as_private_component_class(
-               struct bt_private_component_class_filter *priv_comp_cls_filter)
-{
-       return (void *) priv_comp_cls_filter;
-}
-
-static inline
-struct bt_component_class_filter *
-bt_private_component_class_filter_as_component_class_filter(
-               struct bt_private_component_class_filter *priv_comp_cls_filter)
-{
-       return (void *) priv_comp_cls_filter;
-}
-
-extern
-struct bt_private_component_class_filter *
-bt_private_component_class_filter_create(
-               const char *name,
-               bt_private_component_class_filter_notification_iterator_next_method method);
-
-extern int bt_private_component_class_filter_set_init_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_init_method method);
-
-extern int bt_private_component_class_filter_set_finalize_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_finalize_method method);
-
-extern int bt_private_component_class_filter_set_accept_input_port_connection_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_accept_input_port_connection_method method);
-
-extern int bt_private_component_class_filter_set_accept_output_port_connection_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_accept_output_port_connection_method method);
-
-extern int bt_private_component_class_filter_set_input_port_connected_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_input_port_connected_method method);
-
-extern int bt_private_component_class_filter_set_output_port_connected_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_output_port_connected_method method);
-
-extern int bt_private_component_class_filter_set_input_port_disconnected_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_input_port_disconnected_method method);
-
-extern int bt_private_component_class_filter_set_output_port_disconnected_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_output_port_disconnected_method method);
-
-extern int bt_private_component_class_filter_set_query_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_query_method method);
-
-extern int bt_private_component_class_filter_set_notification_iterator_init_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_notification_iterator_init_method method);
-
-extern int bt_private_component_class_filter_set_notification_iterator_finalize_method(
-               struct bt_private_component_class_filter *comp_class,
-               bt_private_component_class_filter_notification_iterator_finalize_method method);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H */
diff --git a/include/babeltrace/graph/private-component-class-sink.h b/include/babeltrace/graph/private-component-class-sink.h
deleted file mode 100644 (file)
index 02bc66c..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SINK_H
-#define BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SINK_H
-
-/*
- * 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.
- */
-
-#include <stdint.h>
-
-/* For enum bt_notification_array */
-#include <babeltrace/graph/notification.h>
-
-/* For enum bt_self_component_status */
-#include <babeltrace/graph/self-component.h>
-
-/* For enum bt_query_status */
-#include <babeltrace/graph/private-component-class.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_self_component_class_sink;
-struct bt_component_class_sink;
-struct bt_self_component_sink;
-struct bt_private_component_class;
-struct bt_private_component_class_sink;
-struct bt_self_component_port_input;
-struct bt_port_output;
-struct bt_query_executor;
-struct bt_value;
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_sink_init_method)(
-               struct bt_self_component_sink *self_component,
-               const struct bt_value *params, void *init_method_data);
-
-typedef void (*bt_private_component_class_sink_finalize_method)(
-               struct bt_self_component_sink *self_component);
-
-typedef enum bt_query_status
-(*bt_private_component_class_sink_query_method)(
-               struct bt_self_component_class_sink *comp_class,
-               struct bt_query_executor *query_executor,
-               const char *object, const struct bt_value *params,
-               const struct bt_value **result);
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_sink_accept_input_port_connection_method)(
-               struct bt_self_component_sink *self_component,
-               struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port);
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_sink_input_port_connected_method)(
-               struct bt_self_component_sink *self_component,
-               struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port);
-
-typedef void
-(*bt_private_component_class_sink_input_port_disconnected_method)(
-               struct bt_self_component_sink *self_component,
-               struct bt_self_component_port_input *self_port);
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_sink_consume_method)(
-       struct bt_self_component_sink *self_component);
-
-static inline
-struct bt_private_component_class *
-bt_private_component_class_sink_as_private_component_class(
-               struct bt_private_component_class_sink *priv_comp_cls_sink)
-{
-       return (void *) priv_comp_cls_sink;
-}
-
-static inline
-struct bt_component_class_sink *
-bt_private_component_class_sink_as_component_class_sink(
-               struct bt_private_component_class_sink *priv_comp_cls_sink)
-{
-       return (void *) priv_comp_cls_sink;
-}
-
-extern
-struct bt_private_component_class_sink *bt_private_component_class_sink_create(
-               const char *name,
-               bt_private_component_class_sink_consume_method method);
-
-extern int bt_private_component_class_sink_set_init_method(
-               struct bt_private_component_class_sink *comp_class,
-               bt_private_component_class_sink_init_method method);
-
-extern int bt_private_component_class_sink_set_finalize_method(
-               struct bt_private_component_class_sink *comp_class,
-               bt_private_component_class_sink_finalize_method method);
-
-extern int bt_private_component_class_sink_set_accept_input_port_connection_method(
-               struct bt_private_component_class_sink *comp_class,
-               bt_private_component_class_sink_accept_input_port_connection_method method);
-
-extern int bt_private_component_class_sink_set_input_port_connected_method(
-               struct bt_private_component_class_sink *comp_class,
-               bt_private_component_class_sink_input_port_connected_method method);
-
-extern int bt_private_component_class_sink_set_input_port_disconnected_method(
-               struct bt_private_component_class_sink *comp_class,
-               bt_private_component_class_sink_input_port_disconnected_method method);
-
-extern int bt_private_component_class_sink_set_query_method(
-               struct bt_private_component_class_sink *comp_class,
-               bt_private_component_class_sink_query_method method);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SINK_H */
diff --git a/include/babeltrace/graph/private-component-class-source.h b/include/babeltrace/graph/private-component-class-source.h
deleted file mode 100644 (file)
index 8fdaa3f..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SOURCE_H
-#define BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SOURCE_H
-
-/*
- * 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.
- */
-
-#include <stdint.h>
-
-/* For enum bt_notification_array */
-#include <babeltrace/graph/notification.h>
-
-/* For enum bt_self_component_status */
-#include <babeltrace/graph/self-component.h>
-
-/* For enum bt_self_notification_iterator_status */
-#include <babeltrace/graph/self-notification-iterator.h>
-
-/* For enum bt_query_status */
-#include <babeltrace/graph/private-component-class.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_self_component_class_source;
-struct bt_component_class_source;
-struct bt_self_component_source;
-struct bt_private_component_class;
-struct bt_private_component_class_source;
-struct bt_self_component_port_output;
-struct bt_port_input;
-struct bt_query_executor;
-struct bt_value;
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_source_init_method)(
-               struct bt_self_component_source *self_component,
-               const struct bt_value *params, void *init_method_data);
-
-typedef void (*bt_private_component_class_source_finalize_method)(
-               struct bt_self_component_source *self_component);
-
-typedef enum bt_self_notification_iterator_status
-(*bt_private_component_class_source_notification_iterator_init_method)(
-               struct bt_self_notification_iterator *notification_iterator,
-               struct bt_self_component_source *self_component,
-               struct bt_self_component_port_output *port);
-
-typedef void
-(*bt_private_component_class_source_notification_iterator_finalize_method)(
-               struct bt_self_notification_iterator *notification_iterator);
-
-typedef enum bt_self_notification_iterator_status
-(*bt_private_component_class_source_notification_iterator_next_method)(
-               struct bt_self_notification_iterator *notification_iterator,
-               bt_notification_array notifs, uint64_t capacity,
-               uint64_t *count);
-
-typedef enum bt_query_status
-(*bt_private_component_class_source_query_method)(
-               struct bt_self_component_class_source *comp_class,
-               struct bt_query_executor *query_executor,
-               const char *object, const struct bt_value *params,
-               const struct bt_value **result);
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_source_accept_output_port_connection_method)(
-               struct bt_self_component_source *self_component,
-               struct bt_self_component_port_output *self_port,
-               struct bt_port_input *other_port);
-
-typedef enum bt_self_component_status
-(*bt_private_component_class_source_output_port_connected_method)(
-               struct bt_self_component_source *self_component,
-               struct bt_self_component_port_output *self_port,
-               struct bt_port_input *other_port);
-
-typedef void
-(*bt_private_component_class_source_output_port_disconnected_method)(
-               struct bt_self_component_source *self_component,
-               struct bt_self_component_port_output *self_port);
-
-static inline
-struct bt_private_component_class *
-bt_private_component_class_source_as_private_component_class(
-               struct bt_private_component_class_source *priv_comp_cls_source)
-{
-       return (void *) priv_comp_cls_source;
-}
-
-static inline
-struct bt_component_class_source *
-bt_private_component_class_source_as_component_class_source(
-               struct bt_private_component_class_source *priv_comp_cls_source)
-{
-       return (void *) priv_comp_cls_source;
-}
-
-extern
-struct bt_private_component_class_source *
-bt_private_component_class_source_create(
-               const char *name,
-               bt_private_component_class_source_notification_iterator_next_method method);
-
-extern int bt_private_component_class_source_set_init_method(
-               struct bt_private_component_class_source *comp_class,
-               bt_private_component_class_source_init_method method);
-
-extern int bt_private_component_class_source_set_finalize_method(
-               struct bt_private_component_class_source *comp_class,
-               bt_private_component_class_source_finalize_method method);
-
-extern int bt_private_component_class_source_set_accept_output_port_connection_method(
-               struct bt_private_component_class_source *comp_class,
-               bt_private_component_class_source_accept_output_port_connection_method method);
-
-extern int bt_private_component_class_source_set_output_port_connected_method(
-               struct bt_private_component_class_source *comp_class,
-               bt_private_component_class_source_output_port_connected_method method);
-
-extern int bt_private_component_class_source_set_output_port_disconnected_method(
-               struct bt_private_component_class_source *comp_class,
-               bt_private_component_class_source_output_port_disconnected_method method);
-
-extern int bt_private_component_class_source_set_query_method(
-               struct bt_private_component_class_source *comp_class,
-               bt_private_component_class_source_query_method method);
-
-extern int bt_private_component_class_source_set_notification_iterator_init_method(
-               struct bt_private_component_class_source *comp_class,
-               bt_private_component_class_source_notification_iterator_init_method method);
-
-extern int bt_private_component_class_source_set_notification_iterator_finalize_method(
-               struct bt_private_component_class_source *comp_class,
-               bt_private_component_class_source_notification_iterator_finalize_method method);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_SOURCE_H */
diff --git a/include/babeltrace/graph/private-component-class.h b/include/babeltrace/graph/private-component-class.h
deleted file mode 100644 (file)
index 804f21e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_H
-#define BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_H
-
-/*
- * 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.
- */
-
-/* For enum bt_query_executor_status */
-#include <babeltrace/graph/query-executor.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_component_class;
-struct bt_private_component_class;
-
-enum bt_query_status {
-       BT_QUERY_STATUS_OK = BT_QUERY_EXECUTOR_STATUS_OK,
-       BT_QUERY_STATUS_AGAIN = BT_QUERY_EXECUTOR_STATUS_AGAIN,
-       BT_QUERY_STATUS_ERROR = BT_QUERY_EXECUTOR_STATUS_ERROR,
-       BT_QUERY_STATUS_NOMEM = BT_QUERY_EXECUTOR_STATUS_NOMEM,
-       BT_QUERY_STATUS_INVALID_OBJECT = BT_QUERY_EXECUTOR_STATUS_INVALID_OBJECT,
-       BT_QUERY_STATUS_INVALID_PARAMS = BT_QUERY_EXECUTOR_STATUS_INVALID_PARAMS,
-};
-
-static inline
-struct bt_component_class *
-bt_private_component_class_as_component_class(
-               struct bt_private_component_class *priv_comp_cls)
-{
-       return (void *) priv_comp_cls;
-}
-
-extern int bt_private_component_class_set_description(
-               struct bt_private_component_class *component_class,
-               const char *description);
-
-extern int bt_private_component_class_set_help(
-               struct bt_private_component_class *component_class,
-               const char *help);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_H */
diff --git a/include/babeltrace/graph/private-graph.h b/include/babeltrace/graph/private-graph.h
deleted file mode 100644 (file)
index 8d2866e..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_GRAPH_H
-#define BABELTRACE_GRAPH_PRIVATE_GRAPH_H
-
-/*
- * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-/* For bt_bool */
-#include <babeltrace/types.h>
-
-/* For enum bt_graph_status */
-#include <babeltrace/graph/graph.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_graph;
-struct bt_private_graph;
-struct bt_port_input;
-struct bt_port_output;
-struct bt_connection;
-struct bt_component;
-struct bt_component_source;
-struct bt_component_filter;
-struct bt_component_sink;
-struct bt_component_class;
-struct bt_value;
-
-typedef void (*bt_private_graph_filter_component_input_port_added_listener)(
-               struct bt_component_filter *component,
-               struct bt_port_input *port, void *data);
-
-typedef void (*bt_private_graph_sink_component_input_port_added_listener)(
-               struct bt_component_sink *component,
-               struct bt_port_input *port, void *data);
-
-typedef void (*bt_private_graph_source_component_output_port_added_listener)(
-               struct bt_component_source *component,
-               struct bt_port_output *port, void *data);
-
-typedef void (*bt_private_graph_filter_component_output_port_added_listener)(
-               struct bt_component_filter *component,
-               struct bt_port_output *port, void *data);
-
-typedef void (*bt_private_graph_filter_component_input_port_removed_listener)(
-               struct bt_component_filter *component,
-               struct bt_port_input *port, void *data);
-
-typedef void (*bt_private_graph_sink_component_input_port_removed_listener)(
-               struct bt_component_sink *component,
-               struct bt_port_input *port, void *data);
-
-typedef void (*bt_private_graph_source_component_output_port_removed_listener)(
-               struct bt_component_source *component,
-               struct bt_port_output *port, void *data);
-
-typedef void (*bt_private_graph_filter_component_output_port_removed_listener)(
-               struct bt_component_filter *component,
-               struct bt_port_output *port, void *data);
-
-typedef void (*bt_private_graph_source_filter_component_ports_connected_listener)(
-               struct bt_component_source *source_component,
-               struct bt_component_filter *filter_component,
-               struct bt_port_output *upstream_port,
-               struct bt_port_input *downstream_port, void *data);
-
-typedef void (*bt_private_graph_source_sink_component_ports_connected_listener)(
-               struct bt_component_source *source_component,
-               struct bt_component_sink *sink_component,
-               struct bt_port_output *upstream_port,
-               struct bt_port_input *downstream_port, void *data);
-
-typedef void (*bt_private_graph_filter_sink_component_ports_connected_listener)(
-               struct bt_component_filter *filter_component,
-               struct bt_component_sink *sink_component,
-               struct bt_port_output *upstream_port,
-               struct bt_port_input *downstream_port, void *data);
-
-typedef void (*bt_private_graph_source_filter_component_ports_disconnected_listener)(
-               struct bt_component_source *source_component,
-               struct bt_component_filter *filter_component,
-               struct bt_port_output *upstream_port,
-               struct bt_port_input *downstream_port,
-               void *data);
-
-typedef void (*bt_private_graph_source_sink_component_ports_disconnected_listener)(
-               struct bt_component_source *source_component,
-               struct bt_component_sink *sink_component,
-               struct bt_port_output *upstream_port,
-               struct bt_port_input *downstream_port,
-               void *data);
-
-typedef void (*bt_private_graph_filter_sink_component_ports_disconnected_listener)(
-               struct bt_component_filter *filter_component,
-               struct bt_component_sink *sink_component,
-               struct bt_port_output *upstream_port,
-               struct bt_port_input *downstream_port,
-               void *data);
-
-typedef void (* bt_private_graph_listener_removed)(void *data);
-
-static inline
-struct bt_graph *bt_private_graph_as_graph(struct bt_private_graph *graph)
-{
-       return (void *) graph;
-}
-
-extern struct bt_private_graph *bt_private_graph_create(void);
-
-extern enum bt_graph_status bt_private_graph_add_source_component(
-               struct bt_private_graph *graph,
-               struct bt_component_class_source *component_class,
-               const char *name, const struct bt_value *params,
-               struct bt_component_source **component);
-
-extern enum bt_graph_status
-bt_private_graph_add_source_component_with_init_method_data(
-               struct bt_private_graph *graph,
-               struct bt_component_class_source *component_class,
-               const char *name, const struct bt_value *params,
-               void *init_method_data, struct bt_component_source **component);
-
-extern enum bt_graph_status bt_private_graph_add_filter_component(
-               struct bt_private_graph *graph,
-               struct bt_component_class_filter *component_class,
-               const char *name, const struct bt_value *params,
-               struct bt_component_filter **component);
-
-extern enum bt_graph_status
-bt_private_graph_add_filter_component_with_init_method_data(
-               struct bt_private_graph *graph,
-               struct bt_component_class_filter *component_class,
-               const char *name, const struct bt_value *params,
-               void *init_method_data, struct bt_component_filter **component);
-
-extern enum bt_graph_status bt_private_graph_add_sink_component(
-               struct bt_private_graph *graph,
-               struct bt_component_class_sink *component_class,
-               const char *name, const struct bt_value *params,
-               struct bt_component_sink **component);
-
-extern enum bt_graph_status
-bt_private_graph_add_sink_component_with_init_method_data(
-               struct bt_private_graph *graph,
-               struct bt_component_class_sink *component_class,
-               const char *name, const struct bt_value *params,
-               void *init_method_data, struct bt_component_sink **component);
-
-extern enum bt_graph_status bt_private_graph_connect_ports(
-               struct bt_private_graph *graph,
-               struct bt_port_output *upstream,
-               struct bt_port_input *downstream,
-               struct bt_connection **connection);
-
-extern enum bt_graph_status bt_private_graph_run(
-               struct bt_private_graph *graph);
-
-extern enum bt_graph_status bt_private_graph_consume(
-               struct bt_private_graph *graph);
-
-extern enum bt_graph_status
-bt_private_graph_add_filter_component_input_port_added_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_filter_component_input_port_added_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_sink_component_input_port_added_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_sink_component_input_port_added_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_source_component_output_port_added_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_source_component_output_port_added_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_filter_component_output_port_added_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_filter_component_output_port_added_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_filter_component_input_port_removed_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_filter_component_input_port_removed_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_sink_component_input_port_removed_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_sink_component_input_port_removed_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_source_component_output_port_removed_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_source_component_output_port_removed_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_filter_component_output_port_removed_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_filter_component_output_port_removed_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_source_filter_component_ports_connected_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_source_filter_component_ports_connected_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_source_sink_component_ports_connected_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_source_sink_component_ports_connected_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_filter_sink_component_ports_connected_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_filter_sink_component_ports_connected_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_source_filter_component_ports_disconnected_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_source_filter_component_ports_disconnected_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_source_sink_component_ports_disconnected_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_source_sink_component_ports_disconnected_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status
-bt_private_graph_add_filter_sink_component_ports_disconnected_listener(
-               struct bt_private_graph *graph,
-               bt_private_graph_filter_sink_component_ports_disconnected_listener listener,
-               bt_private_graph_listener_removed listener_removed, void *data,
-               int *listener_id);
-
-extern enum bt_graph_status bt_private_graph_cancel(
-               struct bt_private_graph *graph);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_GRAPH_H */
diff --git a/include/babeltrace/graph/private-notification-event.h b/include/babeltrace/graph/private-notification-event.h
deleted file mode 100644 (file)
index 6051286..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_EVENT_H
-#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_EVENT_H
-
-/*
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_private_notification;
-struct bt_self_notification_iterator;
-struct bt_event;
-struct bt_packet;
-struct bt_event_class;
-
-extern
-struct bt_private_notification *bt_private_notification_event_create(
-               struct bt_self_notification_iterator *notification_iterator,
-               struct bt_event_class *event_class,
-               struct bt_packet *packet);
-
-extern struct bt_event *
-bt_private_notification_event_borrow_event(
-               struct bt_private_notification *notification);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_EVENT_H */
diff --git a/include/babeltrace/graph/private-notification-inactivity.h b/include/babeltrace/graph/private-notification-inactivity.h
deleted file mode 100644 (file)
index 5649ffc..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_INACTIVITY_H
-#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_INACTIVITY_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@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.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_private_notification;
-struct bt_self_notification_iterator;
-struct bt_clock_class;
-
-extern
-struct bt_private_notification *bt_private_notification_inactivity_create(
-               struct bt_self_notification_iterator *notification_iterator,
-               struct bt_clock_class *default_clock_class);
-
-extern void bt_private_notification_inactivity_set_default_clock_value(
-               struct bt_private_notification *notif, uint64_t raw_value);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_INACTIVITY_H */
diff --git a/include/babeltrace/graph/private-notification-packet.h b/include/babeltrace/graph/private-notification-packet.h
deleted file mode 100644 (file)
index e895255..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_PACKET_H
-#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_PACKET_H
-
-/*
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_private_notification;
-struct bt_self_notification_iterator;
-struct bt_packet;
-
-extern
-struct bt_private_notification *bt_private_notification_packet_begin_create(
-               struct bt_self_notification_iterator *notification_iterator,
-               struct bt_packet *packet);
-
-extern
-struct bt_private_notification *bt_private_notification_packet_end_create(
-               struct bt_self_notification_iterator *notification_iterator,
-               struct bt_packet *packet);
-
-extern struct bt_packet *
-bt_private_notification_packet_begin_borrow_packet(
-               struct bt_private_notification *notification);
-
-extern struct bt_packet *
-bt_private_notification_packet_end_borrow_packet(
-               struct bt_private_notification *notification);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_PACKET_H */
diff --git a/include/babeltrace/graph/private-notification-stream.h b/include/babeltrace/graph/private-notification-stream.h
deleted file mode 100644 (file)
index 4274bbd..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_STREAM_H
-#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_STREAM_H
-
-/*
- * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_private_notification;
-struct bt_self_notification_iterator;
-struct bt_stream;
-
-extern
-struct bt_private_notification *bt_private_notification_stream_begin_create(
-               struct bt_self_notification_iterator *notification_iterator,
-               struct bt_stream *stream);
-
-extern
-struct bt_private_notification *bt_private_notification_stream_end_create(
-               struct bt_self_notification_iterator *notification_iterator,
-               struct bt_stream *stream);
-
-extern struct bt_stream *
-bt_private_notification_stream_begin_borrow_stream(
-               struct bt_private_notification *notification);
-
-extern void bt_private_notification_stream_begin_set_default_clock_value(
-               struct bt_private_notification *notif, uint64_t value_cycles);
-
-extern struct bt_stream *
-bt_private_notification_stream_end_borrow_stream(
-               struct bt_private_notification *notification);
-
-extern void bt_private_notification_stream_end_set_default_clock_value(
-               struct bt_private_notification *notif, uint64_t value_cycles);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_STREAM_H */
diff --git a/include/babeltrace/graph/private-notification.h b/include/babeltrace/graph/private-notification.h
deleted file mode 100644 (file)
index 3833d63..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_H
-#define BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_H
-
-/*
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: 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.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_notification;
-struct bt_private_notification;
-
-static inline
-struct bt_notification *bt_private_notification_as_notification(
-               struct bt_private_notification *notification)
-{
-       return (void *) notification;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_NOTIFICATION_H */
diff --git a/include/babeltrace/graph/private-query-executor.h b/include/babeltrace/graph/private-query-executor.h
deleted file mode 100644 (file)
index a573020..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef BABELTRACE_GRAPH_PRIVATE_QUERY_EXECUTOR_H
-#define BABELTRACE_GRAPH_PRIVATE_QUERY_EXECUTOR_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@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.
- */
-
-/* For enum bt_query_executor_status */
-#include <babeltrace/graph/query-executor.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_query_executor;
-struct bt_private_query_executor;
-struct bt_component_class;
-struct bt_value;
-
-static inline
-struct bt_query_executor *bt_private_query_executor_as_query_executor(
-               struct bt_private_query_executor *priv_query_executor)
-{
-       return (void *) priv_query_executor;
-}
-
-extern
-struct bt_private_query_executor *bt_private_query_executor_create(void);
-
-extern
-enum bt_query_executor_status bt_private_query_executor_query(
-               struct bt_private_query_executor *query_executor,
-               struct bt_component_class *component_class,
-               const char *object, const struct bt_value *params,
-               const struct bt_value **result);
-
-extern
-enum bt_query_executor_status bt_private_query_executor_cancel(
-               struct bt_private_query_executor *query_executor);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_GRAPH_PRIVATE_QUERY_EXECUTOR_H */
diff --git a/include/babeltrace/graph/query-executor-const.h b/include/babeltrace/graph/query-executor-const.h
new file mode 100644 (file)
index 0000000..c5cfd93
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef BABELTRACE_GRAPH_QUERY_EXECUTOR_CONST_H
+#define BABELTRACE_GRAPH_QUERY_EXECUTOR_CONST_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@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.
+ */
+
+/* For bt_bool */
+#include <babeltrace/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_query_executor;
+
+enum bt_query_executor_status {
+       BT_QUERY_EXECUTOR_STATUS_OK = 0,
+       BT_QUERY_EXECUTOR_STATUS_AGAIN = 11,
+       BT_QUERY_EXECUTOR_STATUS_UNSUPPORTED = 95,
+       BT_QUERY_EXECUTOR_STATUS_CANCELED = 125,
+       BT_QUERY_EXECUTOR_STATUS_ERROR = -1,
+       BT_QUERY_EXECUTOR_STATUS_NOMEM = -12,
+       BT_QUERY_EXECUTOR_STATUS_INVALID_OBJECT = -23,
+       BT_QUERY_EXECUTOR_STATUS_INVALID_PARAMS = -24,
+};
+
+extern
+bt_bool bt_query_executor_is_canceled(
+               const struct bt_query_executor *query_executor);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_QUERY_EXECUTOR_CONST_H */
index 23bc2f40a5abb970e7abb67563ddc5e0fd7827b6..98a46bedd3f77c1e96026e41b39e961570168e82 100644 (file)
@@ -26,7 +26,7 @@
 #include <babeltrace/types.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/graph/query-executor.h>
-#include <babeltrace/graph/private-component-class.h>
+#include <babeltrace/graph/component-class.h>
 
 struct bt_query_executor {
        struct bt_object base;
index abdb16ce02fca5872ae58004a329d6187bde8b37..a3a376a9d61662436b93f5cd3c5046fe62432440 100644 (file)
  * SOFTWARE.
  */
 
-/* For bt_bool */
-#include <babeltrace/types.h>
+/* For enum bt_query_executor_status */
+#include <babeltrace/graph/query-executor.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct bt_query_executor;
+struct bt_component_class;
+struct bt_value;
 
-enum bt_query_executor_status {
-       BT_QUERY_EXECUTOR_STATUS_OK = 0,
-       BT_QUERY_EXECUTOR_STATUS_AGAIN = 11,
-       BT_QUERY_EXECUTOR_STATUS_UNSUPPORTED = 95,
-       BT_QUERY_EXECUTOR_STATUS_CANCELED = 125,
-       BT_QUERY_EXECUTOR_STATUS_ERROR = -1,
-       BT_QUERY_EXECUTOR_STATUS_NOMEM = -12,
-       BT_QUERY_EXECUTOR_STATUS_INVALID_OBJECT = -23,
-       BT_QUERY_EXECUTOR_STATUS_INVALID_PARAMS = -24,
-};
+extern
+struct bt_query_executor *bt_query_executor_create(void);
+
+extern
+enum bt_query_executor_status bt_query_executor_query(
+               struct bt_query_executor *query_executor,
+               const struct bt_component_class *component_class,
+               const char *object, const struct bt_value *params,
+               const struct bt_value **result);
 
 extern
-bt_bool bt_query_executor_is_canceled(struct bt_query_executor *query_executor);
+enum bt_query_executor_status bt_query_executor_cancel(
+               struct bt_query_executor *query_executor);
 
 #ifdef __cplusplus
 }
index 8a029a8df00e9669801c32eed3ae8e4d45633e98..7d97cdbbf6dd7cef12eb4d416399fd663c29bb87 100644 (file)
@@ -31,11 +31,11 @@ struct bt_component_class_filter;
 struct bt_self_component_class_filter;
 
 static inline
-struct bt_component_class_filter *
+const struct bt_component_class_filter *
 bt_self_component_class_filter_as_component_class_filter(
                struct bt_self_component_class_filter *self_comp_cls_filter)
 {
-       return (void *) self_comp_cls_filter;
+       return (const void *) self_comp_cls_filter;
 }
 
 #ifdef __cplusplus
index 01dacaa3bc58cf6c09bb9e9b4ca9387291d5a726..46cb7bcec1a8559f7817aab99d2f9101ddb050e6 100644 (file)
@@ -31,11 +31,11 @@ struct bt_component_class_sink;
 struct bt_self_component_class_sink;
 
 static inline
-struct bt_component_class_sink *
+const struct bt_component_class_sink *
 bt_self_component_class_sink_as_component_class_sink(
                struct bt_self_component_class_sink *self_comp_cls_sink)
 {
-       return (void *) self_comp_cls_sink;
+       return (const void *) self_comp_cls_sink;
 }
 
 #ifdef __cplusplus
index 0cdbc8668724e8cd0851242ccd832aa612a46df0..13dbf7e8a2034dae41d6c1b6e182903e5dea7033 100644 (file)
@@ -31,11 +31,11 @@ struct bt_component_class_source;
 struct bt_self_component_class_source;
 
 static inline
-struct bt_component_class_source *
+const struct bt_component_class_source *
 bt_self_component_class_source_as_component_class_source(
                struct bt_self_component_class_source *self_comp_cls_source)
 {
-       return (void *) self_comp_cls_source;
+       return (const void *) self_comp_cls_source;
 }
 
 #ifdef __cplusplus
index 4aef3cccf683b0064dca54e3671f1364dd682435..12a6fa8deec772fac6398e349a2146750d0a9655 100644 (file)
@@ -46,16 +46,13 @@ struct bt_self_component *bt_self_component_filter_as_self_component(
 }
 
 static inline
-struct bt_component_filter *
+const struct bt_component_filter *
 bt_self_component_filter_as_component_filter(
                struct bt_self_component_filter *self_comp_filter)
 {
-       return (void *) self_comp_filter;
+       return (const void *) self_comp_filter;
 }
 
-extern struct bt_self_component *bt_self_component_borrow_from_self_component_filter(
-               struct bt_self_component_filter *self_component);
-
 extern struct bt_component_filter *bt_component_filter_borrow_from_self(
                struct bt_self_component_filter *self_component);
 
index fd7e02fcab44fa779da1e0f39ba7e0c016a384c2..15ef6c52672105a3e11ac20753a49c7705dad82f 100644 (file)
@@ -28,8 +28,8 @@
 /* For enum bt_notification_iterator_status */
 #include <babeltrace/graph/notification-iterator.h>
 
-/* For bt_notification_array */
-#include <babeltrace/graph/notification.h>
+/* For bt_notification_array_const */
+#include <babeltrace/graph/notification-const.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -59,7 +59,7 @@ bt_self_component_port_input_notification_iterator_borrow_component(
 extern enum bt_notification_iterator_status
 bt_self_component_port_input_notification_iterator_next(
                struct bt_self_component_port_input_notification_iterator *iterator,
-               bt_notification_array *notifs, uint64_t *count);
+               bt_notification_array_const *notifs, uint64_t *count);
 
 #ifdef __cplusplus
 }
index d25e114479890fd8077e9a04ec12c40b60a2c486..b5b0aad12cea2d3f3c4722ce927f8f40e2c310ab 100644 (file)
@@ -43,10 +43,10 @@ bt_self_component_port_input_as_self_component_port(
 }
 
 static inline
-struct bt_port_input *bt_self_component_port_input_as_port_input(
-               struct bt_self_component_port_input *self_component_port)
+const struct bt_port_input *bt_self_component_port_input_as_port_input(
+               const struct bt_self_component_port_input *self_component_port)
 {
-       return (void *) self_component_port;
+       return (const void *) self_component_port;
 }
 
 #ifdef __cplusplus
index 6857f3e84604a3245484688a6415c47866ca6bfe..23801ff20e12b49d73ecb800ee9cc1ae88d84c95 100644 (file)
@@ -43,10 +43,10 @@ bt_self_component_port_output_as_self_component_port(
 }
 
 static inline
-struct bt_port_output *bt_self_component_port_output_as_port_output(
+const struct bt_port_output *bt_self_component_port_output_as_port_output(
                struct bt_self_component_port_output *self_component_port)
 {
-       return (void *) self_component_port;
+       return (const void *) self_component_port;
 }
 
 #ifdef __cplusplus
index 9eaacf1e29ddeb2cd3e59f7c8db5f75ffbb73951..49c5380a5463cab7c3301c2e7b6853421d3e1d91 100644 (file)
@@ -37,10 +37,10 @@ enum bt_self_component_port_status {
 };
 
 static inline
-struct bt_port *bt_self_component_port_as_port(
+const struct bt_port *bt_self_component_port_as_port(
                struct bt_self_component_port *self_port)
 {
-       return (void *) self_port;
+       return (const void *) self_port;
 }
 
 extern struct bt_self_component *bt_self_component_port_borrow_component(
@@ -51,7 +51,7 @@ bt_self_component_port_remove_from_component(
                struct bt_self_component_port *self_port);
 
 extern void *bt_self_component_port_get_data(
-               struct bt_self_component_port *self_port);
+               const struct bt_self_component_port *self_port);
 
 #ifdef __cplusplus
 }
index bdb76c8a44556ad92a27720fa1dd87c6f84f730f..531379ff90808c20c1be526ccc0edb7a331c8a77 100644 (file)
@@ -45,11 +45,11 @@ struct bt_self_component *bt_self_component_sink_as_self_component(
 }
 
 static inline
-struct bt_component_sink *
+const struct bt_component_sink *
 bt_self_component_sink_as_component_sink(
                struct bt_self_component_sink *self_comp_sink)
 {
-       return (void *) self_comp_sink;
+       return (const void *) self_comp_sink;
 }
 
 extern struct bt_self_component_port_input *
index 95ccdb7a9ad45c787cdfaf7c015ffd7a238a2bc6..c7e644d0098f927596cf166539e40c22af4a15a2 100644 (file)
@@ -45,11 +45,11 @@ struct bt_self_component *bt_self_component_source_as_self_component(
 }
 
 static inline
-struct bt_component_source *
+const struct bt_component_source *
 bt_self_component_source_as_component_source(
                struct bt_self_component_source *self_comp_source)
 {
-       return (void *) self_comp_source;
+       return (const void *) self_comp_source;
 }
 
 extern struct bt_self_component_port_output *
index b5d8f551d5e4d5af7c10b11f810706dc8b14f02b..924ef154fb943f86c99cdd496dbffe5a5f475bc2 100644 (file)
@@ -40,14 +40,14 @@ enum bt_self_component_status {
 };
 
 static inline
-struct bt_component *bt_self_component_as_component(
+const struct bt_component *bt_self_component_as_component(
                struct bt_self_component *self_component)
 {
-       return (void *) self_component;
+       return (const void *) self_component;
 }
 
 extern void *bt_self_component_get_data(
-               struct bt_self_component *private_component);
+               const struct bt_self_component *private_component);
 
 extern void bt_self_component_set_data(
                struct bt_self_component *private_component, void *data);
index aa093d2783873a36690504959909e131ee08f7ab..e3711c574bdf07de7a99dd3b2e872597c75937ca 100644 (file)
@@ -55,7 +55,7 @@ extern void bt_self_notification_iterator_set_data(
                void *user_data);
 
 extern void *bt_self_notification_iterator_get_data(
-               struct bt_self_notification_iterator *notification_iterator);
+               const struct bt_self_notification_iterator *notification_iterator);
 
 #ifdef __cplusplus
 }
index 906bf062ac848d6f9e19584a34238a40cc09a256..387713126d677732699fb4caca654520fd1a7392 100644 (file)
@@ -97,29 +97,29 @@ extern uint64_t bt_plugin_get_filter_component_class_count(
 extern uint64_t bt_plugin_get_sink_component_class_count(
                const struct bt_plugin *plugin);
 
-extern struct bt_component_class_source *
+extern const struct bt_component_class_source *
 bt_plugin_borrow_source_component_class_by_index_const_const(
                const struct bt_plugin *plugin, uint64_t index);
 
-extern struct bt_component_class_filter *
+extern const struct bt_component_class_filter *
 bt_plugin_borrow_filter_component_class_by_index_const(
                const struct bt_plugin *plugin, uint64_t index);
 
-extern struct bt_component_class_sink *
+extern const struct bt_component_class_sink *
 bt_plugin_borrow_sink_component_class_by_index_const(
                const struct bt_plugin *plugin, uint64_t index);
 
-extern struct bt_component_class_source *
-bt_plugin_borrow_source_component_class_by_name_const(const struct bt_plugin *plugin,
-               const char *name);
+extern const struct bt_component_class_source *
+bt_plugin_borrow_source_component_class_by_name_const(
+               const struct bt_plugin *plugin, const char *name);
 
-extern struct bt_component_class_filter *
-bt_plugin_borrow_filter_component_class_by_name_const(const struct bt_plugin *plugin,
-               const char *name);
+extern const struct bt_component_class_filter *
+bt_plugin_borrow_filter_component_class_by_name_const(
+               const struct bt_plugin *plugin, const char *name);
 
-extern struct bt_component_class_sink *
-bt_plugin_borrow_sink_component_class_by_name_const(const struct bt_plugin *plugin,
-               const char *name);
+extern const struct bt_component_class_sink *
+bt_plugin_borrow_sink_component_class_by_name_const(
+               const struct bt_plugin *plugin, const char *name);
 
 #ifdef __cplusplus
 }
index 60fa36e486f885534a125c3f2d987d06b1c708b5..c83449a85220fe3ac9e77b0b6c73d8ec969f9036 100644 (file)
 /* For enum bt_plugin_status */
 #include <babeltrace/plugin/plugin-const.h>
 
-/* For private component class method type definitions */
-#include <babeltrace/graph/private-component-class-source.h>
-#include <babeltrace/graph/private-component-class-filter.h>
-#include <babeltrace/graph/private-component-class-sink.h>
+/* For enum bt_component_class_type */
+#include <babeltrace/graph/component-class-const.h>
+
+/* For component class method type definitions */
+#include <babeltrace/graph/component-class-source-const.h>
+#include <babeltrace/graph/component-class-filter-const.h>
+#include <babeltrace/graph/component-class-sink-const.h>
 
 /*
  * _BT_HIDDEN: set the hidden attribute for internal functions
@@ -149,17 +152,17 @@ struct __bt_plugin_component_class_descriptor {
        union {
                /* BT_COMPONENT_CLASS_TYPE_SOURCE */
                struct {
-                       bt_private_component_class_source_notification_iterator_next_method notif_iter_next;
+                       bt_component_class_source_notification_iterator_next_method notif_iter_next;
                } source;
 
                /* BT_COMPONENT_CLASS_TYPE_FILTER */
                struct {
-                       bt_private_component_class_filter_notification_iterator_next_method notif_iter_next;
+                       bt_component_class_filter_notification_iterator_next_method notif_iter_next;
                } filter;
 
                /* BT_COMPONENT_CLASS_TYPE_SINK */
                struct {
-                       bt_private_component_class_sink_consume_method consume;
+                       bt_component_class_sink_consume_method consume;
                } sink;
        } methods;
 } __attribute__((packed));
@@ -204,51 +207,51 @@ struct __bt_plugin_component_class_descriptor_attribute {
                const char *help;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD */
-               bt_private_component_class_source_init_method source_init_method;
-               bt_private_component_class_filter_init_method filter_init_method;
-               bt_private_component_class_sink_init_method sink_init_method;
+               bt_component_class_source_init_method source_init_method;
+               bt_component_class_filter_init_method filter_init_method;
+               bt_component_class_sink_init_method sink_init_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD */
-               bt_private_component_class_source_finalize_method source_finalize_method;
-               bt_private_component_class_filter_finalize_method filter_finalize_method;
-               bt_private_component_class_sink_finalize_method sink_finalize_method;
+               bt_component_class_source_finalize_method source_finalize_method;
+               bt_component_class_filter_finalize_method filter_finalize_method;
+               bt_component_class_sink_finalize_method sink_finalize_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD */
-               bt_private_component_class_source_query_method source_query_method;
-               bt_private_component_class_filter_query_method filter_query_method;
-               bt_private_component_class_sink_query_method sink_query_method;
+               bt_component_class_source_query_method source_query_method;
+               bt_component_class_filter_query_method filter_query_method;
+               bt_component_class_sink_query_method sink_query_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD */
-               bt_private_component_class_filter_accept_input_port_connection_method filter_accept_input_port_connection_method;
-               bt_private_component_class_sink_accept_input_port_connection_method sink_accept_input_port_connection_method;
+               bt_component_class_filter_accept_input_port_connection_method filter_accept_input_port_connection_method;
+               bt_component_class_sink_accept_input_port_connection_method sink_accept_input_port_connection_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD */
-               bt_private_component_class_source_accept_output_port_connection_method source_accept_output_port_connection_method;
-               bt_private_component_class_filter_accept_output_port_connection_method filter_accept_output_port_connection_method;
+               bt_component_class_source_accept_output_port_connection_method source_accept_output_port_connection_method;
+               bt_component_class_filter_accept_output_port_connection_method filter_accept_output_port_connection_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD */
-               bt_private_component_class_filter_input_port_connected_method filter_input_port_connected_method;
-               bt_private_component_class_sink_input_port_connected_method sink_input_port_connected_method;
+               bt_component_class_filter_input_port_connected_method filter_input_port_connected_method;
+               bt_component_class_sink_input_port_connected_method sink_input_port_connected_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD */
-               bt_private_component_class_source_output_port_connected_method source_output_port_connected_method;
-               bt_private_component_class_filter_output_port_connected_method filter_output_port_connected_method;
+               bt_component_class_source_output_port_connected_method source_output_port_connected_method;
+               bt_component_class_filter_output_port_connected_method filter_output_port_connected_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_DISCONNECTED_METHOD */
-               bt_private_component_class_filter_input_port_disconnected_method filter_input_port_disconnected_method;
-               bt_private_component_class_sink_input_port_disconnected_method sink_input_port_disconnected_method;
+               bt_component_class_filter_input_port_disconnected_method filter_input_port_disconnected_method;
+               bt_component_class_sink_input_port_disconnected_method sink_input_port_disconnected_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_DISCONNECTED_METHOD */
-               bt_private_component_class_source_output_port_disconnected_method source_output_port_disconnected_method;
-               bt_private_component_class_filter_output_port_disconnected_method filter_output_port_disconnected_method;
+               bt_component_class_source_output_port_disconnected_method source_output_port_disconnected_method;
+               bt_component_class_filter_output_port_disconnected_method filter_output_port_disconnected_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD */
-               bt_private_component_class_source_notification_iterator_init_method source_notif_iter_init_method;
-               bt_private_component_class_filter_notification_iterator_init_method filter_notif_iter_init_method;
+               bt_component_class_source_notification_iterator_init_method source_notif_iter_init_method;
+               bt_component_class_filter_notification_iterator_init_method filter_notif_iter_init_method;
 
                /* BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD */
-               bt_private_component_class_source_notification_iterator_finalize_method source_notif_iter_finalize_method;
-               bt_private_component_class_filter_notification_iterator_finalize_method filter_notif_iter_finalize_method;
+               bt_component_class_source_notification_iterator_finalize_method source_notif_iter_finalize_method;
+               bt_component_class_filter_notification_iterator_finalize_method filter_notif_iter_finalize_method;
        } value;
 } __attribute__((packed));
 
@@ -514,7 +517,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _comp_class_id:          Component class ID (C identifier).
  * _name:                   Component class name (C string).
  * _notif_iter_next_method: Component class's iterator next method
- *                          (bt_private_component_class_source_notification_iterator_next_method).
+ *                          (bt_component_class_source_notification_iterator_next_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
        static struct __bt_plugin_component_class_descriptor __bt_plugin_source_component_class_descriptor_##_id##_##_comp_class_id = { \
@@ -534,7 +537,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _comp_class_id:          Component class ID (C identifier).
  * _name:                   Component class name (C string).
  * _notif_iter_next_method: Component class's iterator next method
- *                          (bt_private_component_class_filter_notification_iterator_next_method).
+ *                          (bt_component_class_filter_notification_iterator_next_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _notif_iter_next_method) \
        static struct __bt_plugin_component_class_descriptor __bt_plugin_filter_component_class_descriptor_##_id##_##_comp_class_id = { \
@@ -554,7 +557,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _comp_class_id:      Component class ID (C identifier).
  * _name:               Component class name (C string).
  * _consume_method:     Component class's iterator consume method
- *                      (bt_private_component_class_sink_consume_method).
+ *                      (bt_component_class_sink_consume_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(_id, _comp_class_id, _name, _consume_method) \
        static struct __bt_plugin_component_class_descriptor __bt_plugin_sink_component_class_descriptor_##_id##_##_comp_class_id = { \
@@ -660,7 +663,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Initialization method (bt_private_component_class_source_init_method).
+ * _x:             Initialization method (bt_component_class_source_init_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, source, _x)
@@ -671,7 +674,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Initialization method (bt_private_component_class_filter_init_method).
+ * _x:             Initialization method (bt_component_class_filter_init_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INIT_METHOD, _id, _comp_class_id, filter, _x)
@@ -682,7 +685,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Initialization method (bt_private_component_class_sink_init_method).
+ * _x:             Initialization method (bt_component_class_sink_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)
@@ -693,7 +696,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Finalize method (bt_private_component_class_source_finalize_method).
+ * _x:             Finalize method (bt_component_class_source_finalize_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
@@ -704,7 +707,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Finalize method (bt_private_component_class_filter_finalize_method).
+ * _x:             Finalize method (bt_component_class_filter_finalize_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
@@ -715,7 +718,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Finalize method (bt_private_component_class_sink_finalize_method).
+ * _x:             Finalize method (bt_component_class_sink_finalize_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD, _id, _comp_class_id, sink, _x)
@@ -726,7 +729,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Finalize method (bt_private_component_class_source_query_method).
+ * _x:             Finalize method (bt_component_class_source_query_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, source, _x)
@@ -737,7 +740,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Finalize method (bt_private_component_class_filter_query_method).
+ * _x:             Finalize method (bt_component_class_filter_query_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, filter, _x)
@@ -748,7 +751,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
- * _x:             Finalize method (bt_private_component_class_sink_query_method).
+ * _x:             Finalize method (bt_component_class_sink_query_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_query_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD, _id, _comp_class_id, sink, _x)
@@ -760,7 +763,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Accept port connection method
- *                 (bt_private_component_class_filter_accept_input_port_connection_method).
+ *                 (bt_component_class_filter_accept_input_port_connection_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_accept_input_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, filter, _x)
@@ -772,7 +775,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Accept port connection method
- *                 (bt_private_component_class_sink_accept_input_port_connection_method).
+ *                 (bt_component_class_sink_accept_input_port_connection_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_accept_input_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_INPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, sink, _x)
@@ -784,7 +787,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Accept port connection method
- *                 (bt_private_component_class_source_accept_output_port_connection_method).
+ *                 (bt_component_class_source_accept_output_port_connection_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_accept_output_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, source, _x)
@@ -796,7 +799,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Accept port connection method
- *                 (bt_private_component_class_filter_accept_output_port_connection_method).
+ *                 (bt_component_class_filter_accept_output_port_connection_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_accept_output_port_connection_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD, _id, _comp_class_id, filter, _x)
@@ -808,7 +811,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Port connected method
- *                 (bt_private_component_class_filter_input_port_connected_method).
+ *                 (bt_component_class_filter_input_port_connected_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_input_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD, _id, _comp_class_id, filter, _x)
@@ -820,7 +823,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Port connected method
- *                 (bt_private_component_class_sink_input_port_connected_method).
+ *                 (bt_component_class_sink_input_port_connected_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_input_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD, _id, _comp_class_id, sink, _x)
@@ -832,7 +835,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Port connected method
- *                 (bt_private_component_class_source_output_port_connected_method).
+ *                 (bt_component_class_source_output_port_connected_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_output_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD, _id, _comp_class_id, source, _x)
@@ -844,7 +847,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Port connected method
- *                 (bt_private_component_class_filter_output_port_connected_method).
+ *                 (bt_component_class_filter_output_port_connected_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_output_port_connected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD, _id, _comp_class_id, filter, _x)
@@ -856,7 +859,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Port disconnected method
- *                 (bt_private_component_class_filter_input_port_disconnected_method).
+ *                 (bt_component_class_filter_input_port_disconnected_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_input_port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, filter, _x)
@@ -868,7 +871,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Port disconnected method
- *                 (bt_private_component_class_sink_input_port_disconnected_method).
+ *                 (bt_component_class_sink_input_port_disconnected_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(sink_input_port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, sink, _x)
@@ -880,7 +883,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Port disconnected method
- *                 (bt_private_component_class_source_output_port_disconnected_method).
+ *                 (bt_component_class_source_output_port_disconnected_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_output_port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, source, _x)
@@ -892,7 +895,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Port disconnected method
- *                 (bt_private_component_class_filter_output_port_disconnected_method).
+ *                 (bt_component_class_filter_output_port_disconnected_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_output_port_disconnected_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_DISCONNECTED_METHOD, _id, _comp_class_id, filter, _x)
@@ -904,7 +907,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Iterator initialization method
- *                 (bt_private_component_class_source_notification_iterator_init_method).
+ *                 (bt_component_class_source_notification_iterator_init_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_notif_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD, _id, _comp_class_id, source, _x)
@@ -916,7 +919,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Iterator finalize method
- *                 (bt_private_component_class_source_notification_iterator_finalize_method).
+ *                 (bt_component_class_source_notification_iterator_finalize_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(source_notif_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD, _id, _comp_class_id, source, _x)
@@ -928,7 +931,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Iterator initialization method
- *                 (bt_private_component_class_filter_notification_iterator_init_method).
+ *                 (bt_component_class_filter_notification_iterator_init_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_notif_iter_init_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_INIT_METHOD, _id, _comp_class_id, filter, _x)
@@ -940,7 +943,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * _id:            Plugin descriptor ID (C identifier).
  * _comp_class_id: Component class descriptor ID (C identifier).
  * _x:             Iterator finalize method
- *                 (bt_private_component_class_filter_notification_iterator_finalize_method).
+ *                 (bt_component_class_filter_notification_iterator_finalize_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(_id, _comp_class_id, _x) \
        __BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE(filter_notif_iter_finalize_method, BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_NOTIF_ITER_FINALIZE_METHOD, _id, _comp_class_id, filter, _x)
@@ -1010,7 +1013,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name:                   Component class name (C identifier).
  * _notif_iter_next_method: Component class's iterator next method
- *                          (bt_private_component_class_source_notification_iterator_next_method).
+ *                          (bt_component_class_source_notification_iterator_next_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS(_name, _notif_iter_next_method) \
        BT_PLUGIN_SOURCE_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
@@ -1022,7 +1025,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name:                   Component class name (C identifier).
  * _notif_iter_next_method: Component class's iterator next method
- *                          (bt_private_component_class_filter_notification_iterator_next_method).
+ *                          (bt_component_class_filter_notification_iterator_next_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS(_name, _notif_iter_next_method) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _notif_iter_next_method)
@@ -1034,7 +1037,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name:           Component class name (C identifier).
  * _consume_method: Component class's consume method
- *                  (bt_private_component_class_sink_consume_method).
+ *                  (bt_component_class_sink_consume_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS(_name, _consume_method) \
        BT_PLUGIN_SINK_COMPONENT_CLASS_WITH_ID(auto, _name, #_name, _consume_method)
@@ -1105,7 +1108,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Initialization method (bt_private_component_class_source_init_method).
+ * _x:    Initialization method (bt_component_class_source_init_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
        BT_PLUGIN_SOURCE_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
@@ -1116,7 +1119,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Initialization method (bt_private_component_class_filter_init_method).
+ * _x:    Initialization method (bt_component_class_filter_init_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
@@ -1127,7 +1130,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Initialization method (bt_private_component_class_sink_init_method).
+ * _x:    Initialization method (bt_component_class_sink_init_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD(_name, _x) \
        BT_PLUGIN_SINK_COMPONENT_CLASS_INIT_METHOD_WITH_ID(auto, _name, _x)
@@ -1138,7 +1141,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Initialization method (bt_private_component_class_source_finalize_method).
+ * _x:    Initialization method (bt_component_class_source_finalize_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
        BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
@@ -1149,7 +1152,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Initialization method (bt_private_component_class_filter_finalize_method).
+ * _x:    Initialization method (bt_component_class_filter_finalize_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
@@ -1159,7 +1162,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor which is attached to the automatic plugin descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Initialization method (bt_private_component_class_sink_finalize_method).
+ * _x:    Initialization method (bt_component_class_sink_finalize_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(_name, _x) \
        BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
@@ -1170,7 +1173,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Initialization method (bt_private_component_class_source_query_method).
+ * _x:    Initialization method (bt_component_class_source_query_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
        BT_PLUGIN_SOURCE_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
@@ -1181,7 +1184,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Initialization method (bt_private_component_class_filter_query_method).
+ * _x:    Initialization method (bt_component_class_filter_query_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
@@ -1192,7 +1195,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Initialization method (bt_private_component_class_sink_query_method).
+ * _x:    Initialization method (bt_component_class_sink_query_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD(_name, _x) \
        BT_PLUGIN_SINK_COMPONENT_CLASS_QUERY_METHOD_WITH_ID(auto, _name, _x)
@@ -1204,7 +1207,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name: Component class name (C identifier).
  * _x:    Accept port connection method
- *        (bt_private_component_class_filter_accept_input_port_connection_method).
+ *        (bt_component_class_filter_accept_input_port_connection_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
@@ -1216,7 +1219,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name: Component class name (C identifier).
  * _x:    Accept port connection method
- *        (bt_private_component_class_sink_accept_input_port_connection_method).
+ *        (bt_component_class_sink_accept_input_port_connection_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD(_name, _x) \
        BT_PLUGIN_SINK_COMPONENT_CLASS_ACCEPT_INPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
@@ -1228,7 +1231,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name: Component class name (C identifier).
  * _x:    Accept port connection method
- *        (bt_private_component_class_source_accept_output_port_connection_method).
+ *        (bt_component_class_source_accept_output_port_connection_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD(_name, _x) \
        BT_PLUGIN_SOURCE_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
@@ -1240,7 +1243,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name: Component class name (C identifier).
  * _x:    Accept port connection method
- *        (bt_private_component_class_filter_accept_output_port_connection_method).
+ *        (bt_component_class_filter_accept_output_port_connection_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_ACCEPT_OUTPUT_PORT_CONNECTION_METHOD_WITH_ID(auto, _name, _x)
@@ -1251,7 +1254,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Port connected (bt_private_component_class_filter_input_port_connected_method).
+ * _x:    Port connected (bt_component_class_filter_input_port_connected_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
@@ -1262,7 +1265,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Port connected (bt_private_component_class_sink_input_port_connected_method).
+ * _x:    Port connected (bt_component_class_sink_input_port_connected_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD(_name, _x) \
        BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
@@ -1273,7 +1276,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Port connected (bt_private_component_class_source_output_port_connected_method).
+ * _x:    Port connected (bt_component_class_source_output_port_connected_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _x) \
        BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
@@ -1284,7 +1287,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Port connected (bt_private_component_class_filter_output_port_connected_method).
+ * _x:    Port connected (bt_component_class_filter_output_port_connected_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_CONNECTED_METHOD_WITH_ID(auto, _name, _x)
@@ -1295,7 +1298,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * plugin descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Port disconnected (bt_private_component_class_filter_input_port_disconnected_method).
+ * _x:    Port disconnected (bt_component_class_filter_input_port_disconnected_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
@@ -1306,7 +1309,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * plugin descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Port disconnected (bt_private_component_class_sink_input_port_disconnected_method).
+ * _x:    Port disconnected (bt_component_class_sink_input_port_disconnected_method).
  */
 #define BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD(_name, _x) \
        BT_PLUGIN_SINK_COMPONENT_CLASS_INPUT_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
@@ -1317,7 +1320,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * plugin descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Port disconnected (bt_private_component_class_source_output_port_disconnected_method).
+ * _x:    Port disconnected (bt_component_class_source_output_port_disconnected_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD(_name, _x) \
        BT_PLUGIN_SOURCE_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
@@ -1328,7 +1331,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  * plugin descriptor.
  *
  * _name: Component class name (C identifier).
- * _x:    Port disconnected (bt_private_component_class_filter_output_port_disconnected_method).
+ * _x:    Port disconnected (bt_component_class_filter_output_port_disconnected_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_OUTPUT_PORT_DISCONNECTED_METHOD_WITH_ID(auto, _name, _x)
@@ -1340,7 +1343,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name: Component class name (C identifier).
  * _x:    Iterator initialization method
- *        (bt_private_component_class_source_notification_iterator_init_method).
+ *        (bt_component_class_source_notification_iterator_init_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
        BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
@@ -1352,7 +1355,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name: Component class name (C identifier).
  * _x:    Iterator finalize method
- *        (bt_private_component_class_source_notification_iterator_finalize_method).
+ *        (bt_component_class_source_notification_iterator_finalize_method).
  */
 #define BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
        BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
@@ -1364,7 +1367,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name: Component class name (C identifier).
  * _x:    Iterator initialization method
- *        (bt_private_component_class_filter_notification_iterator_init_method).
+ *        (bt_component_class_filter_notification_iterator_init_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD_WITH_ID(auto, _name, _x)
@@ -1376,7 +1379,7 @@ struct __bt_plugin_component_class_descriptor_attribute const * const *__bt_get_
  *
  * _name: Component class name (C identifier).
  * _x:    Iterator finalize method
- *        (bt_private_component_class_filter_notification_iterator_finalize_method).
+ *        (bt_component_class_filter_notification_iterator_finalize_method).
  */
 #define BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(_name, _x) \
        BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD_WITH_ID(auto, _name, _x)
index 35006c7c0e3b95a251edecc0790f9a3a692fd07b..1623b6ea7f9fe7458ace5ea48ee396f08d5051da 100644 (file)
@@ -22,7 +22,7 @@
  * SOFTWARE.
  */
 
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/version.h>
 #include <babeltrace/types.h>
 #include <stdlib.h>
 
index 0c91aeaa5af4232471ffa4df7e917771f9ef7c45..e256d248594b60d281c85f4ad38d32ebae202dd5 100644 (file)
@@ -24,8 +24,7 @@
 #include <babeltrace/lib-logging-internal.h>
 
 #include <babeltrace/object.h>
-#include <babeltrace/graph/connection.h>
-#include <babeltrace/graph/private-component-class-sink.h>
+#include <babeltrace/graph/component-class-sink.h>
 #include <babeltrace/graph/self-component-sink.h>
 #include <babeltrace/graph/self-component-port.h>
 #include <babeltrace/graph/self-component-port-input-notification-iterator.h>
 #include <glib.h>
 
 static
-struct bt_private_component_class_sink *colander_comp_cls;
+struct bt_component_class_sink *colander_comp_cls;
 
 struct colander_data {
-       bt_notification_array notifs;
+       bt_notification_array_const notifs;
        uint64_t *count_addr;
        struct bt_self_component_port_input_notification_iterator *notif_iter;
 };
@@ -102,7 +101,7 @@ static
 enum bt_self_component_status colander_input_port_connected(
                struct bt_self_component_sink *self_comp,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port)
+               const struct bt_port_output *other_port)
 {
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
        struct colander_data *colander_data =
@@ -135,7 +134,7 @@ enum bt_self_component_status colander_consume(
        struct colander_data *colander_data =
                bt_self_component_get_data(
                        bt_self_component_sink_as_self_component(self_comp));
-       bt_notification_array notifs;
+       bt_notification_array_const notifs;
 
        BT_ASSERT(colander_data);
 
@@ -180,18 +179,18 @@ struct bt_component_class_sink *bt_component_class_sink_colander_get(void)
                goto end;
        }
 
-       colander_comp_cls = bt_private_component_class_sink_create(
-               "colander", colander_consume);
+       colander_comp_cls = bt_component_class_sink_create("colander",
+               colander_consume);
        if (!colander_comp_cls) {
                BT_LOGE_STR("Cannot create sink colander component class.");
                goto end;
        }
 
-       (void) bt_private_component_class_sink_set_init_method(
+       (void) bt_component_class_sink_set_init_method(
                colander_comp_cls, colander_init);
-       (void) bt_private_component_class_sink_set_finalize_method(
+       (void) bt_component_class_sink_set_finalize_method(
                colander_comp_cls, colander_finalize);
-       (void) bt_private_component_class_sink_set_input_port_connected_method(
+       (void) bt_component_class_sink_set_input_port_connected_method(
                colander_comp_cls, colander_input_port_connected);
 
 end:
index 36d3970fd2da5060cca922b7da1fc2547be62ab3..3e3c93bd992fa4f8848895c41a38fa46f2af18b6 100644 (file)
 #include <babeltrace/lib-logging-internal.h>
 
 #include <babeltrace/compiler-internal.h>
-#include <babeltrace/graph/private-component-class.h>
-#include <babeltrace/graph/private-component-class-source.h>
-#include <babeltrace/graph/private-component-class-filter.h>
-#include <babeltrace/graph/private-component-class-sink.h>
+#include <babeltrace/graph/component-class.h>
+#include <babeltrace/graph/component-class-const.h>
+#include <babeltrace/graph/component-class-source.h>
+#include <babeltrace/graph/component-class-source-const.h>
+#include <babeltrace/graph/component-class-filter.h>
+#include <babeltrace/graph/component-class-filter-const.h>
+#include <babeltrace/graph/component-class-sink.h>
+#include <babeltrace/graph/component-class-sink-const.h>
 #include <babeltrace/graph/component-class-internal.h>
 #include <babeltrace/object.h>
 #include <babeltrace/types.h>
@@ -38,7 +42,7 @@
 #include <glib.h>
 
 #define BT_ASSERT_PRE_COMP_CLS_HOT(_cc) \
-       BT_ASSERT_PRE_HOT(((struct bt_component_class *) (_cc)),        \
+       BT_ASSERT_PRE_HOT(((const struct bt_component_class *) (_cc)),  \
                "Component class", ": %!+C", (_cc))
 
 static
@@ -130,10 +134,9 @@ end:
        return ret;
 }
 
-struct bt_private_component_class_source *
-bt_private_component_class_source_create(
+struct bt_component_class_source *bt_component_class_source_create(
                const char *name,
-               bt_private_component_class_source_notification_iterator_next_method method)
+               bt_component_class_source_notification_iterator_next_method method)
 {
        struct bt_component_class_source *source_class = NULL;
        int ret;
@@ -169,9 +172,9 @@ end:
        return (void *) source_class;
 }
 
-struct bt_private_component_class_filter *
-bt_private_component_class_filter_create(const char *name,
-               bt_private_component_class_filter_notification_iterator_next_method method)
+struct bt_component_class_filter *bt_component_class_filter_create(
+               const char *name,
+               bt_component_class_filter_notification_iterator_next_method method)
 {
        struct bt_component_class_filter *filter_class = NULL;
        int ret;
@@ -207,9 +210,8 @@ end:
        return (void *) filter_class;
 }
 
-struct bt_private_component_class_sink *bt_private_component_class_sink_create(
-               const char *name,
-               bt_private_component_class_sink_consume_method method)
+struct bt_component_class_sink *bt_component_class_sink_create(
+               const char *name, bt_component_class_sink_consume_method method)
 {
        struct bt_component_class_sink *sink_class = NULL;
        int ret;
@@ -245,12 +247,10 @@ end:
        return (void *) sink_class;
 }
 
-int bt_private_component_class_source_set_init_method(
-               struct bt_private_component_class_source *priv_comp_cls,
-               bt_private_component_class_source_init_method method)
+int bt_component_class_source_set_init_method(
+               struct bt_component_class_source *comp_cls,
+               bt_component_class_source_init_method method)
 {
-       struct bt_component_class_source *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -260,12 +260,10 @@ int bt_private_component_class_source_set_init_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_init_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_init_method method)
+int bt_component_class_filter_set_init_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_init_method method)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -275,12 +273,10 @@ int bt_private_component_class_filter_set_init_method(
        return 0;
 }
 
-int bt_private_component_class_sink_set_init_method(
-               struct bt_private_component_class_sink *priv_comp_cls,
-               bt_private_component_class_sink_init_method method)
+int bt_component_class_sink_set_init_method(
+               struct bt_component_class_sink *comp_cls,
+               bt_component_class_sink_init_method method)
 {
-       struct bt_component_class_sink *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -290,12 +286,10 @@ int bt_private_component_class_sink_set_init_method(
        return 0;
 }
 
-int bt_private_component_class_source_set_finalize_method(
-               struct bt_private_component_class_source *priv_comp_cls,
-               bt_private_component_class_source_finalize_method method)
+int bt_component_class_source_set_finalize_method(
+               struct bt_component_class_source *comp_cls,
+               bt_component_class_source_finalize_method method)
 {
-       struct bt_component_class_source *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -305,12 +299,10 @@ int bt_private_component_class_source_set_finalize_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_finalize_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_finalize_method method)
+int bt_component_class_filter_set_finalize_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_finalize_method method)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -320,12 +312,10 @@ int bt_private_component_class_filter_set_finalize_method(
        return 0;
 }
 
-int bt_private_component_class_sink_set_finalize_method(
-               struct bt_private_component_class_sink *priv_comp_cls,
-               bt_private_component_class_sink_finalize_method method)
+int bt_component_class_sink_set_finalize_method(
+               struct bt_component_class_sink *comp_cls,
+               bt_component_class_sink_finalize_method method)
 {
-       struct bt_component_class_sink *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -335,12 +325,10 @@ int bt_private_component_class_sink_set_finalize_method(
        return 0;
 }
 
-int bt_private_component_class_source_set_query_method(
-               struct bt_private_component_class_source *priv_comp_cls,
-               bt_private_component_class_source_query_method method)
+int bt_component_class_source_set_query_method(
+               struct bt_component_class_source *comp_cls,
+               bt_component_class_source_query_method method)
 {
-       struct bt_component_class_source *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -350,12 +338,10 @@ int bt_private_component_class_source_set_query_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_query_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_query_method method)
+int bt_component_class_filter_set_query_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_query_method method)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -365,12 +351,10 @@ int bt_private_component_class_filter_set_query_method(
        return 0;
 }
 
-int bt_private_component_class_sink_set_query_method(
-               struct bt_private_component_class_sink *priv_comp_cls,
-               bt_private_component_class_sink_query_method method)
+int bt_component_class_sink_set_query_method(
+               struct bt_component_class_sink *comp_cls,
+               bt_component_class_sink_query_method method)
 {
-       struct bt_component_class_sink *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -380,12 +364,10 @@ int bt_private_component_class_sink_set_query_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_accept_input_port_connection_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_accept_input_port_connection_method method)
+int bt_component_class_filter_set_accept_input_port_connection_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_accept_input_port_connection_method method)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -395,12 +377,10 @@ int bt_private_component_class_filter_set_accept_input_port_connection_method(
        return 0;
 }
 
-int bt_private_component_class_sink_set_accept_input_port_connection_method(
-               struct bt_private_component_class_sink *priv_comp_cls,
-               bt_private_component_class_sink_accept_input_port_connection_method method)
+int bt_component_class_sink_set_accept_input_port_connection_method(
+               struct bt_component_class_sink *comp_cls,
+               bt_component_class_sink_accept_input_port_connection_method method)
 {
-       struct bt_component_class_sink *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -410,12 +390,10 @@ int bt_private_component_class_sink_set_accept_input_port_connection_method(
        return 0;
 }
 
-int bt_private_component_class_source_set_accept_output_port_connection_method(
-               struct bt_private_component_class_source *priv_comp_cls,
-               bt_private_component_class_source_accept_output_port_connection_method method)
+int bt_component_class_source_set_accept_output_port_connection_method(
+               struct bt_component_class_source *comp_cls,
+               bt_component_class_source_accept_output_port_connection_method method)
 {
-       struct bt_component_class_source *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -425,12 +403,10 @@ int bt_private_component_class_source_set_accept_output_port_connection_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_accept_output_port_connection_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_accept_output_port_connection_method method)
+int bt_component_class_filter_set_accept_output_port_connection_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_accept_output_port_connection_method method)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -440,12 +416,10 @@ int bt_private_component_class_filter_set_accept_output_port_connection_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_input_port_connected_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_input_port_connected_method method)
+int 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)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -455,12 +429,10 @@ int bt_private_component_class_filter_set_input_port_connected_method(
        return 0;
 }
 
-int bt_private_component_class_sink_set_input_port_connected_method(
-               struct bt_private_component_class_sink *priv_comp_cls,
-               bt_private_component_class_sink_input_port_connected_method method)
+int 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)
 {
-       struct bt_component_class_sink *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -470,12 +442,10 @@ int bt_private_component_class_sink_set_input_port_connected_method(
        return 0;
 }
 
-int bt_private_component_class_source_set_output_port_connected_method(
-               struct bt_private_component_class_source *priv_comp_cls,
-               bt_private_component_class_source_output_port_connected_method method)
+int 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)
 {
-       struct bt_component_class_source *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -485,12 +455,10 @@ int bt_private_component_class_source_set_output_port_connected_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_output_port_connected_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_output_port_connected_method method)
+int 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)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -500,12 +468,10 @@ int bt_private_component_class_filter_set_output_port_connected_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_input_port_disconnected_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_input_port_disconnected_method method)
+int bt_component_class_filter_set_input_port_disconnected_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_input_port_disconnected_method method)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -515,12 +481,10 @@ int bt_private_component_class_filter_set_input_port_disconnected_method(
        return 0;
 }
 
-int bt_private_component_class_sink_set_input_port_disconnected_method(
-               struct bt_private_component_class_sink *priv_comp_cls,
-               bt_private_component_class_sink_input_port_disconnected_method method)
+int bt_component_class_sink_set_input_port_disconnected_method(
+               struct bt_component_class_sink *comp_cls,
+               bt_component_class_sink_input_port_disconnected_method method)
 {
-       struct bt_component_class_sink *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -530,12 +494,10 @@ int bt_private_component_class_sink_set_input_port_disconnected_method(
        return 0;
 }
 
-int bt_private_component_class_source_set_output_port_disconnected_method(
-               struct bt_private_component_class_source *priv_comp_cls,
-               bt_private_component_class_source_output_port_disconnected_method method)
+int bt_component_class_source_set_output_port_disconnected_method(
+               struct bt_component_class_source *comp_cls,
+               bt_component_class_source_output_port_disconnected_method method)
 {
-       struct bt_component_class_source *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -545,12 +507,10 @@ int bt_private_component_class_source_set_output_port_disconnected_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_output_port_disconnected_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_output_port_disconnected_method method)
+int bt_component_class_filter_set_output_port_disconnected_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_output_port_disconnected_method method)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -560,12 +520,10 @@ int bt_private_component_class_filter_set_output_port_disconnected_method(
        return 0;
 }
 
-int bt_private_component_class_source_set_notification_iterator_init_method(
-               struct bt_private_component_class_source *priv_comp_cls,
-               bt_private_component_class_source_notification_iterator_init_method method)
+int bt_component_class_source_set_notification_iterator_init_method(
+               struct bt_component_class_source *comp_cls,
+               bt_component_class_source_notification_iterator_init_method method)
 {
-       struct bt_component_class_source *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -575,12 +533,10 @@ int bt_private_component_class_source_set_notification_iterator_init_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_notification_iterator_init_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_notification_iterator_init_method method)
+int bt_component_class_filter_set_notification_iterator_init_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_notification_iterator_init_method method)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -590,12 +546,10 @@ int bt_private_component_class_filter_set_notification_iterator_init_method(
        return 0;
 }
 
-int bt_private_component_class_source_set_notification_iterator_finalize_method(
-               struct bt_private_component_class_source *priv_comp_cls,
-               bt_private_component_class_source_notification_iterator_finalize_method method)
+int bt_component_class_source_set_notification_iterator_finalize_method(
+               struct bt_component_class_source *comp_cls,
+               bt_component_class_source_notification_iterator_finalize_method method)
 {
-       struct bt_component_class_source *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -605,12 +559,10 @@ int bt_private_component_class_source_set_notification_iterator_finalize_method(
        return 0;
 }
 
-int bt_private_component_class_filter_set_notification_iterator_finalize_method(
-               struct bt_private_component_class_filter *priv_comp_cls,
-               bt_private_component_class_filter_notification_iterator_finalize_method method)
+int bt_component_class_filter_set_notification_iterator_finalize_method(
+               struct bt_component_class_filter *comp_cls,
+               bt_component_class_filter_notification_iterator_finalize_method method)
 {
-       struct bt_component_class_filter *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(method, "Method");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -620,12 +572,10 @@ int bt_private_component_class_filter_set_notification_iterator_finalize_method(
        return 0;
 }
 
-int bt_private_component_class_set_description(
-               struct bt_private_component_class *priv_comp_cls,
+int bt_component_class_set_description(
+               struct bt_component_class *comp_cls,
                const char *description)
 {
-       struct bt_component_class *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(description, "Description");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -638,12 +588,10 @@ int bt_private_component_class_set_description(
        return 0;
 }
 
-int bt_private_component_class_set_help(
-               struct bt_private_component_class *priv_comp_cls,
+int bt_component_class_set_help(
+               struct bt_component_class *comp_cls,
                const char *help)
 {
-       struct bt_component_class *comp_cls = (void *) priv_comp_cls;
-
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(help, "Help");
        BT_ASSERT_PRE_COMP_CLS_HOT(comp_cls);
@@ -652,21 +600,21 @@ int bt_private_component_class_set_help(
        return 0;
 }
 
-const char *bt_component_class_get_name(struct bt_component_class *comp_cls)
+const char *bt_component_class_get_name(const struct bt_component_class *comp_cls)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        return comp_cls->name->str;
 }
 
 enum bt_component_class_type bt_component_class_get_type(
-               struct bt_component_class *comp_cls)
+               const struct bt_component_class *comp_cls)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        return comp_cls->type;
 }
 
 const char *bt_component_class_get_description(
-               struct bt_component_class *comp_cls)
+               const struct bt_component_class *comp_cls)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        return comp_cls->description &&
@@ -675,7 +623,7 @@ const char *bt_component_class_get_description(
 }
 
 const char *bt_component_class_get_help(
-               struct bt_component_class *comp_cls)
+               const struct bt_component_class *comp_cls)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        return comp_cls->help &&
@@ -699,9 +647,9 @@ void bt_component_class_add_destroy_listener(
 }
 
 BT_HIDDEN
-void _bt_component_class_freeze(struct bt_component_class *comp_cls)
+void _bt_component_class_freeze(const struct bt_component_class *comp_cls)
 {
        BT_ASSERT(comp_cls);
        BT_LIB_LOGD("Freezing component class: %!+C", comp_cls);
-       comp_cls->frozen = true;
+       ((struct bt_component_class *) comp_cls)->frozen = true;
 }
index d9cb06e3001c15c4657ef9790a733a7d8e89bc33..869c3d778b6f4f313120c43e93501a9777284a9e 100644 (file)
 #include <babeltrace/compiler-internal.h>
 #include <babeltrace/values.h>
 #include <babeltrace/graph/self-component-filter.h>
-#include <babeltrace/graph/component-filter.h>
+#include <babeltrace/graph/component-filter-const.h>
 #include <babeltrace/graph/component-filter-internal.h>
 #include <babeltrace/graph/component-internal.h>
 #include <babeltrace/graph/component-class-internal.h>
-#include <babeltrace/graph/notification.h>
-#include <babeltrace/graph/notification-iterator-internal.h>
 #include <babeltrace/graph/graph.h>
 #include <babeltrace/object.h>
 #include <babeltrace/assert-internal.h>
@@ -46,7 +44,7 @@ void bt_component_filter_destroy(struct bt_component *component)
 
 BT_HIDDEN
 struct bt_component *bt_component_filter_create(
-               struct bt_component_class *class)
+               const struct bt_component_class *class)
 {
        struct bt_component_filter *filter = NULL;
 
@@ -61,13 +59,14 @@ end:
 }
 
 uint64_t bt_component_filter_get_output_port_count(
-               struct bt_component_filter *comp)
+               const struct bt_component_filter *comp)
 {
        return bt_component_get_output_port_count((void *) comp);
 }
 
-struct bt_port_output *bt_component_filter_borrow_output_port_by_name(
-               struct bt_component_filter *comp, const char *name)
+const struct bt_port_output *
+bt_component_filter_borrow_output_port_by_name_const(
+               const struct bt_component_filter *comp, const char *name)
 {
        return bt_component_borrow_output_port_by_name(
                (void *) comp, name);
@@ -81,8 +80,9 @@ bt_self_component_filter_borrow_output_port_by_name(
                (void *) comp, name);
 }
 
-struct bt_port_output *bt_component_filter_borrow_output_port_by_index(
-               struct bt_component_filter *comp, uint64_t index)
+const struct bt_port_output *
+bt_component_filter_borrow_output_port_by_index_const(
+               const struct bt_component_filter *comp, uint64_t index)
 {
        return bt_component_borrow_output_port_by_index(
                (void *) comp, index);
@@ -124,14 +124,14 @@ end:
 }
 
 uint64_t bt_component_filter_get_input_port_count(
-               struct bt_component_filter *component)
+               const struct bt_component_filter *component)
 {
        /* bt_component_get_input_port_count() logs details/errors */
        return bt_component_get_input_port_count((void *) component);
 }
 
-struct bt_port_input *bt_component_filter_borrow_input_port_by_name(
-               struct bt_component_filter *component, const char *name)
+const struct bt_port_input *bt_component_filter_borrow_input_port_by_name_const(
+               const struct bt_component_filter *component, const char *name)
 {
        /* bt_component_borrow_input_port_by_name() logs details/errors */
        return bt_component_borrow_input_port_by_name(
@@ -147,8 +147,9 @@ bt_self_component_filter_borrow_input_port_by_name(
                (void *) component, name);
 }
 
-struct bt_port_input *bt_component_filter_borrow_input_port_by_index(
-               struct bt_component_filter *component, uint64_t index)
+const struct bt_port_input *
+bt_component_filter_borrow_input_port_by_index_const(
+               const struct bt_component_filter *component, uint64_t index)
 {
        /* bt_component_borrow_input_port_by_index() logs details/errors */
        return bt_component_borrow_input_port_by_index(
index 65403b8a78dc8d4e77a24a7eec50946ea31b2828..033c8e6ebbf7545c342191ff9f9ebdce05ce9b46 100644 (file)
 #include <babeltrace/compiler-internal.h>
 #include <babeltrace/values.h>
 #include <babeltrace/graph/self-component-sink.h>
-#include <babeltrace/graph/component-sink.h>
+#include <babeltrace/graph/component-sink-const.h>
 #include <babeltrace/graph/component-sink-internal.h>
 #include <babeltrace/graph/component-internal.h>
-#include <babeltrace/graph/notification.h>
 #include <babeltrace/graph/graph.h>
 #include <babeltrace/object.h>
 #include <babeltrace/assert-internal.h>
@@ -43,7 +42,8 @@ void bt_component_sink_destroy(struct bt_component *component)
 }
 
 BT_HIDDEN
-struct bt_component *bt_component_sink_create(struct bt_component_class *class)
+struct bt_component *bt_component_sink_create(
+               const struct bt_component_class *class)
 {
        struct bt_component_sink *sink = NULL;
 
@@ -58,14 +58,15 @@ end:
 }
 
 uint64_t bt_component_sink_get_input_port_count(
-               struct bt_component_sink *component)
+               const struct bt_component_sink *component)
 {
        /* bt_component_get_input_port_count() logs details/errors */
        return bt_component_get_input_port_count((void *) component);
 }
 
-struct bt_port_input *bt_component_sink_borrow_input_port_by_name(
-               struct bt_component_sink *component, const char *name)
+const struct bt_port_input *
+bt_component_sink_borrow_input_port_by_name_const(
+               const struct bt_component_sink *component, const char *name)
 {
        /* bt_component_borrow_input_port_by_name() logs details/errors */
        return bt_component_borrow_input_port_by_name((void *) component, name);
@@ -80,8 +81,8 @@ bt_self_component_sink_borrow_input_port_by_name(
                (void *) component, name);
 }
 
-struct bt_port_input *bt_component_sink_borrow_input_port_by_index(
-               struct bt_component_sink *component, uint64_t index)
+const struct bt_port_input *bt_component_sink_borrow_input_port_by_index_const(
+               const struct bt_component_sink *component, uint64_t index)
 {
        /* bt_component_borrow_input_port_by_index() logs details/errors */
        return bt_component_borrow_input_port_by_index(
index 2d5039aa8d7323ef42138478d8b22622a6cc95b6..0c20858efd151a33b279dffe6fee195a6890f937 100644 (file)
@@ -28,7 +28,7 @@
 #include <babeltrace/object.h>
 #include <babeltrace/compiler-internal.h>
 #include <babeltrace/graph/self-component-source.h>
-#include <babeltrace/graph/component-source.h>
+#include <babeltrace/graph/component-source-const.h>
 #include <babeltrace/graph/component-source-internal.h>
 #include <babeltrace/graph/component-internal.h>
 #include <babeltrace/graph/port-internal.h>
@@ -45,7 +45,7 @@ void bt_component_source_destroy(struct bt_component *component)
 
 BT_HIDDEN
 struct bt_component *bt_component_source_create(
-               struct bt_component_class *class)
+               const struct bt_component_class *class)
 {
        struct bt_component_source *source = NULL;
 
@@ -60,13 +60,14 @@ end:
 }
 
 uint64_t bt_component_source_get_output_port_count(
-               struct bt_component_source *comp)
+               const struct bt_component_source *comp)
 {
        return bt_component_get_output_port_count((void *) comp);
 }
 
-struct bt_port_output *bt_component_source_borrow_output_port_by_name(
-               struct bt_component_source *comp, const char *name)
+const struct bt_port_output *
+bt_component_source_borrow_output_port_by_name_const(
+               const struct bt_component_source *comp, const char *name)
 {
        return bt_component_borrow_output_port_by_name((void *) comp, name);
 }
@@ -79,8 +80,9 @@ bt_self_component_source_borrow_output_port_by_name(
                (void *) comp, name);
 }
 
-struct bt_port_output *bt_component_source_borrow_output_port_by_index(
-               struct bt_component_source *comp, uint64_t index)
+const struct bt_port_output *
+bt_component_source_borrow_output_port_by_index_const(
+               const struct bt_component_source *comp, uint64_t index)
 {
        return bt_component_borrow_output_port_by_index((void *) comp, index);
 }
index 84a850100a91d505a18690d80d8e544f509ff8fd..2d3460a0f44fee820fb92ae7cf50a073423db27a 100644 (file)
 #include <babeltrace/lib-logging-internal.h>
 
 #include <babeltrace/graph/self-component.h>
-#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-const.h>
+#include <babeltrace/graph/component-source-const.h>
+#include <babeltrace/graph/component-filter-const.h>
+#include <babeltrace/graph/component-sink-const.h>
 #include <babeltrace/graph/component-internal.h>
 #include <babeltrace/graph/component-class-internal.h>
 #include <babeltrace/graph/component-source-internal.h>
@@ -49,7 +52,7 @@
 
 static
 struct bt_component * (* const component_create_funcs[])(
-               struct bt_component_class *) = {
+               const struct bt_component_class *) = {
        [BT_COMPONENT_CLASS_TYPE_SOURCE] = bt_component_source_create,
        [BT_COMPONENT_CLASS_TYPE_SINK] = bt_component_sink_create,
        [BT_COMPONENT_CLASS_TYPE_FILTER] = bt_component_filter_create,
@@ -182,7 +185,7 @@ void destroy_component(struct bt_object *obj)
 }
 
 enum bt_component_class_type bt_component_get_class_type(
-               struct bt_component *component)
+               const struct bt_component *component)
 {
        BT_ASSERT_PRE_NON_NULL(component, "Component");
        return component->class->type;
@@ -242,14 +245,14 @@ end:
 }
 
 BT_HIDDEN
-uint64_t bt_component_get_input_port_count(struct bt_component *comp)
+uint64_t bt_component_get_input_port_count(const struct bt_component *comp)
 {
        BT_ASSERT_PRE_NON_NULL(comp, "Component");
        return (uint64_t) comp->input_ports->len;
 }
 
 BT_HIDDEN
-uint64_t bt_component_get_output_port_count(struct bt_component *comp)
+uint64_t bt_component_get_output_port_count(const struct bt_component *comp)
 {
        BT_ASSERT_PRE_NON_NULL(comp, "Component");
        return (uint64_t) comp->output_ports->len;
@@ -322,20 +325,20 @@ end:
        return ret;
 }
 
-const char *bt_component_get_name(struct bt_component *component)
+const char *bt_component_get_name(const struct bt_component *component)
 {
        BT_ASSERT_PRE_NON_NULL(component, "Component");
        return component->name->str;
 }
 
 struct bt_component_class *bt_component_borrow_class(
-               struct bt_component *component)
+               const struct bt_component *component)
 {
        BT_ASSERT_PRE_NON_NULL(component, "Component");
        return component->class;
 }
 
-void *bt_self_component_get_data(struct bt_self_component *self_comp)
+void *bt_self_component_get_data(const struct bt_self_component *self_comp)
 {
        struct bt_component *component = (void *) self_comp;
 
@@ -361,7 +364,7 @@ void bt_component_set_graph(struct bt_component *component,
                graph ? &graph->base : NULL);
 }
 
-bt_bool bt_component_graph_is_canceled(struct bt_component *component)
+bt_bool bt_component_graph_is_canceled(const struct bt_component *component)
 {
        return bt_graph_is_canceled(
                (void *) bt_object_borrow_parent(&component->base));
@@ -485,7 +488,7 @@ void remove_port_by_index(struct bt_component *component,
         * To avoid a destroyed port during the notification callback,
         * get a reference now, and put it (destroying the port if its
         * reference count is 0 at this point) after notifying the
-        * private graph's user.
+        * graph's user.
         */
        bt_object_get_no_null_check(&port->base);
 
@@ -565,7 +568,7 @@ enum bt_self_component_status bt_component_accept_port_connection(
                struct bt_port *other_port)
 {
        typedef enum bt_self_component_status (*method_t)(
-               void *, void *, void *);
+               void *, void *, const void *);
 
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
        method_t method = NULL;
@@ -628,7 +631,7 @@ enum bt_self_component_status bt_component_accept_port_connection(
                BT_LIB_LOGD("Calling user's \"accept port connection\" method: "
                        "%![comp-]+c, %![self-port-]+p, %![other-port-]+p",
                        comp, self_port, other_port);
-               status = method(comp, self_port, other_port);
+               status = method(comp, self_port, (void *) other_port);
                BT_LOGD("User method returned: status=%s",
                        bt_self_component_status_string(status));
        }
@@ -642,7 +645,7 @@ enum bt_self_component_status bt_component_port_connected(
                struct bt_port *other_port)
 {
        typedef enum bt_self_component_status (*method_t)(
-               void *, void *, void *);
+               void *, void *, const void *);
 
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
        method_t method = NULL;
@@ -705,7 +708,7 @@ enum bt_self_component_status bt_component_port_connected(
                BT_LIB_LOGD("Calling user's \"port connected\" method: "
                        "%![comp-]+c, %![self-port-]+p, %![other-port-]+p",
                        comp, self_port, other_port);
-               status = method(comp, self_port, other_port);
+               status = method(comp, self_port, (void *) other_port);
                BT_LOGD("User method returned: status=%s",
                        bt_self_component_status_string(status));
        }
index 655b36c9f6ab632b5f2af2b3c0a6f62fc6042f60..50e558b48007168296922a568a7cd3b9530dec7d 100644 (file)
@@ -28,6 +28,7 @@
 #include <babeltrace/graph/notification-iterator-internal.h>
 #include <babeltrace/graph/component-internal.h>
 #include <babeltrace/graph/connection-internal.h>
+#include <babeltrace/graph/connection-const.h>
 #include <babeltrace/graph/graph-internal.h>
 #include <babeltrace/graph/port-internal.h>
 #include <babeltrace/object-internal.h>
@@ -180,7 +181,8 @@ void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph)
        if (downstream_port) {
                BT_LIB_LOGD("Disconnecting connection's downstream port: %!+p",
                        downstream_port);
-               downstream_comp = bt_port_borrow_component(downstream_port);
+               downstream_comp = bt_port_borrow_component_inline(
+                       downstream_port);
                bt_port_set_connection(downstream_port, NULL);
                conn->downstream_port = NULL;
        }
@@ -188,7 +190,8 @@ void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph)
        if (upstream_port) {
                BT_LIB_LOGD("Disconnecting connection's upstream port: %!+p",
                        upstream_port);
-               upstream_comp = bt_port_borrow_component(upstream_port);
+               upstream_comp = bt_port_borrow_component_inline(
+                       upstream_port);
                bt_port_set_connection(upstream_port, NULL);
                conn->upstream_port = NULL;
        }
@@ -254,15 +257,15 @@ void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph)
        }
 }
 
-struct bt_port_output *bt_connection_borrow_upstream_port(
-               struct bt_connection *connection)
+const struct bt_port_output *bt_connection_borrow_upstream_port_const(
+               const struct bt_connection *connection)
 {
        BT_ASSERT_PRE_NON_NULL(connection, "Connection");
        return (void *) connection->upstream_port;
 }
 
-struct bt_port_input *bt_connection_borrow_downstream_port(
-               struct bt_connection *connection)
+const struct bt_port_input *bt_connection_borrow_downstream_port_const(
+               const struct bt_connection *connection)
 {
        BT_ASSERT_PRE_NON_NULL(connection, "Connection");
        return (void *) connection->downstream_port;
@@ -278,7 +281,7 @@ void bt_connection_remove_iterator(struct bt_connection *conn,
        try_remove_connection_from_graph(conn);
 }
 
-bt_bool bt_connection_is_ended(struct bt_connection *connection)
+bt_bool bt_connection_is_ended(const struct bt_connection *connection)
 {
        return !connection->downstream_port && !connection->upstream_port;
 }
index f624e65927d7d319eded63d085264829bf20515b..3ba2321e5572c72a31f49af76469995ba62fb2f0 100644 (file)
 #include <babeltrace/lib-logging-internal.h>
 
 #include <babeltrace/graph/component-internal.h>
-#include <babeltrace/graph/private-graph.h>
+#include <babeltrace/graph/graph.h>
+#include <babeltrace/graph/graph-const.h>
 #include <babeltrace/graph/graph-internal.h>
 #include <babeltrace/graph/connection-internal.h>
 #include <babeltrace/graph/component-sink-internal.h>
-#include <babeltrace/graph/component-source.h>
-#include <babeltrace/graph/component-filter.h>
-#include <babeltrace/graph/port.h>
+#include <babeltrace/graph/component-source-const.h>
+#include <babeltrace/graph/component-filter-const.h>
+#include <babeltrace/graph/port-const.h>
 #include <babeltrace/graph/notification-internal.h>
 #include <babeltrace/graph/notification-event-internal.h>
 #include <babeltrace/graph/notification-packet-internal.h>
 #include <unistd.h>
 #include <glib.h>
 
-typedef void (*port_added_func_t)(void *, void *, void *);
-typedef void (*port_removed_func_t)(void *, void *, void *);
-typedef void (*ports_connected_func_t)(void *, void *, void *, void *, void *);
-typedef void (*ports_disconnected_func_t)(void *, void *, void *, void *, void *);
-typedef enum bt_self_component_status (*comp_init_method_t)(void *, const void *, void *);
+typedef void (*port_added_func_t)(const void *, const void *, void *);
+
+typedef void (*port_removed_func_t)(const void *, const void *, void *);
+
+typedef void (*ports_connected_func_t)(const void *, const void *, const void *,
+               const void *, void *);
+
+typedef void (*ports_disconnected_func_t)(const void *, const void *,
+               const void *, const void *, void *);
+
+typedef enum bt_self_component_status (*comp_init_method_t)(const void *,
+               const void *, void *);
 
 struct bt_graph_listener {
-       bt_private_graph_listener_removed removed;
+       bt_graph_listener_removed_func removed;
        void *data;
 };
 
@@ -103,8 +111,7 @@ struct bt_graph_listener_ports_disconnected {
 static
 void destroy_graph(struct bt_object *obj)
 {
-       struct bt_graph *graph = container_of(obj,
-                       struct bt_graph, base);
+       struct bt_graph *graph = container_of(obj, struct bt_graph, base);
 
        /*
         * The graph's reference count is 0 if we're here. Increment
@@ -139,7 +146,7 @@ void destroy_graph(struct bt_object *obj)
         * Cancel the graph to disallow some operations, like creating
         * notification iterators and adding ports to components.
         */
-       (void) bt_private_graph_cancel((void *) graph);
+       (void) bt_graph_cancel((void *) graph);
 
        /* Call all remove listeners */
        CALL_REMOVE_LISTENERS(struct bt_graph_listener_port_added,
@@ -302,7 +309,7 @@ void notify_notification_graph_is_destroyed(struct bt_notification *notif)
        bt_notification_unlink_graph(notif);
 }
 
-struct bt_private_graph *bt_private_graph_create(void)
+struct bt_graph *bt_graph_create(void)
 {
        struct bt_graph *graph;
        int ret;
@@ -488,13 +495,12 @@ error:
        goto end;
 }
 
-enum bt_graph_status bt_private_graph_connect_ports(
-               struct bt_private_graph *priv_graph,
-               struct bt_port_output *upstream_port_out,
-               struct bt_port_input *downstream_port_in,
-               struct bt_connection **user_connection)
+enum bt_graph_status bt_graph_connect_ports(
+               struct bt_graph *graph,
+               const struct bt_port_output *upstream_port_out,
+               const struct bt_port_input *downstream_port_in,
+               const struct bt_connection **user_connection)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        enum bt_graph_status status = BT_GRAPH_STATUS_OK;
        struct bt_connection *connection = NULL;
        struct bt_port *upstream_port = (void *) upstream_port_out;
@@ -512,10 +518,10 @@ enum bt_graph_status bt_private_graph_connect_ports(
                "Upstream port is already connected: %!+p", upstream_port);
        BT_ASSERT_PRE(!bt_port_is_connected(downstream_port),
                "Downstream port is already connected: %!+p", downstream_port);
-       BT_ASSERT_PRE(bt_port_borrow_component((void *) upstream_port),
+       BT_ASSERT_PRE(bt_port_borrow_component_inline((void *) upstream_port),
                "Upstream port does not belong to a component: %!+p",
                upstream_port);
-       BT_ASSERT_PRE(bt_port_borrow_component((void *) downstream_port),
+       BT_ASSERT_PRE(bt_port_borrow_component_inline((void *) downstream_port),
                "Downstream port does not belong to a component: %!+p",
                downstream_port);
        init_can_consume = graph->can_consume;
@@ -523,9 +529,9 @@ enum bt_graph_status bt_private_graph_connect_ports(
                "%![graph-]+g, %![up-port-]+p, %![down-port-]+p",
                graph, upstream_port, downstream_port);
        bt_graph_set_can_consume(graph, false);
-       upstream_component = bt_port_borrow_component(
+       upstream_component = bt_port_borrow_component_inline(
                (void *) upstream_port);
-       downstream_component = bt_port_borrow_component(
+       downstream_component = bt_port_borrow_component_inline(
                (void *) downstream_port);
 
        /*
@@ -771,10 +777,9 @@ end:
        return status;
 }
 
-enum bt_graph_status bt_private_graph_consume(
-               struct bt_private_graph *priv_graph)
+enum bt_graph_status bt_graph_consume(
+               struct bt_graph *graph)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        enum bt_graph_status status;
 
        BT_ASSERT_PRE_NON_NULL(graph, "Graph");
@@ -787,9 +792,8 @@ enum bt_graph_status bt_private_graph_consume(
        return status;
 }
 
-enum bt_graph_status bt_private_graph_run(struct bt_private_graph *priv_graph)
+enum bt_graph_status bt_graph_run(struct bt_graph *graph)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        enum bt_graph_status status = BT_GRAPH_STATUS_OK;
 
        BT_ASSERT_PRE_NON_NULL(graph, "Graph");
@@ -822,7 +826,7 @@ enum bt_graph_status bt_private_graph_run(struct bt_private_graph *priv_graph)
                         *
                         * However, in the case where a single sink is
                         * left, the caller can decide to busy-wait and
-                        * call bt_private_graph_run() continuously
+                        * call bt_graph_run() continuously
                         * until the source is ready or it can decide to
                         * sleep for an arbitrary amount of time.
                         */
@@ -846,13 +850,12 @@ end:
 }
 
 enum bt_graph_status
-bt_private_graph_add_source_component_output_port_added_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_source_component_output_port_added_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_source_component_output_port_added_listener(
+               struct bt_graph *graph,
+               bt_graph_source_component_output_port_added_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_port_added listener = {
                .base = {
                        .removed = listener_removed,
@@ -882,13 +885,12 @@ bt_private_graph_add_source_component_output_port_added_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_filter_component_output_port_added_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_filter_component_output_port_added_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_filter_component_output_port_added_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_component_output_port_added_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_port_added listener = {
                .base = {
                        .removed = listener_removed,
@@ -918,13 +920,12 @@ bt_private_graph_add_filter_component_output_port_added_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_filter_component_input_port_added_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_filter_component_input_port_added_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_filter_component_input_port_added_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_component_input_port_added_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_port_added listener = {
                .base = {
                        .removed = listener_removed,
@@ -954,13 +955,12 @@ bt_private_graph_add_filter_component_input_port_added_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_sink_component_input_port_added_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_sink_component_input_port_added_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_sink_component_input_port_added_listener(
+               struct bt_graph *graph,
+               bt_graph_sink_component_input_port_added_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_port_added listener = {
                .base = {
                        .removed = listener_removed,
@@ -990,13 +990,12 @@ bt_private_graph_add_sink_component_input_port_added_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_source_component_output_port_removed_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_source_component_output_port_removed_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_source_component_output_port_removed_listener(
+               struct bt_graph *graph,
+               bt_graph_source_component_output_port_removed_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_port_removed listener = {
                .base = {
                        .removed = listener_removed,
@@ -1026,13 +1025,12 @@ bt_private_graph_add_source_component_output_port_removed_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_filter_component_output_port_removed_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_filter_component_output_port_removed_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_filter_component_output_port_removed_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_component_output_port_removed_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_port_removed listener = {
                .base = {
                        .removed = listener_removed,
@@ -1062,13 +1060,12 @@ bt_private_graph_add_filter_component_output_port_removed_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_filter_component_input_port_removed_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_filter_component_input_port_removed_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_filter_component_input_port_removed_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_component_input_port_removed_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_port_removed listener = {
                .base = {
                        .removed = listener_removed,
@@ -1098,13 +1095,12 @@ bt_private_graph_add_filter_component_input_port_removed_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_sink_component_input_port_removed_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_sink_component_input_port_removed_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_sink_component_input_port_removed_listener(
+               struct bt_graph *graph,
+               bt_graph_sink_component_input_port_removed_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_port_removed listener = {
                .base = {
                        .removed = listener_removed,
@@ -1134,13 +1130,12 @@ bt_private_graph_add_sink_component_input_port_removed_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_source_filter_component_ports_connected_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_source_filter_component_ports_connected_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_source_filter_component_ports_connected_listener(
+               struct bt_graph *graph,
+               bt_graph_source_filter_component_ports_connected_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_ports_connected listener = {
                .base = {
                        .removed = listener_removed,
@@ -1171,13 +1166,12 @@ bt_private_graph_add_source_filter_component_ports_connected_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_source_sink_component_ports_connected_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_source_sink_component_ports_connected_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_source_sink_component_ports_connected_listener(
+               struct bt_graph *graph,
+               bt_graph_source_sink_component_ports_connected_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_ports_connected listener = {
                .base = {
                        .removed = listener_removed,
@@ -1208,13 +1202,12 @@ bt_private_graph_add_source_sink_component_ports_connected_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_filter_sink_component_ports_connected_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_filter_sink_component_ports_connected_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_filter_sink_component_ports_connected_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_sink_component_ports_connected_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_ports_connected listener = {
                .base = {
                        .removed = listener_removed,
@@ -1245,13 +1238,12 @@ bt_private_graph_add_filter_sink_component_ports_connected_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_source_filter_component_ports_disconnected_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_source_filter_component_ports_disconnected_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_source_filter_component_ports_disconnected_listener(
+               struct bt_graph *graph,
+               bt_graph_source_filter_component_ports_disconnected_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_ports_disconnected listener = {
                .base = {
                        .removed = listener_removed,
@@ -1282,13 +1274,12 @@ bt_private_graph_add_source_filter_component_ports_disconnected_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_source_sink_component_ports_disconnected_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_source_sink_component_ports_disconnected_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_source_sink_component_ports_disconnected_listener(
+               struct bt_graph *graph,
+               bt_graph_source_sink_component_ports_disconnected_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_ports_disconnected listener = {
                .base = {
                        .removed = listener_removed,
@@ -1319,13 +1310,12 @@ bt_private_graph_add_source_sink_component_ports_disconnected_listener(
 }
 
 enum bt_graph_status
-bt_private_graph_add_filter_sink_component_ports_disconnected_listener(
-               struct bt_private_graph *priv_graph,
-               bt_private_graph_filter_sink_component_ports_disconnected_listener func,
-               bt_private_graph_listener_removed listener_removed, void *data,
+bt_graph_add_filter_sink_component_ports_disconnected_listener(
+               struct bt_graph *graph,
+               bt_graph_filter_sink_component_ports_disconnected_listener_func func,
+               bt_graph_listener_removed_func listener_removed, void *data,
                int *out_listener_id)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        struct bt_graph_listener_ports_disconnected listener = {
                .base = {
                        .removed = listener_removed,
@@ -1366,7 +1356,7 @@ void bt_graph_notify_port_added(struct bt_graph *graph, struct bt_port *port)
        BT_ASSERT(port);
        BT_LIB_LOGV("Notifying graph listeners that a port was added: "
                "%![graph-]+g, %![port-]+p", graph, port);
-       comp = bt_port_borrow_component(port);
+       comp = bt_port_borrow_component_inline(port);
        BT_ASSERT(comp);
 
        switch (comp->class->type) {
@@ -1504,9 +1494,9 @@ void bt_graph_notify_ports_connected(struct bt_graph *graph,
        BT_LIB_LOGV("Notifying graph listeners that ports were connected: "
                "%![graph-]+g, %![up-port-]+p, %![down-port-]+p",
                graph, upstream_port, downstream_port);
-       upstream_comp = bt_port_borrow_component(upstream_port);
+       upstream_comp = bt_port_borrow_component_inline(upstream_port);
        BT_ASSERT(upstream_comp);
-       downstream_comp = bt_port_borrow_component(downstream_port);
+       downstream_comp = bt_port_borrow_component_inline(downstream_port);
        BT_ASSERT(downstream_comp);
 
        switch (upstream_comp->class->type) {
@@ -1622,10 +1612,9 @@ void bt_graph_notify_ports_disconnected(struct bt_graph *graph,
        }
 }
 
-enum bt_graph_status bt_private_graph_cancel(
-               struct bt_private_graph *priv_graph)
+enum bt_graph_status bt_graph_cancel(
+               struct bt_graph *graph)
 {
-       struct bt_graph *graph = (void *) priv_graph;
 
        BT_ASSERT_PRE_NON_NULL(graph, "Graph");
        graph->canceled = true;
@@ -1633,7 +1622,7 @@ enum bt_graph_status bt_private_graph_cancel(
        return BT_GRAPH_STATUS_OK;
 }
 
-bt_bool bt_graph_is_canceled(struct bt_graph *graph)
+bt_bool bt_graph_is_canceled(const struct bt_graph *graph)
 {
        BT_ASSERT_PRE_NON_NULL(graph, "Graph");
        return graph->canceled ? BT_TRUE : BT_FALSE;
@@ -1675,13 +1664,12 @@ end:
 
 static
 enum bt_graph_status add_component_with_init_method_data(
-               struct bt_private_graph *priv_graph,
+               struct bt_graph *graph,
                struct bt_component_class *comp_cls,
                comp_init_method_t init_method,
                const char *name, const struct bt_value *params,
                void *init_method_data, struct bt_component **user_component)
 {
-       struct bt_graph *graph = (void *) priv_graph;
        enum bt_graph_status graph_status = BT_GRAPH_STATUS_OK;
        enum bt_self_component_status comp_status;
        struct bt_component *component = NULL;
@@ -1786,11 +1774,12 @@ end:
 }
 
 enum bt_graph_status
-bt_private_graph_add_source_component_with_init_method_data(
-               struct bt_private_graph *graph,
-               struct bt_component_class_source *comp_cls,
+bt_graph_add_source_component_with_init_method_data(
+               struct bt_graph *graph,
+               const struct bt_component_class_source *comp_cls,
                const char *name, const struct bt_value *params,
-               void *init_method_data, struct bt_component_source **component)
+               void *init_method_data,
+               const struct bt_component_source **component)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        return add_component_with_init_method_data(graph,
@@ -1798,22 +1787,23 @@ bt_private_graph_add_source_component_with_init_method_data(
                name, params, init_method_data, (void *) component);
 }
 
-enum bt_graph_status bt_private_graph_add_source_component(
-               struct bt_private_graph *graph,
-               struct bt_component_class_source *comp_cls,
+enum bt_graph_status bt_graph_add_source_component(
+               struct bt_graph *graph,
+               const struct bt_component_class_source *comp_cls,
                const char *name, const struct bt_value *params,
-               struct bt_component_source **component)
+               const struct bt_component_source **component)
 {
-       return bt_private_graph_add_source_component_with_init_method_data(
+       return bt_graph_add_source_component_with_init_method_data(
                graph, comp_cls, name, params, NULL, component);
 }
 
 enum bt_graph_status
-bt_private_graph_add_filter_component_with_init_method_data(
-               struct bt_private_graph *graph,
-               struct bt_component_class_filter *comp_cls,
+bt_graph_add_filter_component_with_init_method_data(
+               struct bt_graph *graph,
+               const struct bt_component_class_filter *comp_cls,
                const char *name, const struct bt_value *params,
-               void *init_method_data, struct bt_component_filter **component)
+               void *init_method_data,
+               const struct bt_component_filter **component)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        return add_component_with_init_method_data(graph,
@@ -1821,22 +1811,23 @@ bt_private_graph_add_filter_component_with_init_method_data(
                name, params, init_method_data, (void *) component);
 }
 
-enum bt_graph_status bt_private_graph_add_filter_component(
-               struct bt_private_graph *graph,
-               struct bt_component_class_filter *comp_cls,
+enum bt_graph_status bt_graph_add_filter_component(
+               struct bt_graph *graph,
+               const struct bt_component_class_filter *comp_cls,
                const char *name, const struct bt_value *params,
-               struct bt_component_filter **component)
+               const struct bt_component_filter **component)
 {
-       return bt_private_graph_add_filter_component_with_init_method_data(
+       return bt_graph_add_filter_component_with_init_method_data(
                graph, comp_cls, name, params, NULL, component);
 }
 
 enum bt_graph_status
-bt_private_graph_add_sink_component_with_init_method_data(
-               struct bt_private_graph *graph,
-               struct bt_component_class_sink *comp_cls,
+bt_graph_add_sink_component_with_init_method_data(
+               struct bt_graph *graph,
+               const struct bt_component_class_sink *comp_cls,
                const char *name, const struct bt_value *params,
-               void *init_method_data, struct bt_component_sink **component)
+               void *init_method_data,
+               const struct bt_component_sink **component)
 {
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        return add_component_with_init_method_data(graph,
@@ -1844,13 +1835,13 @@ bt_private_graph_add_sink_component_with_init_method_data(
                name, params, init_method_data, (void *) component);
 }
 
-enum bt_graph_status bt_private_graph_add_sink_component(
-               struct bt_private_graph *graph,
-               struct bt_component_class_sink *comp_cls,
+enum bt_graph_status bt_graph_add_sink_component(
+               struct bt_graph *graph,
+               const struct bt_component_class_sink *comp_cls,
                const char *name, const struct bt_value *params,
-               struct bt_component_sink **component)
+               const struct bt_component_sink **component)
 {
-       return bt_private_graph_add_sink_component_with_init_method_data(
+       return bt_graph_add_sink_component_with_init_method_data(
                graph, comp_cls, name, params, NULL, component);
 }
 
index 82f6957155024a4ca9fc5cf78743eb6e5a8935d7..56b688046c5a746c4a33d663dc4b7b5af0f7de16 100644 (file)
 #include <babeltrace/trace-ir/packet-const.h>
 #include <babeltrace/trace-ir/packet-internal.h>
 #include <babeltrace/trace-ir/stream-internal.h>
-#include <babeltrace/graph/connection.h>
+#include <babeltrace/graph/connection-const.h>
 #include <babeltrace/graph/connection-internal.h>
-#include <babeltrace/graph/component.h>
+#include <babeltrace/graph/component-const.h>
 #include <babeltrace/graph/component-internal.h>
 #include <babeltrace/graph/component-source-internal.h>
 #include <babeltrace/graph/component-class-internal.h>
 #include <babeltrace/graph/component-class-sink-colander-internal.h>
-#include <babeltrace/graph/component-sink.h>
-#include <babeltrace/graph/notification.h>
+#include <babeltrace/graph/component-sink-const.h>
+#include <babeltrace/graph/notification-const.h>
 #include <babeltrace/graph/notification-iterator.h>
 #include <babeltrace/graph/notification-iterator-internal.h>
 #include <babeltrace/graph/self-component-port-input-notification-iterator.h>
 #include <babeltrace/graph/port-output-notification-iterator.h>
 #include <babeltrace/graph/notification-internal.h>
-#include <babeltrace/graph/notification-event.h>
+#include <babeltrace/graph/notification-event-const.h>
 #include <babeltrace/graph/notification-event-internal.h>
-#include <babeltrace/graph/notification-packet.h>
+#include <babeltrace/graph/notification-packet-const.h>
 #include <babeltrace/graph/notification-packet-internal.h>
-#include <babeltrace/graph/notification-stream.h>
+#include <babeltrace/graph/notification-stream-const.h>
 #include <babeltrace/graph/notification-stream-internal.h>
-#include <babeltrace/graph/port.h>
-#include <babeltrace/graph/private-graph.h>
+#include <babeltrace/graph/port-const.h>
+#include <babeltrace/graph/graph.h>
+#include <babeltrace/graph/graph-const.h>
 #include <babeltrace/graph/graph-internal.h>
 #include <babeltrace/types.h>
 #include <babeltrace/assert-internal.h>
@@ -360,7 +361,7 @@ bt_self_component_port_input_notification_iterator_create(
        struct bt_component_class *upstream_comp_cls;
 
        BT_ASSERT_PRE_NON_NULL(port, "Port");
-       comp = bt_port_borrow_component(port);
+       comp = bt_port_borrow_component_inline(port);
        BT_ASSERT_PRE(bt_port_is_connected(port),
                "Port is not connected: %![port-]+p", port);
        BT_ASSERT_PRE(comp, "Port is not part of a component: %![port-]+p",
@@ -371,7 +372,7 @@ bt_self_component_port_input_notification_iterator_create(
        BT_ASSERT(port->connection);
        upstream_port = port->connection->upstream_port;
        BT_ASSERT(upstream_port);
-       upstream_comp = bt_port_borrow_component(upstream_port);
+       upstream_comp = bt_port_borrow_component_inline(upstream_port);
        BT_ASSERT(upstream_comp);
        upstream_comp_cls = upstream_comp->class;
        BT_ASSERT(upstream_comp->class->type ==
@@ -435,7 +436,7 @@ end:
 }
 
 void *bt_self_notification_iterator_get_data(
-               struct bt_self_notification_iterator *self_iterator)
+               const struct bt_self_notification_iterator *self_iterator)
 {
        struct bt_self_component_port_input_notification_iterator *iterator =
                (void *) self_iterator;
@@ -458,7 +459,7 @@ void bt_self_notification_iterator_set_data(
 
 BT_ASSERT_PRE_FUNC
 static inline
-void bt_notification_borrow_packet_stream(struct bt_notification *notif,
+void bt_notification_borrow_packet_stream(const struct bt_notification *notif,
                const struct bt_stream **stream,
                const struct bt_packet **packet)
 {
@@ -467,21 +468,21 @@ void bt_notification_borrow_packet_stream(struct bt_notification *notif,
        switch (notif->type) {
        case BT_NOTIFICATION_TYPE_EVENT:
                *packet = bt_event_borrow_packet_const(
-                       bt_notification_event_borrow_event(notif));
+                       bt_notification_event_borrow_event_const(notif));
                *stream = bt_packet_borrow_stream_const(*packet);
                break;
        case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
-               *stream = bt_notification_stream_begin_borrow_stream(notif);
+               *stream = bt_notification_stream_begin_borrow_stream_const(notif);
                break;
        case BT_NOTIFICATION_TYPE_STREAM_END:
-               *stream = bt_notification_stream_end_borrow_stream(notif);
+               *stream = bt_notification_stream_end_borrow_stream_const(notif);
                break;
        case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
-               *packet = bt_notification_packet_begin_borrow_packet(notif);
+               *packet = bt_notification_packet_begin_borrow_packet_const(notif);
                *stream = bt_packet_borrow_stream_const(*packet);
                break;
        case BT_NOTIFICATION_TYPE_PACKET_END:
-               *packet = bt_notification_packet_end_borrow_packet(notif);
+               *packet = bt_notification_packet_end_borrow_packet_const(notif);
                *stream = bt_packet_borrow_stream_const(*packet);
                break;
        default:
@@ -493,15 +494,16 @@ BT_ASSERT_PRE_FUNC
 static inline
 bool validate_notification(
                struct bt_self_component_port_input_notification_iterator *iterator,
-               struct bt_notification *notif)
+               const struct bt_notification *c_notif)
 {
        bool is_valid = true;
        struct stream_state *stream_state;
        const struct bt_stream *stream = NULL;
        const struct bt_packet *packet = NULL;
+       struct bt_notification *notif = (void *) c_notif;
 
        BT_ASSERT(notif);
-       bt_notification_borrow_packet_stream(notif, &stream, &packet);
+       bt_notification_borrow_packet_stream(c_notif, &stream, &packet);
 
        if (!stream) {
                /* we don't care about notifications not attached to streams */
@@ -515,7 +517,7 @@ bool validate_notification(
                 * MUST be a BT_NOTIFICATION_TYPE_STREAM_BEGIN notification
                 * and its sequence number must be 0.
                 */
-               if (notif->type != BT_NOTIFICATION_TYPE_STREAM_BEGIN) {
+               if (c_notif->type != BT_NOTIFICATION_TYPE_STREAM_BEGIN) {
                        BT_ASSERT_PRE_MSG("Unexpected notification: missing a "
                                "BT_NOTIFICATION_TYPE_STREAM_BEGIN "
                                "notification prior to this notification: "
@@ -524,17 +526,17 @@ bool validate_notification(
                        goto end;
                }
 
-               if (notif->seq_num == -1ULL) {
+               if (c_notif->seq_num == -1ULL) {
                        notif->seq_num = 0;
                }
 
-               if (notif->seq_num != 0) {
+               if (c_notif->seq_num != 0) {
                        BT_ASSERT_PRE_MSG("Unexpected notification sequence "
                                "number for this notification iterator: "
                                "this is the first notification for this "
                                "stream, expecting sequence number 0: "
                                "seq-num=%" PRIu64 ", %![stream-]+s",
-                               notif->seq_num, stream);
+                               c_notif->seq_num, stream);
                        is_valid = false;
                        goto end;
                }
@@ -564,26 +566,26 @@ bool validate_notification(
                goto end;
        }
 
-       if (notif->seq_num == -1ULL) {
+       if (c_notif->seq_num == -1ULL) {
                notif->seq_num = stream_state->expected_notif_seq_num;
        }
 
-       if (notif->seq_num != -1ULL &&
-                       notif->seq_num != stream_state->expected_notif_seq_num) {
+       if (c_notif->seq_num != -1ULL &&
+                       c_notif->seq_num != stream_state->expected_notif_seq_num) {
                BT_ASSERT_PRE_MSG("Unexpected notification sequence number: "
                        "seq-num=%" PRIu64 ", "
                        "expected-seq-num=%" PRIu64 ", %![stream-]+s",
-                       notif->seq_num, stream_state->expected_notif_seq_num,
+                       c_notif->seq_num, stream_state->expected_notif_seq_num,
                        stream);
                is_valid = false;
                goto end;
        }
 
-       switch (notif->type) {
+       switch (c_notif->type) {
        case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
                BT_ASSERT_PRE_MSG("Unexpected BT_NOTIFICATION_TYPE_STREAM_BEGIN "
                        "notification at this point: notif-seq-num=%" PRIu64 ", "
-                       "%![stream-]+s", notif->seq_num, stream);
+                       "%![stream-]+s", c_notif->seq_num, stream);
                is_valid = false;
                goto end;
        case BT_NOTIFICATION_TYPE_STREAM_END:
@@ -593,7 +595,7 @@ bool validate_notification(
                                "BT_NOTIFICATION_TYPE_PACKET_END notification "
                                "prior to this notification: "
                                "notif-seq-num=%" PRIu64 ", "
-                               "%![stream-]+s", notif->seq_num, stream);
+                               "%![stream-]+s", c_notif->seq_num, stream);
                        is_valid = false;
                        goto end;
                }
@@ -607,7 +609,7 @@ bool validate_notification(
                                "BT_NOTIFICATION_TYPE_PACKET_END notification "
                                "prior to this notification: "
                                "notif-seq-num=%" PRIu64 ", %![stream-]+s, "
-                               "%![packet-]+a", notif->seq_num, stream,
+                               "%![packet-]+a", c_notif->seq_num, stream,
                                packet);
                        is_valid = false;
                        goto end;
@@ -623,7 +625,7 @@ bool validate_notification(
                                "BT_NOTIFICATION_TYPE_PACKET_BEGIN notification "
                                "prior to this notification: "
                                "notif-seq-num=%" PRIu64 ", %![stream-]+s, "
-                               "%![packet-]+a", notif->seq_num, stream,
+                               "%![packet-]+a", c_notif->seq_num, stream,
                                packet);
                        is_valid = false;
                        goto end;
@@ -637,7 +639,7 @@ bool validate_notification(
                                "BT_NOTIFICATION_TYPE_EVENT notification: "
                                "notif-seq-num=%" PRIu64 ", %![stream-]+s, "
                                "%![notif-packet-]+a, %![expected-packet-]+a",
-                               notif->seq_num, stream,
+                               c_notif->seq_num, stream,
                                stream_state->cur_packet, packet);
                        is_valid = false;
                        goto end;
@@ -659,7 +661,8 @@ bool validate_notifications(
                uint64_t count)
 {
        bool ret = true;
-       bt_notification_array notifs = (void *) iterator->base.notifs->pdata;
+       bt_notification_array_const notifs =
+               (void *) iterator->base.notifs->pdata;
        uint64_t i;
 
        for (i = 0; i < count; i++) {
@@ -673,7 +676,7 @@ bool validate_notifications(
 }
 
 BT_ASSERT_PRE_FUNC
-static inline bool priv_conn_notif_iter_can_end(
+static inline bool self_comp_port_input_notif_iter_can_end(
                struct bt_self_component_port_input_notification_iterator *iterator)
 {
        GHashTableIter iter;
@@ -710,10 +713,10 @@ end:
 enum bt_notification_iterator_status
 bt_self_component_port_input_notification_iterator_next(
                struct bt_self_component_port_input_notification_iterator *iterator,
-               bt_notification_array *notifs, uint64_t *user_count)
+               bt_notification_array_const *notifs, uint64_t *user_count)
 {
        typedef enum bt_self_notification_iterator_status (*method_t)(
-                       void *, bt_notification_array, uint64_t, uint64_t *);
+                       void *, bt_notification_array_const, uint64_t, uint64_t *);
 
        method_t method = NULL;
        struct bt_component_class *comp_cls;
@@ -786,7 +789,7 @@ bt_self_component_port_input_notification_iterator_next(
                 */
                if (status == BT_NOTIFICATION_ITERATOR_STATUS_OK) {
                        uint64_t i;
-                       bt_notification_array notifs =
+                       bt_notification_array_const notifs =
                                (void *) iterator->base.notifs->pdata;
 
                        for (i = 0; i < *user_count; i++) {
@@ -809,7 +812,7 @@ bt_self_component_port_input_notification_iterator_next(
        case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN:
                goto end;
        case BT_NOTIFICATION_ITERATOR_STATUS_END:
-               BT_ASSERT_PRE(priv_conn_notif_iter_can_end(iterator),
+               BT_ASSERT_PRE(self_comp_port_input_notif_iter_can_end(iterator),
                        "Notification iterator cannot end at this point: "
                        "%!+i", iterator);
                BT_ASSERT(iterator->state ==
@@ -830,7 +833,7 @@ end:
 enum bt_notification_iterator_status
 bt_port_output_notification_iterator_next(
                struct bt_port_output_notification_iterator *iterator,
-               bt_notification_array *notifs_to_user,
+               bt_notification_array_const *notifs_to_user,
                uint64_t *count_to_user)
 {
        enum bt_notification_iterator_status status;
@@ -913,14 +916,13 @@ void bt_port_output_notification_iterator_destroy(struct bt_object *obj)
 
 struct bt_port_output_notification_iterator *
 bt_port_output_notification_iterator_create(
-               struct bt_private_graph *priv_graph,
-               struct bt_port_output *output_port)
+               struct bt_graph *graph,
+               const struct bt_port_output *output_port)
 {
        struct bt_port_output_notification_iterator *iterator = NULL;
        struct bt_component_class_sink *colander_comp_cls = NULL;
        struct bt_component *output_port_comp = NULL;
        struct bt_component_sink *colander_comp;
-       struct bt_graph *graph = (void *) priv_graph;
        enum bt_graph_status graph_status;
        struct bt_port_input *colander_in_port = NULL;
        struct bt_component_class_sink_colander_data colander_data;
@@ -928,7 +930,8 @@ bt_port_output_notification_iterator_create(
 
        BT_ASSERT_PRE_NON_NULL(graph, "Graph");
        BT_ASSERT_PRE_NON_NULL(output_port, "Output port");
-       output_port_comp = bt_port_borrow_component((void *) output_port);
+       output_port_comp = bt_port_borrow_component_inline(
+               (const void *) output_port);
        BT_ASSERT_PRE(output_port_comp,
                "Output port has no component: %!+p", output_port);
        BT_ASSERT_PRE(bt_component_borrow_graph(output_port_comp) ==
@@ -968,10 +971,10 @@ bt_port_output_notification_iterator_create(
 
        /* Hope that nobody uses this very unique name */
        graph_status =
-               bt_private_graph_add_sink_component_with_init_method_data(
+               bt_graph_add_sink_component_with_init_method_data(
                        (void *) graph, colander_comp_cls,
                        "colander-36ac3409-b1a8-4d60-ab1f-4fdf341a8fb1",
-                       NULL, &colander_data, &iterator->colander);
+                       NULL, &colander_data, (void *) &iterator->colander);
        if (graph_status != BT_GRAPH_STATUS_OK) {
                BT_LIB_LOGW("Cannot add colander sink component to graph: "
                        "%1[graph-]+g, status=%s", graph,
@@ -983,10 +986,11 @@ bt_port_output_notification_iterator_create(
         * Connect provided output port to the colander component's
         * input port.
         */
-       colander_in_port = bt_component_sink_borrow_input_port_by_index(
-               iterator->colander, 0);
+       colander_in_port =
+               (void *) bt_component_sink_borrow_input_port_by_index_const(
+                       (void *) iterator->colander, 0);
        BT_ASSERT(colander_in_port);
-       graph_status = bt_private_graph_connect_ports(priv_graph,
+       graph_status = bt_graph_connect_ports(graph,
                output_port, colander_in_port, NULL);
        if (graph_status != BT_GRAPH_STATUS_OK) {
                BT_LIB_LOGW("Cannot add colander sink component to graph: "
index 9b09bc42f4414f200586f2023bd03574af423346..303a65204476b98906afb80f0dbeca17f7b71acb 100644 (file)
@@ -33,7 +33,8 @@
 #include <babeltrace/trace-ir/stream-class-internal.h>
 #include <babeltrace/trace-ir/trace.h>
 #include <babeltrace/graph/graph-internal.h>
-#include <babeltrace/graph/private-notification-event.h>
+#include <babeltrace/graph/notification-event-const.h>
+#include <babeltrace/graph/notification-event.h>
 #include <babeltrace/graph/notification-event-internal.h>
 #include <babeltrace/types.h>
 #include <babeltrace/assert-internal.h>
@@ -75,7 +76,7 @@ end:
        return (void *) notification;
 }
 
-struct bt_private_notification *bt_private_notification_event_create(
+struct bt_notification *bt_notification_event_create(
                struct bt_self_notification_iterator *self_notif_iter,
                struct bt_event_class *event_class,
                struct bt_packet *packet)
@@ -189,14 +190,14 @@ struct bt_event *borrow_event(struct bt_notification *notification)
        return event_notification->event;
 }
 
-struct bt_event *bt_private_notification_event_borrow_event(
-               struct bt_private_notification *notification)
+struct bt_event *bt_notification_event_borrow_event(
+               struct bt_notification *notification)
 {
-       return borrow_event((void *) notification);
+       return borrow_event(notification);
 }
 
-const struct bt_event *bt_notification_event_borrow_event(
-               struct bt_notification *notification)
+const struct bt_event *bt_notification_event_borrow_event_const(
+               const struct bt_notification *notification)
 {
-       return borrow_event(notification);
+       return borrow_event((void *) notification);
 }
index 46adbd8f2257da90613f812b365b6fe519d5d720..97e505655f47094266d271f0dee88827691d3d3a 100644 (file)
@@ -28,7 +28,8 @@
 #include <babeltrace/trace-ir/clock-class.h>
 #include <babeltrace/trace-ir/clock-value-internal.h>
 #include <babeltrace/graph/notification-internal.h>
-#include <babeltrace/graph/private-notification-inactivity.h>
+#include <babeltrace/graph/notification-inactivity-const.h>
+#include <babeltrace/graph/notification-inactivity.h>
 #include <babeltrace/graph/notification-inactivity-internal.h>
 #include <babeltrace/assert-pre-internal.h>
 #include <babeltrace/object.h>
@@ -48,7 +49,7 @@ void bt_notification_inactivity_destroy(struct bt_object *obj)
        g_free(notification);
 }
 
-struct bt_private_notification *bt_private_notification_inactivity_create(
+struct bt_notification *bt_notification_inactivity_create(
                struct bt_self_notification_iterator *self_notif_iter,
                struct bt_clock_class *default_clock_class)
 {
@@ -86,11 +87,9 @@ end:
        return (void *) ret_notif;
 }
 
-void bt_private_notification_inactivity_set_default_clock_value(
-               struct bt_private_notification *priv_notif,
-               uint64_t value_cycles)
+void bt_notification_inactivity_set_default_clock_value(
+               struct bt_notification *notif, uint64_t value_cycles)
 {
-       struct bt_notification *notif = (void *) priv_notif;
        struct bt_notification_inactivity *inactivity = (void *) notif;
 
        BT_ASSERT_PRE_NON_NULL(notif, "Notification");
@@ -101,8 +100,9 @@ void bt_private_notification_inactivity_set_default_clock_value(
                "%![notif-]+n, value=%" PRIu64, notif, value_cycles);
 }
 
-struct bt_clock_value *bt_notification_inactivity_borrow_default_clock_value(
-               struct bt_notification *notif)
+const struct bt_clock_value *
+bt_notification_inactivity_borrow_default_clock_value_const(
+               const struct bt_notification *notif)
 {
        struct bt_notification_inactivity *inactivity = (void *) notif;
 
index 5a835092001e48528857b4d46d0b6ae32b5712e5..3a6090b9265cabc453e38c7629b7c1d9b78702e4 100644 (file)
@@ -25,7 +25,7 @@
 #define BT_LOG_TAG "NOTIF"
 #include <babeltrace/lib-logging-internal.h>
 
-#include <babeltrace/graph/private-notification.h>
+#include <babeltrace/graph/notification-const.h>
 #include <babeltrace/graph/notification-internal.h>
 #include <babeltrace/graph/graph-internal.h>
 #include <babeltrace/assert-internal.h>
@@ -62,7 +62,7 @@ void bt_notification_init(struct bt_notification *notification,
 }
 
 enum bt_notification_type bt_notification_get_type(
-               struct bt_notification *notification)
+               const struct bt_notification *notification)
 {
        BT_ASSERT_PRE_NON_NULL(notification, "Notification");
        return notification->type;
index 6e4a5a1b4a5c3f0636a0fa66b68b296a54de5711..a1750764584bbf7d2b9314cb551f045e54d3b022 100644 (file)
@@ -32,7 +32,8 @@
 #include <babeltrace/trace-ir/stream.h>
 #include <babeltrace/trace-ir/stream-internal.h>
 #include <babeltrace/graph/graph-internal.h>
-#include <babeltrace/graph/private-notification-packet.h>
+#include <babeltrace/graph/notification-packet-const.h>
+#include <babeltrace/graph/notification-packet.h>
 #include <babeltrace/graph/notification-packet-internal.h>
 #include <babeltrace/object.h>
 #include <babeltrace/assert-internal.h>
@@ -64,7 +65,7 @@ end:
        return (void *) notification;
 }
 
-struct bt_private_notification *bt_private_notification_packet_begin_create(
+struct bt_notification *bt_notification_packet_begin_create(
                struct bt_self_notification_iterator *self_notif_iter,
                struct bt_packet *packet)
 {
@@ -137,8 +138,8 @@ void bt_notification_packet_begin_recycle(struct bt_notification *notif)
        bt_object_pool_recycle_object(&graph->packet_begin_notif_pool, notif);
 }
 
-struct bt_packet *bt_private_notification_packet_begin_borrow_packet(
-               struct bt_private_notification *notification)
+struct bt_packet *bt_notification_packet_begin_borrow_packet(
+               struct bt_notification *notification)
 {
        struct bt_notification_packet_begin *packet_begin;
 
@@ -149,10 +150,10 @@ struct bt_packet *bt_private_notification_packet_begin_borrow_packet(
        return packet_begin->packet;
 }
 
-const struct bt_packet *bt_notification_packet_begin_borrow_packet(
-               struct bt_notification *notification)
+const struct bt_packet *bt_notification_packet_begin_borrow_packet_const(
+               const struct bt_notification *notification)
 {
-       return bt_private_notification_packet_begin_borrow_packet(
+       return bt_notification_packet_begin_borrow_packet(
                (void *) notification);
 }
 
@@ -180,7 +181,7 @@ end:
        return (void *) notification;
 }
 
-struct bt_private_notification *bt_private_notification_packet_end_create(
+struct bt_notification *bt_notification_packet_end_create(
                struct bt_self_notification_iterator *self_notif_iter,
                struct bt_packet *packet)
 {
@@ -252,8 +253,8 @@ void bt_notification_packet_end_recycle(struct bt_notification *notif)
        bt_object_pool_recycle_object(&graph->packet_end_notif_pool, notif);
 }
 
-struct bt_packet *bt_private_notification_packet_end_borrow_packet(
-               struct bt_private_notification *notification)
+struct bt_packet *bt_notification_packet_end_borrow_packet(
+               struct bt_notification *notification)
 {
        struct bt_notification_packet_end *packet_end;
 
@@ -264,9 +265,9 @@ struct bt_packet *bt_private_notification_packet_end_borrow_packet(
        return packet_end->packet;
 }
 
-const struct bt_packet *bt_notification_packet_end_borrow_packet(
-               struct bt_notification *notification)
+const struct bt_packet *bt_notification_packet_end_borrow_packet_const(
+               const struct bt_notification *notification)
 {
-       return bt_private_notification_packet_end_borrow_packet(
+       return bt_notification_packet_end_borrow_packet(
                (void *) notification);
 }
index 9c90311286699bb33e3fa2ebe5bd109213ee187f..92336b27318c99572cae8d59a8f4cf1bcb41a8a0 100644 (file)
@@ -30,7 +30,8 @@
 #include <babeltrace/trace-ir/stream-internal.h>
 #include <babeltrace/trace-ir/stream-class.h>
 #include <babeltrace/trace-ir/stream-class-internal.h>
-#include <babeltrace/graph/private-notification-stream.h>
+#include <babeltrace/graph/notification-stream.h>
+#include <babeltrace/graph/notification-stream-const.h>
 #include <babeltrace/graph/notification-stream-internal.h>
 #include <babeltrace/assert-internal.h>
 #include <babeltrace/object.h>
@@ -55,7 +56,7 @@ void bt_notification_stream_end_destroy(struct bt_object *obj)
        g_free(notification);
 }
 
-struct bt_private_notification *bt_private_notification_stream_end_create(
+struct bt_notification *bt_notification_stream_end_create(
                struct bt_self_notification_iterator *self_notif_iter,
                struct bt_stream *stream)
 {
@@ -88,8 +89,8 @@ error:
        return NULL;
 }
 
-struct bt_stream *bt_private_notification_stream_end_borrow_stream(
-               struct bt_private_notification *notification)
+struct bt_stream *bt_notification_stream_end_borrow_stream(
+               struct bt_notification *notification)
 {
        struct bt_notification_stream_end *stream_end;
 
@@ -100,18 +101,16 @@ struct bt_stream *bt_private_notification_stream_end_borrow_stream(
        return stream_end->stream;
 }
 
-const struct bt_stream *bt_notification_stream_end_borrow_stream(
-               struct bt_notification *notification)
+const struct bt_stream *bt_notification_stream_end_borrow_stream_const(
+               const struct bt_notification *notification)
 {
-       return bt_private_notification_stream_end_borrow_stream(
+       return bt_notification_stream_end_borrow_stream(
                (void *) notification);
 }
 
-void bt_private_notification_stream_end_set_default_clock_value(
-               struct bt_private_notification *priv_notif,
-               uint64_t value_cycles)
+void bt_notification_stream_end_set_default_clock_value(
+               struct bt_notification *notif, uint64_t value_cycles)
 {
-       struct bt_notification *notif = (void *) priv_notif;
        struct bt_notification_stream_end *se_notif = (void *) notif;
 
        BT_ASSERT_PRE_NON_NULL(notif, "Notification");
@@ -159,7 +158,7 @@ void bt_notification_stream_begin_destroy(struct bt_object *obj)
        g_free(notification);
 }
 
-struct bt_private_notification *bt_private_notification_stream_begin_create(
+struct bt_notification *bt_notification_stream_begin_create(
                struct bt_self_notification_iterator *self_notif_iter,
                struct bt_stream *stream)
 {
@@ -191,8 +190,8 @@ error:
        return NULL;
 }
 
-struct bt_stream *bt_private_notification_stream_begin_borrow_stream(
-               struct bt_private_notification *notification)
+struct bt_stream *bt_notification_stream_begin_borrow_stream(
+               struct bt_notification *notification)
 {
        struct bt_notification_stream_begin *stream_begin;
 
@@ -203,18 +202,17 @@ struct bt_stream *bt_private_notification_stream_begin_borrow_stream(
        return stream_begin->stream;
 }
 
-const struct bt_stream *bt_notification_stream_begin_borrow_stream(
-               struct bt_notification *notification)
+const struct bt_stream *bt_notification_stream_begin_borrow_stream_const(
+               const struct bt_notification *notification)
 {
-       return bt_private_notification_stream_begin_borrow_stream(
+       return bt_notification_stream_begin_borrow_stream(
                (void *) notification);
 }
 
-void bt_private_notification_stream_begin_set_default_clock_value(
-               struct bt_private_notification *priv_notif,
+void bt_notification_stream_begin_set_default_clock_value(
+               struct bt_notification *notif,
                uint64_t value_cycles)
 {
-       struct bt_notification *notif = (void *) priv_notif;
        struct bt_notification_stream_begin *sb_notif = (void *) notif;
 
        BT_ASSERT_PRE_NON_NULL(notif, "Notification");
index aa8ed98f26f03d865e670ded59fc9b8c459f2278..9c1634dcd95f952722dd0b0a5260eacc3a7cb804 100644 (file)
@@ -25,7 +25,9 @@
 #define BT_LOG_TAG "PORT"
 #include <babeltrace/lib-logging-internal.h>
 
-#include <babeltrace/graph/port.h>
+#include <babeltrace/graph/port-const.h>
+#include <babeltrace/graph/port-input-const.h>
+#include <babeltrace/graph/port-output-const.h>
 #include <babeltrace/graph/self-component-port.h>
 #include <babeltrace/graph/self-component-port-input.h>
 #include <babeltrace/graph/self-component-port-output.h>
@@ -90,28 +92,30 @@ end:
        return port;
 }
 
-const char *bt_port_get_name(struct bt_port *port)
+const char *bt_port_get_name(const struct bt_port *port)
 {
        BT_ASSERT_PRE_NON_NULL(port, "Port");
        return port->name->str;
 }
 
-enum bt_port_type bt_port_get_type(struct bt_port *port)
+enum bt_port_type bt_port_get_type(const struct bt_port *port)
 {
        BT_ASSERT_PRE_NON_NULL(port, "Port");
        return port->type;
 }
 
-struct bt_connection *bt_port_borrow_connection(struct bt_port *port)
+const struct bt_connection *bt_port_borrow_connection_const(
+               const struct bt_port *port)
 {
        BT_ASSERT_PRE_NON_NULL(port, "Port");
        return port->connection;
 }
 
-struct bt_component *bt_port_borrow_component(struct bt_port *port)
+const struct bt_component *bt_port_borrow_component_const(
+               const struct bt_port *port)
 {
        BT_ASSERT_PRE_NON_NULL(port, "Port");
-       return (struct bt_component *) bt_object_borrow_parent(&port->base);
+       return bt_port_borrow_component_inline(port);
 }
 
 struct bt_self_component *bt_self_component_port_borrow_component(
@@ -157,13 +161,13 @@ end:
        return BT_SELF_PORT_STATUS_OK;
 }
 
-bt_bool bt_port_is_connected(struct bt_port *port)
+bt_bool bt_port_is_connected(const struct bt_port *port)
 {
        BT_ASSERT_PRE_NON_NULL(port, "Port");
        return port->connection ? BT_TRUE : BT_FALSE;
 }
 
-void *bt_self_component_port_get_data(struct bt_self_component_port *port)
+void *bt_self_component_port_get_data(const struct bt_self_component_port *port)
 {
        BT_ASSERT_PRE_NON_NULL(port, "Port");
        return ((struct bt_port *) port)->user_data;
index 4f5a64d82e2510c017d02634789b63ea855c5a6f..a24b093dd7cf06d95e39930cc59d2c7ab359d021 100644 (file)
@@ -23,7 +23,7 @@
 #define BT_LOG_TAG "QUERY-EXECUTOR"
 #include <babeltrace/lib-logging-internal.h>
 
-#include <babeltrace/graph/private-query-executor.h>
+#include <babeltrace/graph/query-executor-const.h>
 #include <babeltrace/graph/query-executor.h>
 #include <babeltrace/graph/query-executor-internal.h>
 #include <babeltrace/graph/component-class.h>
@@ -46,7 +46,7 @@ void bt_query_executor_destroy(struct bt_object *obj)
        g_free(query_exec);
 }
 
-struct bt_private_query_executor *bt_private_query_executor_create(void)
+struct bt_query_executor *bt_query_executor_create(void)
 {
        struct bt_query_executor *query_exec;
 
@@ -65,16 +65,15 @@ end:
        return (void *) query_exec;
 }
 
-enum bt_query_executor_status bt_private_query_executor_query(
-               struct bt_private_query_executor *priv_query_exec,
-               struct bt_component_class *comp_cls,
+enum bt_query_executor_status bt_query_executor_query(
+               struct bt_query_executor *query_exec,
+               const struct bt_component_class *comp_cls,
                const char *object, const struct bt_value *params,
                const struct bt_value **user_result)
 {
-       typedef enum bt_query_status (*method_t)(void *, void *,
-               const void *, const void *, void *);
+       typedef enum bt_query_status (*method_t)(void *, const void *,
+               const void *, const void *, const void *);
 
-       struct bt_query_executor *query_exec = (void *) priv_query_exec;
        enum bt_query_status status;
        enum bt_query_executor_status exec_status;
        method_t method = NULL;
@@ -127,7 +126,8 @@ enum bt_query_executor_status bt_private_query_executor_query(
                "query-exec-addr=%p, %![cc-]+C, object=\"%s\", %![params-]+v",
                query_exec, comp_cls, object, params);
        *user_result = NULL;
-       status = method(comp_cls, query_exec, object, params, user_result);
+       status = method((void *) comp_cls, query_exec, object, params,
+               user_result);
        BT_LIB_LOGD("User method returned: status=%s, %![res-]+v",
                bt_query_status_string(status), *user_result);
        BT_ASSERT_PRE(status != BT_QUERY_STATUS_OK || *user_result,
@@ -143,18 +143,16 @@ end:
        return exec_status;
 }
 
-enum bt_query_executor_status bt_private_query_executor_cancel(
-               struct bt_private_query_executor *priv_query_exec)
+enum bt_query_executor_status bt_query_executor_cancel(
+               struct bt_query_executor *query_exec)
 {
-       struct bt_query_executor *query_exec = (void *) priv_query_exec;
-
        BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
        query_exec->canceled = BT_TRUE;
        BT_LOGV("Canceled query executor: addr=%p", query_exec);
        return BT_QUERY_EXECUTOR_STATUS_OK;
 }
 
-bt_bool bt_query_executor_is_canceled(struct bt_query_executor *query_exec)
+bt_bool bt_query_executor_is_canceled(const struct bt_query_executor *query_exec)
 {
        BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
        return query_exec->canceled;
index 1c3e348a04b759d07dcd5b56944fa99f84be37b7..98e278fe114c36d8f2fa812850c31c7f13bc13e6 100644 (file)
 #include <babeltrace/plugin/plugin-dev.h>
 #include <babeltrace/plugin/plugin-internal.h>
 #include <babeltrace/graph/component-class-internal.h>
-#include <babeltrace/graph/private-component-class.h>
-#include <babeltrace/graph/private-component-class-source.h>
-#include <babeltrace/graph/private-component-class-filter.h>
-#include <babeltrace/graph/private-component-class-sink.h>
+#include <babeltrace/graph/component-class.h>
+#include <babeltrace/graph/component-class-source.h>
+#include <babeltrace/graph/component-class-filter.h>
+#include <babeltrace/graph/component-class-sink.h>
 #include <babeltrace/types.h>
 #include <babeltrace/list-internal.h>
 #include <babeltrace/assert-internal.h>
@@ -285,37 +285,37 @@ enum bt_plugin_status bt_plugin_so_init(
 
                union {
                        struct {
-                               bt_private_component_class_source_init_method init;
-                               bt_private_component_class_source_finalize_method finalize;
-                               bt_private_component_class_source_query_method query;
-                               bt_private_component_class_source_accept_output_port_connection_method accept_output_port_connection;
-                               bt_private_component_class_source_output_port_connected_method output_port_connected;
-                               bt_private_component_class_source_output_port_disconnected_method output_port_disconnected;
-                               bt_private_component_class_source_notification_iterator_init_method notif_iter_init;
-                               bt_private_component_class_source_notification_iterator_finalize_method notif_iter_finalize;
+                               bt_component_class_source_init_method init;
+                               bt_component_class_source_finalize_method finalize;
+                               bt_component_class_source_query_method query;
+                               bt_component_class_source_accept_output_port_connection_method accept_output_port_connection;
+                               bt_component_class_source_output_port_connected_method output_port_connected;
+                               bt_component_class_source_output_port_disconnected_method output_port_disconnected;
+                               bt_component_class_source_notification_iterator_init_method notif_iter_init;
+                               bt_component_class_source_notification_iterator_finalize_method notif_iter_finalize;
                        } source;
 
                        struct {
-                               bt_private_component_class_filter_init_method init;
-                               bt_private_component_class_filter_finalize_method finalize;
-                               bt_private_component_class_filter_query_method query;
-                               bt_private_component_class_filter_accept_input_port_connection_method accept_input_port_connection;
-                               bt_private_component_class_filter_accept_output_port_connection_method accept_output_port_connection;
-                               bt_private_component_class_filter_input_port_connected_method input_port_connected;
-                               bt_private_component_class_filter_output_port_connected_method output_port_connected;
-                               bt_private_component_class_filter_input_port_disconnected_method input_port_disconnected;
-                               bt_private_component_class_filter_output_port_disconnected_method output_port_disconnected;
-                               bt_private_component_class_filter_notification_iterator_init_method notif_iter_init;
-                               bt_private_component_class_filter_notification_iterator_finalize_method notif_iter_finalize;
+                               bt_component_class_filter_init_method init;
+                               bt_component_class_filter_finalize_method finalize;
+                               bt_component_class_filter_query_method query;
+                               bt_component_class_filter_accept_input_port_connection_method accept_input_port_connection;
+                               bt_component_class_filter_accept_output_port_connection_method accept_output_port_connection;
+                               bt_component_class_filter_input_port_connected_method input_port_connected;
+                               bt_component_class_filter_output_port_connected_method output_port_connected;
+                               bt_component_class_filter_input_port_disconnected_method input_port_disconnected;
+                               bt_component_class_filter_output_port_disconnected_method output_port_disconnected;
+                               bt_component_class_filter_notification_iterator_init_method notif_iter_init;
+                               bt_component_class_filter_notification_iterator_finalize_method notif_iter_finalize;
                        } filter;
 
                        struct {
-                               bt_private_component_class_sink_init_method init;
-                               bt_private_component_class_sink_finalize_method finalize;
-                               bt_private_component_class_sink_query_method query;
-                               bt_private_component_class_sink_accept_input_port_connection_method accept_input_port_connection;
-                               bt_private_component_class_sink_input_port_connected_method input_port_connected;
-                               bt_private_component_class_sink_input_port_disconnected_method input_port_disconnected;
+                               bt_component_class_sink_init_method init;
+                               bt_component_class_sink_finalize_method finalize;
+                               bt_component_class_sink_query_method query;
+                               bt_component_class_sink_accept_input_port_connection_method accept_input_port_connection;
+                               bt_component_class_sink_input_port_connected_method input_port_connected;
+                               bt_component_class_sink_input_port_disconnected_method input_port_disconnected;
                        } sink;
                } methods;
        };
@@ -691,10 +691,10 @@ enum bt_plugin_status bt_plugin_so_init(
                struct comp_class_full_descriptor *cc_full_descr =
                        &g_array_index(comp_class_full_descriptors,
                                struct comp_class_full_descriptor, i);
-               struct bt_private_component_class *comp_class = NULL;
-               struct bt_private_component_class_source *src_comp_class = NULL;
-               struct bt_private_component_class_filter *flt_comp_class = NULL;
-               struct bt_private_component_class_sink *sink_comp_class = NULL;
+               struct bt_component_class *comp_class = NULL;
+               struct bt_component_class_source *src_comp_class = NULL;
+               struct bt_component_class_filter *flt_comp_class = NULL;
+               struct bt_component_class_sink *sink_comp_class = NULL;
 
                BT_LOGD("Creating and setting properties of plugin's component class: "
                        "plugin-path=\"%s\", plugin-name=\"%s\", "
@@ -709,24 +709,24 @@ enum bt_plugin_status bt_plugin_so_init(
 
                switch (cc_full_descr->descriptor->type) {
                case BT_COMPONENT_CLASS_TYPE_SOURCE:
-                       src_comp_class = bt_private_component_class_source_create(
+                       src_comp_class = bt_component_class_source_create(
                                cc_full_descr->descriptor->name,
                                cc_full_descr->descriptor->methods.source.notif_iter_next);
-                       comp_class = bt_private_component_class_source_as_private_component_class(
+                       comp_class = bt_component_class_source_as_component_class(
                                src_comp_class);
                        break;
                case BT_COMPONENT_CLASS_TYPE_FILTER:
-                       flt_comp_class = bt_private_component_class_filter_create(
+                       flt_comp_class = bt_component_class_filter_create(
                                cc_full_descr->descriptor->name,
                                cc_full_descr->descriptor->methods.source.notif_iter_next);
-                       comp_class = bt_private_component_class_filter_as_private_component_class(
+                       comp_class = bt_component_class_filter_as_component_class(
                                flt_comp_class);
                        break;
                case BT_COMPONENT_CLASS_TYPE_SINK:
-                       sink_comp_class = bt_private_component_class_sink_create(
+                       sink_comp_class = bt_component_class_sink_create(
                                cc_full_descr->descriptor->name,
                                cc_full_descr->descriptor->methods.sink.consume);
-                       comp_class = bt_private_component_class_sink_as_private_component_class(
+                       comp_class = bt_component_class_sink_as_component_class(
                                sink_comp_class);
                        break;
                default:
@@ -756,7 +756,7 @@ enum bt_plugin_status bt_plugin_so_init(
                }
 
                if (cc_full_descr->description) {
-                       ret = bt_private_component_class_set_description(
+                       ret = bt_component_class_set_description(
                                comp_class, cc_full_descr->description);
                        if (ret) {
                                BT_LOGE_STR("Cannot set component class's description.");
@@ -767,7 +767,7 @@ enum bt_plugin_status bt_plugin_so_init(
                }
 
                if (cc_full_descr->help) {
-                       ret = bt_private_component_class_set_help(comp_class,
+                       ret = bt_component_class_set_help(comp_class,
                                cc_full_descr->help);
                        if (ret) {
                                BT_LOGE_STR("Cannot set component class's help string.");
@@ -780,7 +780,7 @@ enum bt_plugin_status bt_plugin_so_init(
                switch (cc_full_descr->descriptor->type) {
                case BT_COMPONENT_CLASS_TYPE_SOURCE:
                        if (cc_full_descr->methods.source.init) {
-                               ret = bt_private_component_class_source_set_init_method(
+                               ret = bt_component_class_source_set_init_method(
                                        src_comp_class,
                                        cc_full_descr->methods.source.init);
                                if (ret) {
@@ -792,7 +792,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.source.finalize) {
-                               ret = bt_private_component_class_source_set_finalize_method(
+                               ret = bt_component_class_source_set_finalize_method(
                                        src_comp_class,
                                        cc_full_descr->methods.source.finalize);
                                if (ret) {
@@ -804,7 +804,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.source.query) {
-                               ret = bt_private_component_class_source_set_query_method(
+                               ret = bt_component_class_source_set_query_method(
                                        src_comp_class,
                                        cc_full_descr->methods.source.query);
                                if (ret) {
@@ -816,7 +816,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.source.accept_output_port_connection) {
-                               ret = bt_private_component_class_source_set_accept_output_port_connection_method(
+                               ret = bt_component_class_source_set_accept_output_port_connection_method(
                                        src_comp_class,
                                        cc_full_descr->methods.source.accept_output_port_connection);
                                if (ret) {
@@ -828,7 +828,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.source.output_port_connected) {
-                               ret = bt_private_component_class_source_set_output_port_connected_method(
+                               ret = bt_component_class_source_set_output_port_connected_method(
                                        src_comp_class,
                                        cc_full_descr->methods.source.output_port_connected);
                                if (ret) {
@@ -840,7 +840,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.source.output_port_disconnected) {
-                               ret = bt_private_component_class_source_set_output_port_disconnected_method(
+                               ret = bt_component_class_source_set_output_port_disconnected_method(
                                        src_comp_class,
                                        cc_full_descr->methods.source.output_port_disconnected);
                                if (ret) {
@@ -852,7 +852,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.source.notif_iter_init) {
-                               ret = bt_private_component_class_source_set_notification_iterator_init_method(
+                               ret = bt_component_class_source_set_notification_iterator_init_method(
                                        src_comp_class,
                                        cc_full_descr->methods.source.notif_iter_init);
                                if (ret) {
@@ -864,7 +864,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.source.notif_iter_finalize) {
-                               ret = bt_private_component_class_source_set_notification_iterator_finalize_method(
+                               ret = bt_component_class_source_set_notification_iterator_finalize_method(
                                        src_comp_class,
                                        cc_full_descr->methods.source.notif_iter_finalize);
                                if (ret) {
@@ -878,7 +878,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        break;
                case BT_COMPONENT_CLASS_TYPE_FILTER:
                        if (cc_full_descr->methods.filter.init) {
-                               ret = bt_private_component_class_filter_set_init_method(
+                               ret = bt_component_class_filter_set_init_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.init);
                                if (ret) {
@@ -890,7 +890,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.finalize) {
-                               ret = bt_private_component_class_filter_set_finalize_method(
+                               ret = bt_component_class_filter_set_finalize_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.finalize);
                                if (ret) {
@@ -902,7 +902,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.query) {
-                               ret = bt_private_component_class_filter_set_query_method(
+                               ret = bt_component_class_filter_set_query_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.query);
                                if (ret) {
@@ -914,7 +914,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.accept_input_port_connection) {
-                               ret = bt_private_component_class_filter_set_accept_input_port_connection_method(
+                               ret = bt_component_class_filter_set_accept_input_port_connection_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.accept_input_port_connection);
                                if (ret) {
@@ -926,7 +926,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.accept_output_port_connection) {
-                               ret = bt_private_component_class_filter_set_accept_output_port_connection_method(
+                               ret = bt_component_class_filter_set_accept_output_port_connection_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.accept_output_port_connection);
                                if (ret) {
@@ -938,7 +938,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.input_port_connected) {
-                               ret = bt_private_component_class_filter_set_input_port_connected_method(
+                               ret = bt_component_class_filter_set_input_port_connected_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.input_port_connected);
                                if (ret) {
@@ -950,7 +950,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.output_port_connected) {
-                               ret = bt_private_component_class_filter_set_output_port_connected_method(
+                               ret = bt_component_class_filter_set_output_port_connected_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.output_port_connected);
                                if (ret) {
@@ -962,7 +962,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.input_port_disconnected) {
-                               ret = bt_private_component_class_filter_set_input_port_disconnected_method(
+                               ret = bt_component_class_filter_set_input_port_disconnected_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.input_port_disconnected);
                                if (ret) {
@@ -974,7 +974,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.output_port_disconnected) {
-                               ret = bt_private_component_class_filter_set_output_port_disconnected_method(
+                               ret = bt_component_class_filter_set_output_port_disconnected_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.output_port_disconnected);
                                if (ret) {
@@ -986,7 +986,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.notif_iter_init) {
-                               ret = bt_private_component_class_filter_set_notification_iterator_init_method(
+                               ret = bt_component_class_filter_set_notification_iterator_init_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.notif_iter_init);
                                if (ret) {
@@ -998,7 +998,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.filter.notif_iter_finalize) {
-                               ret = bt_private_component_class_filter_set_notification_iterator_finalize_method(
+                               ret = bt_component_class_filter_set_notification_iterator_finalize_method(
                                        flt_comp_class,
                                        cc_full_descr->methods.filter.notif_iter_finalize);
                                if (ret) {
@@ -1012,7 +1012,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        break;
                case BT_COMPONENT_CLASS_TYPE_SINK:
                        if (cc_full_descr->methods.sink.init) {
-                               ret = bt_private_component_class_sink_set_init_method(
+                               ret = bt_component_class_sink_set_init_method(
                                        sink_comp_class,
                                        cc_full_descr->methods.sink.init);
                                if (ret) {
@@ -1024,7 +1024,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.sink.finalize) {
-                               ret = bt_private_component_class_sink_set_finalize_method(
+                               ret = bt_component_class_sink_set_finalize_method(
                                        sink_comp_class,
                                        cc_full_descr->methods.sink.finalize);
                                if (ret) {
@@ -1036,7 +1036,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.sink.query) {
-                               ret = bt_private_component_class_sink_set_query_method(
+                               ret = bt_component_class_sink_set_query_method(
                                        sink_comp_class,
                                        cc_full_descr->methods.sink.query);
                                if (ret) {
@@ -1048,7 +1048,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.sink.accept_input_port_connection) {
-                               ret = bt_private_component_class_sink_set_accept_input_port_connection_method(
+                               ret = bt_component_class_sink_set_accept_input_port_connection_method(
                                        sink_comp_class,
                                        cc_full_descr->methods.sink.accept_input_port_connection);
                                if (ret) {
@@ -1060,7 +1060,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.sink.input_port_connected) {
-                               ret = bt_private_component_class_sink_set_input_port_connected_method(
+                               ret = bt_component_class_sink_set_input_port_connected_method(
                                        sink_comp_class,
                                        cc_full_descr->methods.sink.input_port_connected);
                                if (ret) {
@@ -1072,7 +1072,7 @@ enum bt_plugin_status bt_plugin_so_init(
                        }
 
                        if (cc_full_descr->methods.sink.input_port_disconnected) {
-                               ret = bt_private_component_class_sink_set_input_port_disconnected_method(
+                               ret = bt_component_class_sink_set_input_port_disconnected_method(
                                        sink_comp_class,
                                        cc_full_descr->methods.sink.input_port_disconnected);
                                if (ret) {
index 39d6e69fe94c9ec777e8a25efaa8dc93ff322f9b..a0a588a6c76d58e5840174509a466c9e1113d4bc 100644 (file)
@@ -33,7 +33,7 @@
 #include <babeltrace/plugin/plugin-internal.h>
 #include <babeltrace/plugin/plugin-so-internal.h>
 #include <babeltrace/plugin/plugin-const.h>
-#include <babeltrace/graph/component-class.h>
+#include <babeltrace/graph/component-class-const.h>
 #include <babeltrace/graph/component-class-internal.h>
 #include <babeltrace/types.h>
 #include <babeltrace/assert-internal.h>
@@ -538,28 +538,27 @@ struct bt_component_class *borrow_component_class_by_index(
        return g_ptr_array_index(comp_classes, index);
 }
 
-
-struct bt_component_class_source *
+const struct bt_component_class_source *
 bt_plugin_borrow_source_component_class_by_index_const_const(
                const struct bt_plugin *plugin, uint64_t index)
 {
-       return (void *) borrow_component_class_by_index(plugin,
+       return (const void *) borrow_component_class_by_index(plugin,
                plugin->src_comp_classes, index);
 }
 
-struct bt_component_class_filter *
+const struct bt_component_class_filter *
 bt_plugin_borrow_filter_component_class_by_index_const(
                const struct bt_plugin *plugin, uint64_t index)
 {
-       return (void *) borrow_component_class_by_index(plugin,
+       return (const void *) borrow_component_class_by_index(plugin,
                plugin->flt_comp_classes, index);
 }
 
-struct bt_component_class_sink *
+const struct bt_component_class_sink *
 bt_plugin_borrow_sink_component_class_by_index_const(
                const struct bt_plugin *plugin, uint64_t index)
 {
-       return (void *) borrow_component_class_by_index(plugin,
+       return (const void *) borrow_component_class_by_index(plugin,
                plugin->sink_comp_classes, index);
 }
 
@@ -591,26 +590,26 @@ struct bt_component_class *borrow_component_class_by_name(
        return comp_class;
 }
 
-struct bt_component_class_source *
+const struct bt_component_class_source *
 bt_plugin_borrow_source_component_class_by_name_const(
                const struct bt_plugin *plugin, const char *name)
 {
-       return (void *) borrow_component_class_by_name(plugin,
+       return (const void *) borrow_component_class_by_name(plugin,
                plugin->src_comp_classes, name);
 }
 
-struct bt_component_class_filter *
+const struct bt_component_class_filter *
 bt_plugin_borrow_filter_component_class_by_name_const(
                const struct bt_plugin *plugin, const char *name)
 {
-       return (void *) borrow_component_class_by_name(plugin,
+       return (const void *) borrow_component_class_by_name(plugin,
                plugin->flt_comp_classes, name);
 }
 
-struct bt_component_class_sink *
+const struct bt_component_class_sink *
 bt_plugin_borrow_sink_component_class_by_name_const(
                const struct bt_plugin *plugin, const char *name)
 {
-       return (void *) borrow_component_class_by_name(plugin,
+       return (const void *) borrow_component_class_by_name(plugin,
                plugin->sink_comp_classes, name);
 }
index ae16dd1ef3d15bf18de52eefad1bd8e225429a88..8a5f4693be3e6150cf1bb737215ad434051febaa 100644 (file)
@@ -57,9 +57,8 @@ void bt_event_header_field_release(
 }
 
 struct bt_event_header_field *bt_event_header_field_create(
-               struct bt_stream_class *priv_stream_class)
+               struct bt_stream_class *stream_class)
 {
-       struct bt_stream_class *stream_class = (void *) priv_stream_class;
        struct bt_field_wrapper *field_wrapper;
 
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
index e8c577e8964f7a261c9769fecf2306fddd96d1f6..393e49ad290d825d89b8eeb8ec25d2825e5392a9 100644 (file)
@@ -57,9 +57,8 @@ void bt_packet_context_field_release(
 }
 
 struct bt_packet_context_field *bt_packet_context_field_create(
-               struct bt_stream_class *priv_stream_class)
+               struct bt_stream_class *stream_class)
 {
-       struct bt_stream_class *stream_class = (void *) priv_stream_class;
        struct bt_field_wrapper *field_wrapper;
 
        BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
index cec6936ef16ce0fde90d20bd1f5ffdb68001c156..6359b882364c33da7265ebbf5d3ebd89147bb4ee 100644 (file)
@@ -57,10 +57,9 @@ void bt_packet_header_field_release(
 }
 
 struct bt_packet_header_field *bt_packet_header_field_create(
-               struct bt_trace *priv_trace)
+               struct bt_trace *trace)
 {
        struct bt_field_wrapper *field_wrapper;
-       struct bt_trace *trace = (void *) priv_trace;
 
        BT_ASSERT_PRE_NON_NULL(trace, "Trace");
        BT_ASSERT_PRE(trace->packet_header_fc,
index b7be219f0de02cb1f768d091d050a6c8547db411..2c9efd636a614131449409394307888d483b9e89 100644 (file)
@@ -145,7 +145,7 @@ struct bt_notif_iter {
        struct bt_event *event;
 
        /* Current event notification (NULL if not created yet) */
-       struct bt_private_notification *event_notif;
+       struct bt_notification *event_notif;
 
        /* Database of current dynamic scopes */
        struct {
@@ -1197,7 +1197,7 @@ enum bt_notif_iter_status set_current_event_notification(
                struct bt_notif_iter *notit)
 {
        enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
-       struct bt_private_notification *notif = NULL;
+       struct bt_notification *notif = NULL;
 
        BT_ASSERT(notit->meta.ec);
        BT_ASSERT(notit->packet);
@@ -1207,7 +1207,7 @@ enum bt_notif_iter_status set_current_event_notification(
                notit->meta.ec->name->str,
                notit->packet);
        BT_ASSERT(notit->notif_iter);
-       notif = bt_private_notification_event_create(notit->notif_iter,
+       notif = bt_notification_event_create(notit->notif_iter,
                notit->meta.ec->ir_ec, notit->packet);
        if (!notif) {
                BT_LOGE("Cannot create event notification: "
@@ -1246,7 +1246,7 @@ enum bt_notif_iter_status after_event_header_state(
                goto end;
        }
 
-       notit->event = bt_private_notification_event_borrow_event(
+       notit->event = bt_notification_event_borrow_event(
                notit->event_notif);
        BT_ASSERT(notit->event);
 
@@ -2254,7 +2254,7 @@ static
 void set_event_default_clock_value(struct bt_notif_iter *notit)
 {
        struct bt_event *event =
-               bt_private_notification_event_borrow_event(
+               bt_notification_event_borrow_event(
                        notit->event_notif);
        struct bt_stream_class *sc = notit->meta.sc->ir_sc;
 
@@ -2268,10 +2268,10 @@ void set_event_default_clock_value(struct bt_notif_iter *notit)
 
 static
 void notify_new_stream(struct bt_notif_iter *notit,
-               struct bt_private_notification **notification)
+               struct bt_notification **notification)
 {
        enum bt_notif_iter_status status;
-       struct bt_private_notification *ret = NULL;
+       struct bt_notification *ret = NULL;
 
        status = set_current_stream(notit);
        if (status != BT_NOTIF_ITER_STATUS_OK) {
@@ -2281,7 +2281,7 @@ void notify_new_stream(struct bt_notif_iter *notit,
 
        BT_ASSERT(notit->stream);
        BT_ASSERT(notit->notif_iter);
-       ret = bt_private_notification_stream_begin_create(notit->notif_iter,
+       ret = bt_notification_stream_begin_create(notit->notif_iter,
                notit->stream);
        if (!ret) {
                BT_LOGE("Cannot create stream beginning notification: "
@@ -2296,9 +2296,9 @@ end:
 
 static
 void notify_end_of_stream(struct bt_notif_iter *notit,
-               struct bt_private_notification **notification)
+               struct bt_notification **notification)
 {
-       struct bt_private_notification *ret;
+       struct bt_notification *ret;
 
        if (!notit->stream) {
                BT_LOGE("Cannot create stream for stream notification: "
@@ -2307,7 +2307,7 @@ void notify_end_of_stream(struct bt_notif_iter *notit,
        }
 
        BT_ASSERT(notit->notif_iter);
-       ret = bt_private_notification_stream_end_create(notit->notif_iter,
+       ret = bt_notification_stream_end_create(notit->notif_iter,
                notit->stream);
        if (!ret) {
                BT_LOGE("Cannot create stream beginning notification: "
@@ -2320,11 +2320,11 @@ void notify_end_of_stream(struct bt_notif_iter *notit,
 
 static
 void notify_new_packet(struct bt_notif_iter *notit,
-               struct bt_private_notification **notification)
+               struct bt_notification **notification)
 {
        int ret;
        enum bt_notif_iter_status status;
-       struct bt_private_notification *notif = NULL;
+       struct bt_notification *notif = NULL;
        const struct bt_stream_class *sc;
 
        status = set_current_packet(notit);
@@ -2399,7 +2399,7 @@ void notify_new_packet(struct bt_notif_iter *notit,
        }
 
        BT_ASSERT(notit->notif_iter);
-       notif = bt_private_notification_packet_begin_create(notit->notif_iter,
+       notif = bt_notification_packet_begin_create(notit->notif_iter,
                notit->packet);
        if (!notif) {
                BT_LOGE("Cannot create packet beginning notification: "
@@ -2416,9 +2416,9 @@ end:
 
 static
 void notify_end_of_packet(struct bt_notif_iter *notit,
-               struct bt_private_notification **notification)
+               struct bt_notification **notification)
 {
-       struct bt_private_notification *notif;
+       struct bt_notification *notif;
 
        if (!notit->packet) {
                return;
@@ -2430,7 +2430,7 @@ void notify_end_of_packet(struct bt_notif_iter *notit,
        }
 
        BT_ASSERT(notit->notif_iter);
-       notif = bt_private_notification_packet_end_create(notit->notif_iter,
+       notif = bt_notification_packet_end_create(notit->notif_iter,
                notit->packet);
        if (!notif) {
                BT_LOGE("Cannot create packet end notification: "
@@ -2542,7 +2542,7 @@ void bt_notif_iter_destroy(struct bt_notif_iter *notit)
 enum bt_notif_iter_status bt_notif_iter_get_next_notification(
                struct bt_notif_iter *notit,
                struct bt_self_notification_iterator *notif_iter,
-               struct bt_private_notification **notification)
+               struct bt_notification **notification)
 {
        enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
 
index 7d69bb1f7e0bbddea9700b64fa53546588950ca0..9fd9b725227120d1ec5243b434da81a1d17026c3 100644 (file)
@@ -288,7 +288,7 @@ BT_HIDDEN
 enum bt_notif_iter_status bt_notif_iter_get_next_notification(
                struct bt_notif_iter *notit,
                struct bt_self_notification_iterator *notif_iter,
-               struct bt_private_notification **notification);
+               struct bt_notification **notification);
 
 /**
  * Returns the first packet header and context fields. This function
index b87d78d26ceddf6064aceeaee10a656561faaefc..8f2ffd8a92f3421d720ada71d47043fb7e8a7269 100644 (file)
@@ -111,7 +111,7 @@ end:
 static
 enum bt_component_status handle_notification(
                struct writer_component *writer_component,
-               struct bt_notification *notification)
+               const struct bt_notification *notification)
 {
        enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
 
@@ -201,7 +201,7 @@ BT_HIDDEN
 void writer_component_port_connected(
                struct bt_self_component *component,
                struct bt_private_port *self_port,
-               struct bt_port *other_port)
+               const struct bt_port *other_port)
 {
        struct bt_private_connection *connection;
        struct writer_component *writer;
@@ -225,7 +225,7 @@ BT_HIDDEN
 enum bt_component_status writer_run(struct bt_self_component *component)
 {
        enum bt_component_status ret;
-       struct bt_notification *notification = NULL;
+       const struct bt_notification *notification = NULL;
        struct bt_notification_iterator *it;
        struct writer_component *writer_component =
                bt_self_component_get_user_data(component);
index 2d40b7e4eb5415923ccf3d64eca6fc298455046a..ae95f71491b36d4c28e95e0c325ee84ae2b84768 100644 (file)
@@ -102,7 +102,7 @@ BT_HIDDEN
 void writer_component_port_connected(
                struct bt_self_component *component,
                struct bt_private_port *self_port,
-               struct bt_port *other_port);
+               const struct bt_port *other_port);
 
 BT_HIDDEN
 void writer_component_finalize(struct bt_self_component *component);
index d046b0dfd679eb55e011f03980fd26dd1d9484be..803d424f518108c62879f1dba11966997bcbd4ef 100644 (file)
@@ -708,7 +708,7 @@ void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *ds_file)
 BT_HIDDEN
 enum bt_notification_iterator_status ctf_fs_ds_file_next(
                struct ctf_fs_ds_file *ds_file,
-               struct bt_private_notification **notif)
+               struct bt_notification **notif)
 {
        enum bt_notif_iter_status notif_iter_status;
        enum bt_notification_iterator_status status;
index a0ac6c7423d4c1388a2e80f33592aa4ae1abb813..a02501c6074a1c006559880c79e5f991fc8a62bd 100644 (file)
@@ -144,7 +144,7 @@ void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream);
 BT_HIDDEN
 enum bt_notification_iterator_status ctf_fs_ds_file_next(
                struct ctf_fs_ds_file *ds_file,
-               struct bt_private_notification **notif);
+               struct bt_notification **notif);
 
 BT_HIDDEN
 struct ctf_fs_ds_index *ctf_fs_ds_file_build_index(
index a36179fb574fdc77bc7a3f57b605cb09d621544a..3ace7653a7219370d0240988e56c3d68cd4ac303 100644 (file)
@@ -90,15 +90,15 @@ void ctf_fs_notif_iter_data_destroy(
 static
 enum bt_self_notification_iterator_status ctf_fs_iterator_next_one(
                struct ctf_fs_notif_iter_data *notif_iter_data,
-               struct bt_notification **notif)
+               const struct bt_notification **notif)
 {
        enum bt_self_notification_iterator_status status;
-       struct bt_private_notification *priv_notif;
+       struct bt_notification *priv_notif;
        int ret;
 
        BT_ASSERT(notif_iter_data->ds_file);
        status = ctf_fs_ds_file_next(notif_iter_data->ds_file, &priv_notif);
-       *notif = bt_private_notification_as_notification(priv_notif);
+       *notif = priv_notif;
 
        if (status == BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK &&
                        bt_notification_get_type(*notif) ==
@@ -112,7 +112,7 @@ enum bt_self_notification_iterator_status ctf_fs_iterator_next_one(
                        BT_OBJECT_PUT_REF_AND_RESET(*notif);
                        status = ctf_fs_ds_file_next(notif_iter_data->ds_file,
                                &priv_notif);
-                       *notif = bt_private_notification_as_notification(priv_notif);
+                       *notif = priv_notif;
                        BT_ASSERT(status != BT_SELF_NOTIFICATION_ITERATOR_STATUS_END);
                        goto end;
                } else {
@@ -158,7 +158,7 @@ enum bt_self_notification_iterator_status ctf_fs_iterator_next_one(
                }
 
                status = ctf_fs_ds_file_next(notif_iter_data->ds_file, &priv_notif);
-               *notif = bt_private_notification_as_notification(priv_notif);
+               *notif = priv_notif;
 
                /*
                 * If we get a notification, we expect to get a
@@ -184,7 +184,7 @@ enum bt_self_notification_iterator_status ctf_fs_iterator_next_one(
                        BT_OBJECT_PUT_REF_AND_RESET(*notif);
                        status = ctf_fs_ds_file_next(notif_iter_data->ds_file,
                                &priv_notif);
-                       *notif = bt_private_notification_as_notification(priv_notif);
+                       *notif = priv_notif;
                        BT_ASSERT(status != BT_SELF_NOTIFICATION_ITERATOR_STATUS_END);
                }
        }
@@ -196,7 +196,7 @@ end:
 BT_HIDDEN
 enum bt_self_notification_iterator_status ctf_fs_iterator_next(
                struct bt_self_notification_iterator *iterator,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count)
 {
        enum bt_self_notification_iterator_status status =
@@ -1339,7 +1339,7 @@ enum bt_self_component_status ctf_fs_init(
 BT_HIDDEN
 enum bt_query_status ctf_fs_query(
                struct bt_self_component_class_source *comp_class,
-               struct bt_query_executor *query_exec,
+               const struct bt_query_executor *query_exec,
                const char *object, const struct bt_value *params,
                const struct bt_value **result)
 {
index 4b4dcc018741ace1f159d7fd1d412b6ea0745d54..83cf3a9c261dde0465e9e87a1bb3741ee2a65f98 100644 (file)
@@ -162,7 +162,7 @@ void ctf_fs_finalize(struct bt_self_component_source *component);
 BT_HIDDEN
 enum bt_query_status ctf_fs_query(
                struct bt_self_component_class_source *comp_class,
-               struct bt_query_executor *query_exec,
+               const struct bt_query_executor *query_exec,
                const char *object, const struct bt_value *params,
                const struct bt_value **result);
 
@@ -191,7 +191,7 @@ void ctf_fs_iterator_finalize(struct bt_self_notification_iterator *it);
 BT_HIDDEN
 enum bt_self_notification_iterator_status ctf_fs_iterator_next(
                struct bt_self_notification_iterator *iterator,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count);
 
 #endif /* BABELTRACE_PLUGIN_CTF_FS_H */
index a698e6bef699aa3217a7436593e4758dad931e15..153db97d869804760d12be0d8dadab8bf4583b5b 100644 (file)
@@ -95,7 +95,7 @@ struct lttng_live_stream_iterator {
        enum lttng_live_stream_state state;
 
        uint64_t current_packet_end_timestamp;
-       struct bt_notification *packet_end_notif_queue;
+       const struct bt_notification *packet_end_notif_queue;
 
        uint8_t *buf;
        size_t buflen;
@@ -213,8 +213,8 @@ enum bt_component_status lttng_live_component_init(struct bt_self_component *sou
                struct bt_value *params, void *init_method_data);
 
 struct bt_component_class_query_method_return lttng_live_query(
-               struct bt_component_class *comp_class,
-               struct bt_query_executor *query_exec,
+               const struct bt_component_class *comp_class,
+               const struct bt_query_executor *query_exec,
                const char *object, struct bt_value *params);
 
 void lttng_live_component_finalize(struct bt_self_component *component);
@@ -225,7 +225,7 @@ struct bt_notification_iterator_next_method_return lttng_live_iterator_next(
 enum bt_component_status lttng_live_accept_port_connection(
                struct bt_self_component *private_component,
                struct bt_private_port *self_private_port,
-               struct bt_port *other_port);
+               const struct bt_port *other_port);
 
 enum bt_notification_iterator_status lttng_live_iterator_init(
                struct bt_self_notification_iterator *it,
index d8dd3fc79f5dab85e6724958aac98822d56ebd97..4878934837c902360c81279e7a017135de4c7b18 100644 (file)
@@ -68,7 +68,7 @@ static const char *print_state(struct lttng_live_stream_iterator *s)
 static
 void print_stream_state(struct lttng_live_stream_iterator *stream)
 {
-       struct bt_port *port;
+       const struct bt_port *port;
 
        port = bt_port_from_private(stream->port);
        print_dbg("stream %s state %s last_inact_ts %" PRId64 " cur_inact_ts %" PRId64,
@@ -83,7 +83,7 @@ BT_HIDDEN
 bt_bool lttng_live_is_canceled(struct lttng_live_component *lttng_live)
 {
        struct bt_component *component;
-       struct bt_graph *graph;
+       const struct bt_graph *graph;
        bt_bool ret;
 
        if (!lttng_live) {
@@ -92,7 +92,7 @@ bt_bool lttng_live_is_canceled(struct lttng_live_component *lttng_live)
 
        component = bt_component_from_private(lttng_live->private_component);
        graph = bt_component_get_graph(component);
-       ret = bt_private_graph_is_canceled(graph);
+       ret = bt_graph_is_canceled(graph);
        bt_object_put_ref(graph);
        bt_object_put_ref(component);
        return ret;
@@ -556,7 +556,7 @@ static
 enum bt_lttng_live_iterator_status emit_inactivity_notification(
                struct lttng_live_component *lttng_live,
                struct lttng_live_stream_iterator *lttng_live_stream,
-               struct bt_notification **notification,
+               const struct bt_notification **notification,
                uint64_t timestamp)
 {
        enum bt_lttng_live_iterator_status ret =
@@ -564,7 +564,7 @@ enum bt_lttng_live_iterator_status emit_inactivity_notification(
        struct lttng_live_trace *trace;
        const struct bt_clock_class *clock_class = NULL;
        struct bt_clock_value *clock_value = NULL;
-       struct bt_notification *notif = NULL;
+       const struct bt_notification *notif = NULL;
        int retval;
 
        trace = lttng_live_stream->trace;
@@ -603,7 +603,7 @@ static
 enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_quiescent_stream(
                struct lttng_live_component *lttng_live,
                struct lttng_live_stream_iterator *lttng_live_stream,
-               struct bt_notification **notification)
+               const struct bt_notification **notification)
 {
        enum bt_lttng_live_iterator_status ret =
                        BT_LTTNG_LIVE_ITERATOR_STATUS_OK;
@@ -636,7 +636,7 @@ static
 enum bt_lttng_live_iterator_status lttng_live_iterator_next_handle_one_active_data_stream(
                struct lttng_live_component *lttng_live,
                struct lttng_live_stream_iterator *lttng_live_stream,
-               struct bt_notification **notification)
+               const struct bt_notification **notification)
 {
        enum bt_lttng_live_iterator_status ret =
                        BT_LTTNG_LIVE_ITERATOR_STATUS_OK;
@@ -949,8 +949,8 @@ error:
 
 static
 struct bt_component_class_query_method_return lttng_live_query_list_sessions(
-               struct bt_component_class *comp_class,
-               struct bt_query_executor *query_exec,
+               const struct bt_component_class *comp_class,
+               const struct bt_query_executor *query_exec,
                struct bt_value *params)
 {
        struct bt_component_class_query_method_return query_ret = {
@@ -1005,8 +1005,8 @@ end:
 
 BT_HIDDEN
 struct bt_component_class_query_method_return lttng_live_query(
-               struct bt_component_class *comp_class,
-               struct bt_query_executor *query_exec,
+               const struct bt_component_class *comp_class,
+               const struct bt_query_executor *query_exec,
                const char *object, struct bt_value *params)
 {
        struct bt_component_class_query_method_return ret = {
@@ -1155,13 +1155,13 @@ BT_HIDDEN
 enum bt_component_status lttng_live_accept_port_connection(
                struct bt_self_component *private_component,
                struct bt_private_port *self_private_port,
-               struct bt_port *other_port)
+               const struct bt_port *other_port)
 {
        struct lttng_live_component *lttng_live =
                        bt_self_component_get_user_data(private_component);
        struct bt_component *other_component;
        enum bt_component_status status = BT_COMPONENT_STATUS_OK;
-       struct bt_port *self_port = bt_port_from_private(self_private_port);
+       const struct bt_port *self_port = bt_port_from_private(self_private_port);
 
        other_component = bt_port_get_component(other_port);
        bt_object_put_ref(other_component);     /* weak */
index 56f9bc1e8c101cdea6ea95edfab0d3039d5336d9..af198164205de709c3e863ad90f1f988efcb14fd 100644 (file)
@@ -68,7 +68,7 @@ struct debug_info_iterator {
        GHashTable *trace_map;
        /* Input iterators associated with this output iterator. */
        GPtrArray *input_iterator_group;
-       struct bt_notification *current_notification;
+       const struct bt_notification *current_notification;
        struct bt_notification_iterator *input_iterator;
        FILE *err;
 };
index ae1648a348d834d352eeb37e3401e8eddb31b43e..c3b24f3f5eea0e33fc85d6665f7c0e8117f0d5d1 100644 (file)
@@ -105,11 +105,11 @@ void debug_info_iterator_destroy(struct bt_self_notification_iterator *it)
 }
 
 static
-struct bt_notification *handle_notification(FILE *err,
+const struct bt_notification *handle_notification(FILE *err,
                struct debug_info_iterator *debug_it,
-               struct bt_notification *notification)
+               const struct bt_notification *notification)
 {
-       struct bt_notification *new_notification = NULL;
+       const struct bt_notification *new_notification = NULL;
 
        switch (bt_notification_get_type(notification)) {
        case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
@@ -227,7 +227,7 @@ struct bt_notification_iterator_next_method_return debug_info_iterator_next(
        struct bt_self_component *component = NULL;
        struct debug_info_component *debug_info = NULL;
        struct bt_notification_iterator *source_it = NULL;
-       struct bt_notification *notification;
+       const struct bt_notification *notification;
        struct bt_notification_iterator_next_method_return ret = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
                .notification = NULL,
index 9a8b5beb68180f77d50ecfcf678e89378658b2e7..cb2414f0cacde6baf151253da45288a903d2c4d3 100644 (file)
@@ -49,7 +49,7 @@ struct dmesg_notif_iter {
        char *linebuf;
        size_t linebuf_len;
        FILE *fp;
-       struct bt_private_notification *tmp_event_notif;
+       struct bt_notification *tmp_event_notif;
 
        enum {
                STATE_EMIT_STREAM_BEGINNING,
@@ -424,12 +424,12 @@ void dmesg_finalize(struct bt_self_component_source *self_comp)
 }
 
 static
-struct bt_private_notification *create_init_event_notif_from_line(
+struct bt_notification *create_init_event_notif_from_line(
                struct dmesg_notif_iter *notif_iter,
                const char *line, const char **new_start)
 {
        struct bt_event *event;
-       struct bt_private_notification *notif = NULL;
+       struct bt_notification *notif = NULL;
        bool has_timestamp = false;
        unsigned long sec, usec, msec;
        unsigned int year, mon, mday, hour, min;
@@ -499,14 +499,14 @@ skip_ts:
                goto error;
        }
 
-       notif = bt_private_notification_event_create(notif_iter->pc_notif_iter,
+       notif = bt_notification_event_create(notif_iter->pc_notif_iter,
                dmesg_comp->event_class, dmesg_comp->packet);
        if (!notif) {
                BT_LOGE_STR("Cannot create event notification.");
                goto error;
        }
 
-       event = bt_private_notification_event_borrow_event(notif);
+       event = bt_notification_event_borrow_event(notif);
        BT_ASSERT(event);
 
        if (dmesg_comp->clock_class) {
@@ -569,11 +569,11 @@ end:
 }
 
 static
-struct bt_private_notification *create_notif_from_line(
+struct bt_notification *create_notif_from_line(
                struct dmesg_notif_iter *dmesg_notif_iter, const char *line)
 {
        struct bt_event *event = NULL;
-       struct bt_private_notification *notif = NULL;
+       struct bt_notification *notif = NULL;
        const char *new_start;
        int ret;
 
@@ -584,7 +584,7 @@ struct bt_private_notification *create_notif_from_line(
                goto error;
        }
 
-       event = bt_private_notification_event_borrow_event(notif);
+       event = bt_notification_event_borrow_event(notif);
        BT_ASSERT(event);
        ret = fill_event_payload_from_line(new_start, event);
        if (ret) {
@@ -680,7 +680,7 @@ void dmesg_notif_iter_finalize(
 static
 enum bt_self_notification_iterator_status dmesg_notif_iter_next_one(
                struct dmesg_notif_iter *dmesg_notif_iter,
-               struct bt_private_notification **notif)
+               struct bt_notification **notif)
 {
        ssize_t len;
        struct dmesg_component *dmesg_comp;
@@ -760,13 +760,13 @@ handle_state:
        switch (dmesg_notif_iter->state) {
        case STATE_EMIT_STREAM_BEGINNING:
                BT_ASSERT(dmesg_notif_iter->tmp_event_notif);
-               *notif = bt_private_notification_stream_begin_create(
+               *notif = bt_notification_stream_begin_create(
                        dmesg_notif_iter->pc_notif_iter, dmesg_comp->stream);
                dmesg_notif_iter->state = STATE_EMIT_PACKET_BEGINNING;
                break;
        case STATE_EMIT_PACKET_BEGINNING:
                BT_ASSERT(dmesg_notif_iter->tmp_event_notif);
-               *notif = bt_private_notification_packet_begin_create(
+               *notif = bt_notification_packet_begin_create(
                        dmesg_notif_iter->pc_notif_iter, dmesg_comp->packet);
                dmesg_notif_iter->state = STATE_EMIT_EVENT;
                break;
@@ -776,12 +776,12 @@ handle_state:
                dmesg_notif_iter->tmp_event_notif = NULL;
                break;
        case STATE_EMIT_PACKET_END:
-               *notif = bt_private_notification_packet_end_create(
+               *notif = bt_notification_packet_end_create(
                        dmesg_notif_iter->pc_notif_iter, dmesg_comp->packet);
                dmesg_notif_iter->state = STATE_EMIT_STREAM_END;
                break;
        case STATE_EMIT_STREAM_END:
-               *notif = bt_private_notification_stream_end_create(
+               *notif = bt_notification_stream_end_create(
                        dmesg_notif_iter->pc_notif_iter, dmesg_comp->stream);
                dmesg_notif_iter->state = STATE_DONE;
                break;
@@ -802,7 +802,7 @@ end:
 BT_HIDDEN
 enum bt_self_notification_iterator_status dmesg_notif_iter_next(
                struct bt_self_notification_iterator *self_notif_iter,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count)
 {
        struct dmesg_notif_iter *dmesg_notif_iter =
@@ -814,12 +814,11 @@ enum bt_self_notification_iterator_status dmesg_notif_iter_next(
 
        while (i < capacity &&
                        status == BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK) {
-               struct bt_private_notification *priv_notif = NULL;
+               struct bt_notification *priv_notif = NULL;
 
                status = dmesg_notif_iter_next_one(dmesg_notif_iter,
                        &priv_notif);
-               notifs[i] = bt_private_notification_as_notification(
-                       priv_notif);
+               notifs[i] = priv_notif;
                if (status == BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK) {
                        i++;
                }
index f9fab1bc24a9156e63d3af77a2e6671ef6a63f0d..be49d4212b3674be673f31c1fd61efd03d3f70d8 100644 (file)
@@ -48,7 +48,7 @@ void dmesg_notif_iter_finalize(
 BT_HIDDEN
 enum bt_self_notification_iterator_status dmesg_notif_iter_next(
                struct bt_self_notification_iterator *self_notif_iter,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count);
 
 #endif /* BABELTRACE_PLUGIN_TEXT_DMESG_DMESG_H */
index 2d09aa5ee9aeba827c3d5735c57698799a9ed2b1..dcf1b5f7745340c54436ccad8580ef8884db101a 100644 (file)
@@ -123,7 +123,7 @@ void pretty_finalize(struct bt_self_component_sink *comp)
 static
 enum bt_self_component_status handle_notification(
                struct pretty_component *pretty,
-               struct bt_notification *notification)
+               const struct bt_notification *notification)
 {
        enum bt_self_component_status ret = BT_SELF_COMPONENT_STATUS_OK;
 
@@ -154,7 +154,7 @@ BT_HIDDEN
 enum bt_self_component_status pretty_port_connected(
                struct bt_self_component_sink *comp,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port)
+               const struct bt_port_output *other_port)
 {
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
        struct pretty_component *pretty;
@@ -177,7 +177,7 @@ enum bt_self_component_status pretty_consume(
                struct bt_self_component_sink *comp)
 {
        enum bt_self_component_status ret;
-       bt_notification_array notifs;
+       bt_notification_array_const notifs;
        struct bt_self_component_port_input_notification_iterator *it;
        struct pretty_component *pretty = bt_self_component_get_data(
                bt_self_component_sink_as_self_component(comp));
index 7d53088aa6a51867b1b280a3937016a0e16e20a3..b4ad2864092883eb75cbae5f683f5c8fc6589daf 100644 (file)
@@ -117,17 +117,17 @@ BT_HIDDEN
 enum bt_self_component_status pretty_port_connected(
                struct bt_self_component_sink *component,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port);
+               const struct bt_port_output *other_port);
 
 BT_HIDDEN
 void pretty_finalize(struct bt_self_component_sink *component);
 
 BT_HIDDEN
 int pretty_print_event(struct pretty_component *pretty,
-               struct bt_notification *event_notif);
+               const struct bt_notification *event_notif);
 
 BT_HIDDEN
 int pretty_print_packet(struct pretty_component *pretty,
-               struct bt_notification *packet_beginning_notif);
+               const struct bt_notification *packet_beginning_notif);
 
 #endif /* BABELTRACE_PLUGIN_TEXT_PRETTY_PRETTY_H */
index 4dae18825cdb5d241c8b0c3380dc087edd684c32..92de19095412075db2d1ea454bdf34ba59b668eb 100644 (file)
@@ -1208,11 +1208,11 @@ end:
 
 BT_HIDDEN
 int pretty_print_event(struct pretty_component *pretty,
-               struct bt_notification *event_notif)
+               const struct bt_notification *event_notif)
 {
        int ret;
        const struct bt_event *event =
-               bt_notification_event_borrow_event(event_notif);
+               bt_notification_event_borrow_event_const(event_notif);
 
        BT_ASSERT(event);
        pretty->start_line = true;
@@ -1382,7 +1382,7 @@ int print_discarded_elements_msg(
 
 BT_HIDDEN
 int pretty_print_packet(struct pretty_component *pretty,
-               struct bt_notification *packet_beginning_notif)
+               const struct bt_notification *packet_beginning_notif)
 {
 #if 0
        const struct bt_packet *packet = bt_notification_packet_begin_borrow_packet_const(
index 7b82ae4a84e084229e9bd2eb081d6fdc37f0793b..3b24092c0fe3469aa61a136997db96447477ba0d 100644 (file)
@@ -179,7 +179,7 @@ BT_HIDDEN
 enum bt_self_component_status counter_port_connected(
                struct bt_self_component_sink *comp,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port)
+               const struct bt_port_output *other_port)
 {
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
        struct counter *counter;
@@ -209,7 +209,7 @@ enum bt_self_component_status counter_consume(
        struct counter *counter;
        enum bt_notification_iterator_status it_ret;
        uint64_t notif_count;
-       bt_notification_array notifs;
+       bt_notification_array_const notifs;
 
        counter = bt_self_component_get_data(
                        bt_self_component_sink_as_self_component(comp));
@@ -235,7 +235,7 @@ enum bt_self_component_status counter_consume(
                uint64_t i;
 
                for (i = 0; i < notif_count; i++) {
-                       struct bt_notification *notif = notifs[i];
+                       const struct bt_notification *notif = notifs[i];
 
                        BT_ASSERT(notif);
                        switch (bt_notification_get_type(notif)) {
index 2feeaa50ba4d6c93a865e58c448e61f96eae185c..54da5294027e2c060ff24050ca1f95b94c70fbc5 100644 (file)
@@ -57,7 +57,7 @@ BT_HIDDEN
 enum bt_self_component_status counter_port_connected(
                struct bt_self_component_sink *component,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port);
+               const struct bt_port_output *other_port);
 
 BT_HIDDEN
 enum bt_self_component_status counter_consume(struct bt_self_component_sink *component);
index 2c259156cee3ba736be8c185ecd30823594c178f..d6230f72e00b190a8563bc6b237ebc23128234c9 100644 (file)
@@ -80,7 +80,7 @@ BT_HIDDEN
 enum bt_self_component_status dummy_port_connected(
                struct bt_self_component_sink *comp,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port)
+               const struct bt_port_output *other_port)
 {
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
        struct dummy *dummy;
@@ -107,7 +107,7 @@ enum bt_self_component_status dummy_consume(
                struct bt_self_component_sink *component)
 {
        enum bt_self_component_status ret = BT_SELF_COMPONENT_STATUS_OK;
-       bt_notification_array notifs;
+       bt_notification_array_const notifs;
        uint64_t count;
        struct dummy *dummy;
        enum bt_notification_iterator_status it_ret;
index 06fcc0e82cd1928ea350f289aa61b694fcba272a..d6a9bd127e19955c0d3f72ccbb811c58bf11cc05 100644 (file)
@@ -44,7 +44,7 @@ BT_HIDDEN
 enum bt_self_component_status dummy_port_connected(
                struct bt_self_component_sink *comp,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port);
+               const struct bt_port_output *other_port);
 
 BT_HIDDEN
 enum bt_self_component_status dummy_consume(
index 7c5991abb3685806638fbae0f57f26d9dacfb91a..a661575fa26ec53ebd0f5c2e6e1a0c6e4d44f4d8 100644 (file)
@@ -62,7 +62,7 @@ struct muxer_upstream_notif_iter {
        /* Owned by this, NULL if ended */
        struct bt_self_component_port_input_notification_iterator *notif_iter;
 
-       /* Contains `struct bt_notification *`, owned by this */
+       /* Contains `const struct bt_notification *`, owned by this */
        GQueue *notifs;
 };
 
@@ -125,7 +125,7 @@ void destroy_muxer_upstream_notif_iter(
        bt_object_put_ref(muxer_upstream_notif_iter->notif_iter);
 
        if (muxer_upstream_notif_iter->notifs) {
-               struct bt_notification *notif;
+               const struct bt_notification *notif;
 
                while ((notif = g_queue_pop_head(
                                muxer_upstream_notif_iter->notifs))) {
@@ -415,7 +415,7 @@ struct bt_self_component_port_input_notification_iterator *
 create_notif_iter_on_input_port(
                struct bt_self_component_port_input *self_port, int *ret)
 {
-       struct bt_port *port = bt_self_component_port_as_port(
+       const struct bt_port *port = bt_self_component_port_as_port(
                bt_self_component_port_input_as_self_component_port(
                        self_port));
        struct bt_self_component_port_input_notification_iterator *notif_iter =
@@ -452,7 +452,7 @@ enum bt_notification_iterator_status muxer_upstream_notif_iter_next(
                struct muxer_upstream_notif_iter *muxer_upstream_notif_iter)
 {
        enum bt_notification_iterator_status status;
-       bt_notification_array notifs;
+       bt_notification_array_const notifs;
        uint64_t i;
        uint64_t count;
 
@@ -482,7 +482,7 @@ enum bt_notification_iterator_status muxer_upstream_notif_iter_next(
                         * from the head first.
                         */
                        g_queue_push_tail(muxer_upstream_notif_iter->notifs,
-                               notifs[i]);
+                               (void *) notifs[i]);
                }
                break;
        case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN:
@@ -533,7 +533,7 @@ int muxer_notif_iter_handle_newly_connected_ports(
        while (true) {
                GList *node = muxer_notif_iter->newly_connected_self_ports;
                struct bt_self_component_port_input *self_port;
-               struct bt_port *port;
+               const struct bt_port *port;
                struct bt_self_component_port_input_notification_iterator *
                        upstream_notif_iter = NULL;
                struct muxer_upstream_notif_iter *muxer_upstream_notif_iter;
@@ -600,7 +600,7 @@ end:
 static
 int get_notif_ts_ns(struct muxer_comp *muxer_comp,
                struct muxer_notif_iter *muxer_notif_iter,
-               struct bt_notification *notif, int64_t last_returned_ts_ns,
+               const struct bt_notification *notif, int64_t last_returned_ts_ns,
                int64_t *ts_ns)
 {
        const struct bt_clock_class *clock_class = NULL;
@@ -621,7 +621,7 @@ int get_notif_ts_ns(struct muxer_comp *muxer_comp,
 
        switch (bt_notification_get_type(notif)) {
        case BT_NOTIFICATION_TYPE_EVENT:
-               event = bt_notification_event_borrow_event(notif);
+               event = bt_notification_event_borrow_event_const(notif);
                BT_ASSERT(event);
                cv_status = bt_event_borrow_default_clock_value_const(event,
                        &clock_value);
@@ -629,7 +629,7 @@ int get_notif_ts_ns(struct muxer_comp *muxer_comp,
 
        case BT_NOTIFICATION_TYPE_INACTIVITY:
                clock_value =
-                       bt_notification_inactivity_borrow_default_clock_value(
+                       bt_notification_inactivity_borrow_default_clock_value_const(
                                notif);
                break;
        default:
@@ -871,7 +871,7 @@ muxer_notif_iter_youngest_upstream_notif_iter(
        *muxer_upstream_notif_iter = NULL;
 
        for (i = 0; i < muxer_notif_iter->muxer_upstream_notif_iters->len; i++) {
-               struct bt_notification *notif;
+               const struct bt_notification *notif;
                struct muxer_upstream_notif_iter *cur_muxer_upstream_notif_iter =
                        g_ptr_array_index(muxer_notif_iter->muxer_upstream_notif_iters, i);
                int64_t notif_ts_ns;
@@ -1005,7 +1005,7 @@ static inline
 enum bt_notification_iterator_status muxer_notif_iter_do_next_one(
                struct muxer_comp *muxer_comp,
                struct muxer_notif_iter *muxer_notif_iter,
-               struct bt_notification **notif)
+               const struct bt_notification **notif)
 {
        enum bt_notification_iterator_status status =
                BT_NOTIFICATION_ITERATOR_STATUS_OK;
@@ -1106,7 +1106,7 @@ static
 enum bt_notification_iterator_status muxer_notif_iter_do_next(
                struct muxer_comp *muxer_comp,
                struct muxer_notif_iter *muxer_notif_iter,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count)
 {
        enum bt_notification_iterator_status status =
@@ -1188,7 +1188,7 @@ int muxer_notif_iter_init_newly_connected_ports(struct muxer_comp *muxer_comp,
                struct bt_self_component_port_input *self_port =
                        bt_self_component_filter_borrow_input_port_by_index(
                                muxer_comp->self_comp, i);
-               struct bt_port *port;
+               const struct bt_port *port;
 
                BT_ASSERT(self_port);
                port = bt_self_component_port_as_port(
@@ -1346,7 +1346,7 @@ void muxer_notif_iter_finalize(
 BT_HIDDEN
 enum bt_notification_iterator_status muxer_notif_iter_next(
                struct bt_self_notification_iterator *self_notif_iter,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count)
 {
        enum bt_notification_iterator_status status;
@@ -1387,10 +1387,10 @@ BT_HIDDEN
 enum bt_self_component_status muxer_input_port_connected(
                struct bt_self_component_filter *self_comp,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port)
+               const struct bt_port_output *other_port)
 {
        enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
-       struct bt_port *port = bt_self_component_port_as_port(
+       const struct bt_port *port = bt_self_component_port_as_port(
                bt_self_component_port_input_as_self_component_port(
                        self_port));
        struct muxer_comp *muxer_comp =
@@ -1408,7 +1408,7 @@ enum bt_self_component_status muxer_input_port_connected(
                "other-port-addr=%p, other-port-name=\"%s\"",
                self_comp, muxer_comp, self_port, bt_port_get_name(port),
                other_port,
-               bt_port_get_name(bt_port_output_as_port(other_port)));
+               bt_port_get_name(bt_port_output_as_port_const(other_port)));
 
        for (i = 0; i < muxer_comp->muxer_notif_iters->len; i++) {
                struct muxer_notif_iter *muxer_notif_iter =
@@ -1468,7 +1468,7 @@ void muxer_input_port_disconnected(
                bt_self_component_get_data(
                        bt_self_component_filter_as_self_component(
                                self_component));
-       struct bt_port *port =
+       const struct bt_port *port =
                bt_self_component_port_as_port(
                        bt_self_component_port_input_as_self_component_port(
                                self_port));
index 27bffa9e140aeb80cf8a69489edb12c046d89edc..b070d5c5e7faeec1f9a1260f5238f8f381db2539 100644 (file)
@@ -49,14 +49,14 @@ void muxer_notif_iter_finalize(
 BT_HIDDEN
 enum bt_self_notification_iterator_status muxer_notif_iter_next(
                struct bt_self_notification_iterator *self_notif_iter,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count);
 
 BT_HIDDEN
 enum bt_self_component_status muxer_input_port_connected(
                struct bt_self_component_filter *comp,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port);
+               const struct bt_port_output *other_port);
 
 BT_HIDDEN
 void muxer_input_port_disconnected(
index 6b5699a299139ef5949455da6f232400f1834639..0ea086e44307a94794265cb99aa13da860870a92 100644 (file)
@@ -174,8 +174,8 @@ error:
 }
 
 static
-struct bt_notification *evaluate_event_notification(
-               struct bt_notification *notification,
+const struct bt_notification *evaluate_event_notification(
+               const struct bt_notification *notification,
                struct trimmer_iterator *trim_it,
                struct trimmer_bound *begin, struct trimmer_bound *end,
                bool *_event_in_range, bool *finished)
@@ -190,7 +190,7 @@ struct bt_notification *evaluate_event_notification(
        const struct bt_stream_class *stream_class = NULL;
        struct bt_clock_value *clock_value = NULL;
        bool lazy_update = false;
-       struct bt_notification *new_notification = NULL;
+       const struct bt_notification *new_notification = NULL;
        struct bt_clock_class_priority_map *cc_prio_map;
 
        event = bt_notification_event_get_event(notification);
@@ -375,8 +375,8 @@ int64_t get_raw_timestamp(const struct bt_packet *writer_packet,
 }
 
 static
-struct bt_notification *evaluate_packet_notification(
-               struct bt_notification *notification,
+const struct bt_notification *evaluate_packet_notification(
+               const struct bt_notification *notification,
                struct trimmer_iterator *trim_it,
                struct trimmer_bound *begin, struct trimmer_bound *end,
                bool *_packet_in_range, bool *finished)
@@ -387,7 +387,7 @@ struct bt_notification *evaluate_packet_notification(
        const struct bt_field *packet_context = NULL,
                        *timestamp_begin = NULL,
                        *timestamp_end = NULL;
-       struct bt_notification *new_notification = NULL;
+       const struct bt_notification *new_notification = NULL;
        enum bt_component_status ret;
        bool lazy_update = false;
 
@@ -501,8 +501,8 @@ end_no_notif:
 }
 
 static
-struct bt_notification *evaluate_stream_notification(
-               struct bt_notification *notification,
+const struct bt_notification *evaluate_stream_notification(
+               const struct bt_notification *notification,
                struct trimmer_iterator *trim_it)
 {
        const struct bt_stream *stream;
@@ -517,13 +517,13 @@ struct bt_notification *evaluate_stream_notification(
 /* Return true if the notification should be forwarded. */
 static
 enum bt_notification_iterator_status evaluate_notification(
-               struct bt_notification **notification,
+               const struct bt_notification **notification,
                struct trimmer_iterator *trim_it,
                struct trimmer_bound *begin, struct trimmer_bound *end,
                bool *in_range)
 {
        enum bt_notification_type type;
-       struct bt_notification *new_notification = NULL;
+       const struct bt_notification *new_notification = NULL;
        bool finished = false;
 
        *in_range = true;
index 0d35e7e532fe4d812f865f757f52edfcb46e523f..e6be66a06ddda42d73536ce362edbd3e32cb6296 100644 (file)
@@ -33,7 +33,7 @@
 struct trimmer_iterator {
        /* Input iterator associated with this output iterator. */
        struct bt_notification_iterator *input_iterator;
-       struct bt_notification *current_notification;
+       const struct bt_notification *current_notification;
        FILE *err;
        /* Map between reader and writer packets. */
        GHashTable *packet_map;
index 2234c04c71f7a14df12cfdd8608220fbb0ae9fc4..91066435189ef58596cfa0a63e45a3358a93febe 100644 (file)
@@ -47,7 +47,7 @@ static void dummy_iterator_finalize_method(
 
 static enum bt_self_notification_iterator_status dummy_iterator_next_method(
                struct bt_self_notification_iterator *self_notif_iter,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count)
 {
        return BT_SELF_NOTIFICATION_ITERATOR_STATUS_ERROR;
@@ -55,7 +55,7 @@ static enum bt_self_notification_iterator_status dummy_iterator_next_method(
 
 static enum bt_query_status flt_query_method(
                struct bt_self_component_class_filter *component_class,
-               struct bt_query_executor *query_exec,
+               const struct bt_query_executor *query_exec,
                const char *object, const struct bt_value *params,
                const struct bt_value **result)
 {
index 3b1b15279a3b0d1edce33c32ae9151805b4f65f9..82f7dfb74c4ddd5d1d45840c60e974230b3208fa 100644 (file)
@@ -54,7 +54,7 @@ struct test_event {
 static bool debug = false;
 static enum test current_test;
 static GArray *test_events;
-static struct bt_private_graph *graph;
+static struct bt_graph *graph;
 static struct bt_stream_class *src_stream_class;
 static struct bt_event_class *src_event_class;
 static struct bt_stream *src_stream1;
@@ -347,70 +347,58 @@ enum bt_self_notification_iterator_status src_iter_init(
 static
 void src_iter_next_seq_one(struct bt_self_notification_iterator* notif_iter,
                struct src_iter_user_data *user_data,
-               struct bt_notification **notif)
+               const struct bt_notification **notif)
 {
        struct bt_packet *event_packet = NULL;
 
        switch (user_data->seq[user_data->at]) {
        case SEQ_STREAM1_BEGIN:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_stream_begin_create(
-                               notif_iter, src_stream1));
+               *notif = bt_notification_stream_begin_create(notif_iter,
+                                                                    src_stream1);
                break;
        case SEQ_STREAM2_BEGIN:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_stream_begin_create(
-                               notif_iter, src_stream2));
+               *notif = bt_notification_stream_begin_create(notif_iter,
+                                                            src_stream2);
                break;
        case SEQ_STREAM1_END:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_stream_end_create(
-                               notif_iter, src_stream1));
+               *notif = bt_notification_stream_end_create(notif_iter,
+                                                          src_stream1);
                break;
        case SEQ_STREAM2_END:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_stream_end_create(
-                               notif_iter, src_stream2));
+               *notif = bt_notification_stream_end_create(notif_iter,
+                                                          src_stream2);
                break;
        case SEQ_STREAM1_PACKET1_BEGIN:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_packet_begin_create(
-                               notif_iter, src_stream1_packet1));
+               *notif = bt_notification_packet_begin_create(notif_iter,
+                                                            src_stream1_packet1);
                break;
        case SEQ_STREAM1_PACKET2_BEGIN:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_packet_begin_create(
-                               notif_iter, src_stream1_packet2));
+               *notif = bt_notification_packet_begin_create(notif_iter,
+                                                            src_stream1_packet2);
                break;
        case SEQ_STREAM2_PACKET1_BEGIN:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_packet_begin_create(
-                               notif_iter, src_stream2_packet1));
+               *notif = bt_notification_packet_begin_create(notif_iter,
+                                                            src_stream2_packet1);
                break;
        case SEQ_STREAM2_PACKET2_BEGIN:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_packet_begin_create(
-                               notif_iter, src_stream2_packet2));
+               *notif = bt_notification_packet_begin_create(notif_iter,
+                                                            src_stream2_packet2);
                break;
        case SEQ_STREAM1_PACKET1_END:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_packet_end_create(
-                               notif_iter, src_stream1_packet1));
+               *notif = bt_notification_packet_end_create(notif_iter,
+                                                          src_stream1_packet1);
                break;
        case SEQ_STREAM1_PACKET2_END:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_packet_end_create(
-                               notif_iter, src_stream1_packet2));
+               *notif = bt_notification_packet_end_create(notif_iter,
+                                                          src_stream1_packet2);
                break;
        case SEQ_STREAM2_PACKET1_END:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_packet_end_create(
-                               notif_iter, src_stream2_packet1));
+               *notif = bt_notification_packet_end_create(notif_iter,
+                                                          src_stream2_packet1);
                break;
        case SEQ_STREAM2_PACKET2_END:
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_packet_end_create(
-                               notif_iter, src_stream2_packet2));
+               *notif = bt_notification_packet_end_create(notif_iter,
+                                                          src_stream2_packet2);
                break;
        case SEQ_EVENT_STREAM1_PACKET1:
                event_packet = src_stream1_packet1;
@@ -429,9 +417,9 @@ void src_iter_next_seq_one(struct bt_self_notification_iterator* notif_iter,
        }
 
        if (event_packet) {
-               *notif = bt_private_notification_as_notification(
-                       bt_private_notification_event_create(
-                               notif_iter, src_event_class, event_packet));
+               *notif = bt_notification_event_create(notif_iter,
+                                                     src_event_class,
+                                                     event_packet);
        }
 
        BT_ASSERT(*notif);
@@ -442,7 +430,7 @@ static
 enum bt_self_notification_iterator_status src_iter_next_seq(
                struct bt_self_notification_iterator *notif_iter,
                struct src_iter_user_data *user_data,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count)
 {
        enum bt_self_notification_iterator_status status =
@@ -471,7 +459,7 @@ end:
 static
 enum bt_self_notification_iterator_status src_iter_next(
                struct bt_self_notification_iterator *self_notif_iter,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count)
 {
        struct src_iter_user_data *user_data =
@@ -501,7 +489,7 @@ void src_finalize(struct bt_self_component_source *self_comp)
 }
 
 static
-void append_test_events_from_notification(struct bt_notification *notification)
+void append_test_events_from_notification(const struct bt_notification *notification)
 {
        struct test_event test_event = { 0 };
 
@@ -511,7 +499,7 @@ void append_test_events_from_notification(struct bt_notification *notification)
                const struct bt_event *event;
 
                test_event.type = TEST_EV_TYPE_NOTIF_EVENT;
-               event = bt_notification_event_borrow_event(notification);
+               event = bt_notification_event_borrow_event_const(notification);
                BT_ASSERT(event);
                test_event.packet = bt_event_borrow_packet_const(event);
                BT_ASSERT(test_event.packet);
@@ -520,27 +508,25 @@ void append_test_events_from_notification(struct bt_notification *notification)
        case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
                test_event.type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN;
                test_event.stream =
-                       bt_notification_stream_begin_borrow_stream(
-                               notification);
+                       bt_notification_stream_begin_borrow_stream_const(notification);
                BT_ASSERT(test_event.stream);
                break;
        case BT_NOTIFICATION_TYPE_STREAM_END:
                test_event.type = TEST_EV_TYPE_NOTIF_STREAM_END;
                test_event.stream =
-                       bt_notification_stream_end_borrow_stream(notification);
+                       bt_notification_stream_end_borrow_stream_const(notification);
                BT_ASSERT(test_event.stream);
                break;
        case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
                test_event.type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN;
                test_event.packet =
-                       bt_notification_packet_begin_borrow_packet(
-                               notification);
+                       bt_notification_packet_begin_borrow_packet_const(notification);
                BT_ASSERT(test_event.packet);
                break;
        case BT_NOTIFICATION_TYPE_PACKET_END:
                test_event.type = TEST_EV_TYPE_NOTIF_PACKET_END;
                test_event.packet =
-                       bt_notification_packet_end_borrow_packet(notification);
+                       bt_notification_packet_end_borrow_packet_const(notification);
                BT_ASSERT(test_event.packet);
                break;
        default:
@@ -562,7 +548,7 @@ enum bt_notification_iterator_status common_consume(
                void *notif_iter, bool is_output_port_notif_iter)
 {
        enum bt_notification_iterator_status ret;
-       bt_notification_array notifications = NULL;
+       bt_notification_array_const notifications = NULL;
        uint64_t count = 0;
        struct test_event test_event = { 0 };
        uint64_t i;
@@ -642,7 +628,7 @@ static
 enum bt_self_component_status sink_port_connected(
                struct bt_self_component_sink *self_comp,
                struct bt_self_component_port_input *self_port,
-               struct bt_port_output *other_port)
+               const struct bt_port_output *other_port)
 {
        struct sink_user_data *user_data =
                bt_self_component_get_data(
@@ -689,54 +675,52 @@ void sink_finalize(struct bt_self_component_sink *self_comp)
 }
 
 static
-void create_source_sink(struct bt_private_graph *graph,
-               struct bt_component_source **source,
-               struct bt_component_sink **sink)
+void create_source_sink(struct bt_graph *graph,
+               const struct bt_component_source **source,
+               const struct bt_component_sink **sink)
 {
-       struct bt_private_component_class_source *src_comp_class;
-       struct bt_private_component_class_sink *sink_comp_class;
+       struct bt_component_class_source *src_comp_class;
+       struct bt_component_class_sink *sink_comp_class;
        int ret;
 
        /* Create source component */
        if (source) {
-               src_comp_class = bt_private_component_class_source_create("src",
+               src_comp_class = bt_component_class_source_create("src",
                        src_iter_next);
                BT_ASSERT(src_comp_class);
-               ret = bt_private_component_class_source_set_init_method(
+               ret = bt_component_class_source_set_init_method(
                        src_comp_class, src_init);
                BT_ASSERT(ret == 0);
-               ret = bt_private_component_class_source_set_finalize_method(
+               ret = bt_component_class_source_set_finalize_method(
                        src_comp_class, src_finalize);
                BT_ASSERT(ret == 0);
-               ret = bt_private_component_class_source_set_notification_iterator_init_method(
+               ret = bt_component_class_source_set_notification_iterator_init_method(
                        src_comp_class, src_iter_init);
                BT_ASSERT(ret == 0);
-               ret = bt_private_component_class_source_set_notification_iterator_finalize_method(
+               ret = bt_component_class_source_set_notification_iterator_finalize_method(
                        src_comp_class, src_iter_finalize);
                BT_ASSERT(ret == 0);
-               ret = bt_private_graph_add_source_component(graph,
-                       bt_private_component_class_source_as_component_class_source(
-                               src_comp_class), "source", NULL, source);
+               ret = bt_graph_add_source_component(graph,
+                       src_comp_class, "source", NULL, source);
                BT_ASSERT(ret == 0);
                bt_object_put_ref(src_comp_class);
        }
 
        /* Create sink component */
        if (sink) {
-               sink_comp_class = bt_private_component_class_sink_create("sink",
+               sink_comp_class = bt_component_class_sink_create("sink",
                        sink_consume);
                BT_ASSERT(sink_comp_class);
-               ret = bt_private_component_class_sink_set_init_method(
+               ret = bt_component_class_sink_set_init_method(
                        sink_comp_class, sink_init);
                BT_ASSERT(ret == 0);
-               ret = bt_private_component_class_sink_set_finalize_method(
+               ret = bt_component_class_sink_set_finalize_method(
                        sink_comp_class, sink_finalize);
-               ret = bt_private_component_class_sink_set_input_port_connected_method(
+               ret = bt_component_class_sink_set_input_port_connected_method(
                        sink_comp_class, sink_port_connected);
                BT_ASSERT(ret == 0);
-               ret = bt_private_graph_add_sink_component(graph,
-                       bt_private_component_class_sink_as_component_class_sink(
-                               sink_comp_class),
+               ret = bt_graph_add_sink_component(graph,
+                       sink_comp_class,
                        "sink", NULL, sink);
                BT_ASSERT(ret == 0);
                bt_object_put_ref(sink_comp_class);
@@ -747,34 +731,35 @@ static
 void do_std_test(enum test test, const char *name,
                const struct test_event *expected_test_events)
 {
-       struct bt_component_source *src_comp;
-       struct bt_component_sink *sink_comp;
-       struct bt_port_output *upstream_port;
-       struct bt_port_input *downstream_port;
+       const struct bt_component_source *src_comp;
+       const struct bt_component_sink *sink_comp;
+       const struct bt_port_output *upstream_port;
+       const struct bt_port_input *downstream_port;
        enum bt_graph_status graph_status = BT_GRAPH_STATUS_OK;
 
        clear_test_events();
        current_test = test;
        diag("test: %s", name);
        BT_ASSERT(!graph);
-       graph = bt_private_graph_create();
+       graph = bt_graph_create();
        BT_ASSERT(graph);
        create_source_sink(graph, &src_comp, &sink_comp);
 
        /* Connect source to sink */
-       upstream_port = bt_component_source_borrow_output_port_by_name(
-               src_comp, "out");
+       upstream_port =
+               bt_component_source_borrow_output_port_by_name_const(
+                       src_comp, "out");
        BT_ASSERT(upstream_port);
-       downstream_port = bt_component_sink_borrow_input_port_by_name(
+       downstream_port = bt_component_sink_borrow_input_port_by_name_const(
                sink_comp, "in");
        BT_ASSERT(downstream_port);
-       graph_status = bt_private_graph_connect_ports(graph, upstream_port,
+       graph_status = bt_graph_connect_ports(graph, upstream_port,
                downstream_port, NULL);
 
        /* Run the graph until the end */
        while (graph_status == BT_GRAPH_STATUS_OK ||
                        graph_status == BT_GRAPH_STATUS_AGAIN) {
-               graph_status = bt_private_graph_run(graph);
+               graph_status = bt_graph_run(graph);
        }
 
        ok(graph_status == BT_GRAPH_STATUS_END,
@@ -842,23 +827,23 @@ void test_output_port_notification_iterator(void)
                { .type = TEST_EV_TYPE_END, },
                { .type = TEST_EV_TYPE_SENTINEL, },
        };
-       struct bt_component_source *src_comp;
+       const struct bt_component_source *src_comp;
        struct bt_port_output_notification_iterator *notif_iter;
        enum bt_notification_iterator_status iter_status =
                BT_NOTIFICATION_ITERATOR_STATUS_OK;
-       struct bt_port_output *upstream_port;
+       const struct bt_port_output *upstream_port;
 
        clear_test_events();
        current_test = TEST_OUTPUT_PORT_NOTIFICATION_ITERATOR;
        diag("test: output port notification iterator");
        BT_ASSERT(!graph);
-       graph = bt_private_graph_create();
+       graph = bt_graph_create();
        BT_ASSERT(graph);
        create_source_sink(graph, &src_comp, NULL);
 
        /* Create notification iterator on source's output port */
-       upstream_port = bt_component_source_borrow_output_port_by_name(
-               src_comp, "out");
+       upstream_port = bt_component_source_borrow_output_port_by_name_const(src_comp,
+                                                                            "out");
        notif_iter = bt_port_output_notification_iterator_create(graph,
                upstream_port);
        ok(notif_iter, "bt_private_output_port_notification_iterator_create() succeeds");
index d89d86b2a2fefb36fd8a328b608897f61fb28cd3..720dfb06e920218f56797acdefa099b32b0b6ce6 100644 (file)
@@ -58,78 +58,78 @@ struct event {
 
        union {
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *self_port;
-                       struct bt_port *other_port;
+                       const struct bt_component *comp;
+                       const struct bt_port *self_port;
+                       const struct bt_port *other_port;
                } src_comp_accept_output_port_connection;
 
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *self_port;
-                       struct bt_port *other_port;
+                       const struct bt_component *comp;
+                       const struct bt_port *self_port;
+                       const struct bt_port *other_port;
                } sink_comp_accept_input_port_connection;
 
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *self_port;
-                       struct bt_port *other_port;
+                       const struct bt_component *comp;
+                       const struct bt_port *self_port;
+                       const struct bt_port *other_port;
                } src_comp_output_port_connected;
 
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *self_port;
-                       struct bt_port *other_port;
+                       const struct bt_component *comp;
+                       const struct bt_port *self_port;
+                       const struct bt_port *other_port;
                } sink_comp_input_port_connected;
 
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *self_port;
+                       const struct bt_component *comp;
+                       const struct bt_port *self_port;
                } src_comp_output_port_disconnected;
 
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *self_port;
+                       const struct bt_component *comp;
+                       const struct bt_port *self_port;
                } sink_comp_input_port_disconnected;
 
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *port;
+                       const struct bt_component *comp;
+                       const struct bt_port *port;
                } graph_src_output_port_added;
 
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *port;
+                       const struct bt_component *comp;
+                       const struct bt_port *port;
                } graph_sink_input_port_added;
 
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *port;
+                       const struct bt_component *comp;
+                       const struct bt_port *port;
                } graph_src_output_port_removed;
 
                struct {
-                       struct bt_component *comp;
-                       struct bt_port *port;
+                       const struct bt_component *comp;
+                       const struct bt_port *port;
                } graph_sink_input_port_removed;
 
                struct {
-                       struct bt_component *upstream_comp;
-                       struct bt_component *downstream_comp;
-                       struct bt_port *upstream_port;
-                       struct bt_port *downstream_port;
+                       const struct bt_component *upstream_comp;
+                       const struct bt_component *downstream_comp;
+                       const struct bt_port *upstream_port;
+                       const struct bt_port *downstream_port;
                } graph_src_sink_ports_connected;
 
                struct {
-                       struct bt_component *upstream_comp;
-                       struct bt_component *downstream_comp;
-                       struct bt_port *upstream_port;
-                       struct bt_port *downstream_port;
+                       const struct bt_component *upstream_comp;
+                       const struct bt_component *downstream_comp;
+                       const struct bt_port *upstream_port;
+                       const struct bt_port *downstream_port;
                } graph_src_sink_ports_disconnected;
        } data;
 };
 
 static GArray *events;
-static struct bt_private_component_class_source *src_comp_class;
-static struct bt_private_component_class_sink *sink_comp_class;
+static struct bt_component_class_source *src_comp_class;
+static struct bt_component_class_sink *sink_comp_class;
 static enum test current_test;
 
 static
@@ -366,7 +366,7 @@ size_t event_pos(struct event *event)
 static
 enum bt_self_notification_iterator_status src_iter_next(
                struct bt_self_notification_iterator *self_iterator,
-               bt_notification_array notifs, uint64_t capacity,
+               bt_notification_array_const notifs, uint64_t capacity,
                uint64_t *count)
 {
        return BT_SELF_NOTIFICATION_ITERATOR_STATUS_ERROR;
@@ -376,7 +376,7 @@ static
 enum bt_self_component_status src_accept_output_port_connection(
                struct bt_self_component_source *self_comp,
                struct bt_self_component_port_output *self_comp_port,
-               struct bt_port_input *other_port)
+               const struct bt_port_input *other_port)
 {
        struct event event = {
                .type = SRC_COMP_ACCEPT_OUTPUT_PORT_CONNECTION,
@@ -387,7 +387,7 @@ enum bt_self_component_status src_accept_output_port_connection(
                        .self_port = bt_self_component_port_as_port(
                                bt_self_component_port_output_as_self_component_port(
                                        self_comp_port)),
-                       .other_port = bt_port_input_as_port(other_port),
+                       .other_port = bt_port_input_as_port_const(other_port),
                },
        };
 
@@ -399,7 +399,7 @@ static
 enum bt_self_component_status sink_accept_input_port_connection(
                struct bt_self_component_sink *self_comp,
                struct bt_self_component_port_input *self_comp_port,
-               struct bt_port_output *other_port)
+               const struct bt_port_output *other_port)
 {
        struct event event = {
                .type = SINK_COMP_ACCEPT_INPUT_PORT_CONNECTION,
@@ -410,7 +410,7 @@ enum bt_self_component_status sink_accept_input_port_connection(
                        .self_port = bt_self_component_port_as_port(
                                bt_self_component_port_input_as_self_component_port(
                                        self_comp_port)),
-                       .other_port = bt_port_output_as_port(other_port),
+                       .other_port = bt_port_output_as_port_const(other_port),
                },
        };
 
@@ -422,7 +422,7 @@ static
 enum bt_self_component_status src_output_port_connected(
                struct bt_self_component_source *self_comp,
                struct bt_self_component_port_output *self_comp_port,
-               struct bt_port_input *other_port)
+               const struct bt_port_input *other_port)
 {
        int ret;
        struct event event = {
@@ -434,7 +434,7 @@ enum bt_self_component_status src_output_port_connected(
                        .self_port = bt_self_component_port_as_port(
                                bt_self_component_port_output_as_self_component_port(
                                        self_comp_port)),
-                       .other_port = bt_port_input_as_port(other_port),
+                       .other_port = bt_port_input_as_port_const(other_port),
                },
        };
 
@@ -459,7 +459,7 @@ static
 enum bt_self_component_status sink_input_port_connected(
                struct bt_self_component_sink *self_comp,
                struct bt_self_component_port_input *self_comp_port,
-               struct bt_port_output *other_port)
+               const struct bt_port_output *other_port)
 {
        struct event event = {
                .type = SINK_COMP_INPUT_PORT_CONNECTED,
@@ -470,7 +470,7 @@ enum bt_self_component_status sink_input_port_connected(
                        .self_port = bt_self_component_port_as_port(
                                bt_self_component_port_input_as_self_component_port(
                                        self_comp_port)),
-                       .other_port = bt_port_output_as_port(other_port),
+                       .other_port = bt_port_output_as_port_const(other_port),
                },
        };
 
@@ -584,14 +584,14 @@ enum bt_self_component_status sink_consume(
 }
 
 static
-void graph_src_output_port_added(struct bt_component_source *comp,
-               struct bt_port_output *port, void *data)
+void graph_src_output_port_added(const struct bt_component_source *comp,
+               const struct bt_port_output *port, void *data)
 {
        struct event event = {
                .type = GRAPH_SRC_OUTPUT_PORT_ADDED,
                .data.graph_src_output_port_added = {
-                       .comp = bt_component_source_as_component(comp),
-                       .port = bt_port_output_as_port(port),
+                       .comp = bt_component_source_as_component_const(comp),
+                       .port = bt_port_output_as_port_const(port),
                },
        };
 
@@ -599,14 +599,14 @@ void graph_src_output_port_added(struct bt_component_source *comp,
 }
 
 static
-void graph_sink_input_port_added(struct bt_component_sink *comp,
-               struct bt_port_input *port, void *data)
+void graph_sink_input_port_added(const struct bt_component_sink *comp,
+               const struct bt_port_input *port, void *data)
 {
        struct event event = {
                .type = GRAPH_SINK_INPUT_PORT_ADDED,
                .data.graph_sink_input_port_added = {
-                       .comp = bt_component_sink_as_component(comp),
-                       .port = bt_port_input_as_port(port),
+                       .comp = bt_component_sink_as_component_const(comp),
+                       .port = bt_port_input_as_port_const(port),
                },
        };
 
@@ -614,14 +614,14 @@ void graph_sink_input_port_added(struct bt_component_sink *comp,
 }
 
 static
-void graph_src_output_port_removed(struct bt_component_source *comp,
-               struct bt_port_output *port, void *data)
+void graph_src_output_port_removed(const struct bt_component_source *comp,
+               const struct bt_port_output *port, void *data)
 {
        struct event event = {
                .type = GRAPH_SRC_OUTPUT_PORT_REMOVED,
                .data.graph_src_output_port_removed = {
-                       .comp = bt_component_source_as_component(comp),
-                       .port = bt_port_output_as_port(port),
+                       .comp = bt_component_source_as_component_const(comp),
+                       .port = bt_port_output_as_port_const(port),
                },
        };
 
@@ -629,14 +629,14 @@ void graph_src_output_port_removed(struct bt_component_source *comp,
 }
 
 static
-void graph_sink_input_port_removed(struct bt_component_sink *comp,
-               struct bt_port_input *port, void *data)
+void graph_sink_input_port_removed(const struct bt_component_sink *comp,
+               const struct bt_port_input *port, void *data)
 {
        struct event event = {
                .type = GRAPH_SINK_INPUT_PORT_REMOVED,
                .data.graph_sink_input_port_removed = {
-                       .comp = bt_component_sink_as_component(comp),
-                       .port = bt_port_input_as_port(port),
+                       .comp = bt_component_sink_as_component_const(comp),
+                       .port = bt_port_input_as_port_const(port),
                },
        };
 
@@ -644,22 +644,22 @@ void graph_sink_input_port_removed(struct bt_component_sink *comp,
 }
 
 static
-void graph_src_sink_ports_connected(struct bt_component_source *upstream_comp,
-               struct bt_component_sink *downstream_comp,
-               struct bt_port_output *upstream_port,
-               struct bt_port_input *downstream_port, void *data)
+void graph_src_sink_ports_connected(const struct bt_component_source *upstream_comp,
+               const struct bt_component_sink *downstream_comp,
+               const struct bt_port_output *upstream_port,
+               const struct bt_port_input *downstream_port, void *data)
 {
        struct event event = {
                .type = GRAPH_SRC_SINK_PORTS_CONNECTED,
                .data.graph_src_sink_ports_connected = {
                        .upstream_comp =
-                               bt_component_source_as_component(upstream_comp),
-                       .downstream_comp =
-                               bt_component_sink_as_component(downstream_comp),
-                       .upstream_port =
-                               bt_port_output_as_port(upstream_port),
-                       .downstream_port =
-                               bt_port_input_as_port(downstream_port),
+                               bt_component_source_as_component_const(upstream_comp),
+                               .downstream_comp =
+                               bt_component_sink_as_component_const(downstream_comp),
+                               .upstream_port =
+                               bt_port_output_as_port_const(upstream_port),
+                               .downstream_port =
+                               bt_port_input_as_port_const(downstream_port),
                },
        };
 
@@ -667,22 +667,22 @@ void graph_src_sink_ports_connected(struct bt_component_source *upstream_comp,
 }
 
 static
-void graph_src_sink_ports_disconnected(struct bt_component_source *upstream_comp,
-               struct bt_component_sink *downstream_comp,
-               struct bt_port_output *upstream_port,
-               struct bt_port_input *downstream_port, void *data)
+void graph_src_sink_ports_disconnected(const struct bt_component_source *upstream_comp,
+               const struct bt_component_sink *downstream_comp,
+               const struct bt_port_output *upstream_port,
+               const struct bt_port_input *downstream_port, void *data)
 {
        struct event event = {
                .type = GRAPH_SRC_SINK_PORTS_DISCONNECTED,
                .data.graph_src_sink_ports_disconnected = {
                        .upstream_comp =
-                               bt_component_source_as_component(upstream_comp),
-                       .downstream_comp =
-                               bt_component_sink_as_component(downstream_comp),
-                       .upstream_port =
-                               bt_port_output_as_port(upstream_port),
-                       .downstream_port =
-                               bt_port_input_as_port(downstream_port),
+                               bt_component_source_as_component_const(upstream_comp),
+                               .downstream_comp =
+                               bt_component_sink_as_component_const(downstream_comp),
+                               .upstream_port =
+                               bt_port_output_as_port_const(upstream_port),
+                               .downstream_port =
+                               bt_port_input_as_port_const(downstream_port),
                },
        };
 
@@ -694,34 +694,34 @@ void init_test(void)
 {
        int ret;
 
-       src_comp_class = bt_private_component_class_source_create(
+       src_comp_class = bt_component_class_source_create(
                "src", src_iter_next);
        BT_ASSERT(src_comp_class);
-       ret = bt_private_component_class_source_set_init_method(
+       ret = bt_component_class_source_set_init_method(
                src_comp_class, src_init);
        BT_ASSERT(ret == 0);
-       ret = bt_private_component_class_source_set_accept_output_port_connection_method(
+       ret = bt_component_class_source_set_accept_output_port_connection_method(
                src_comp_class, src_accept_output_port_connection);
        BT_ASSERT(ret == 0);
-       ret = bt_private_component_class_source_set_output_port_connected_method(
+       ret = bt_component_class_source_set_output_port_connected_method(
                src_comp_class, src_output_port_connected);
        BT_ASSERT(ret == 0);
-       ret = bt_private_component_class_source_set_output_port_disconnected_method(
+       ret = bt_component_class_source_set_output_port_disconnected_method(
                src_comp_class, src_output_port_disconnected);
        BT_ASSERT(ret == 0);
-       sink_comp_class = bt_private_component_class_sink_create("sink",
+       sink_comp_class = bt_component_class_sink_create("sink",
                sink_consume);
        BT_ASSERT(sink_comp_class);
-       ret = bt_private_component_class_sink_set_init_method(sink_comp_class,
+       ret = bt_component_class_sink_set_init_method(sink_comp_class,
                sink_init);
        BT_ASSERT(ret == 0);
-       ret = bt_private_component_class_sink_set_accept_input_port_connection_method(
+       ret = bt_component_class_sink_set_accept_input_port_connection_method(
                sink_comp_class, sink_accept_input_port_connection);
        BT_ASSERT(ret == 0);
-       ret = bt_private_component_class_sink_set_input_port_connected_method(
+       ret = bt_component_class_sink_set_input_port_connected_method(
                sink_comp_class, sink_input_port_connected);
        BT_ASSERT(ret == 0);
-       ret = bt_private_component_class_sink_set_input_port_disconnected_method(
+       ret = bt_component_class_sink_set_input_port_disconnected_method(
                sink_comp_class, sink_input_port_disconnected);
        BT_ASSERT(ret == 0);
        events = g_array_new(FALSE, TRUE, sizeof(struct event));
@@ -737,56 +737,52 @@ void fini_test(void)
 }
 
 static
-struct bt_component_source *create_src(struct bt_private_graph *graph)
+const struct bt_component_source *create_src(struct bt_graph *graph)
 {
-       struct bt_component_source *comp;
+       const struct bt_component_source *comp;
        int ret;
 
-       ret = bt_private_graph_add_source_component(graph,
-               bt_private_component_class_source_as_component_class_source(
-                       src_comp_class),
+       ret = bt_graph_add_source_component(graph, src_comp_class,
                "src-comp", NULL, &comp);
        BT_ASSERT(ret == 0);
        return comp;
 }
 
 static
-struct bt_component_sink *create_sink(struct bt_private_graph *graph)
+const struct bt_component_sink *create_sink(struct bt_graph *graph)
 {
-       struct bt_component_sink *comp;
+       const struct bt_component_sink *comp;
        int ret;
 
-       ret = bt_private_graph_add_sink_component(graph,
-               bt_private_component_class_sink_as_component_class_sink(
-                       sink_comp_class),
+       ret = bt_graph_add_sink_component(graph, sink_comp_class,
                "sink-comp", NULL, &comp);
        BT_ASSERT(ret == 0);
        return comp;
 }
 
 static
-struct bt_private_graph *create_graph(void)
+struct bt_graph *create_graph(void)
 {
-       struct bt_private_graph *graph = bt_private_graph_create();
+       struct bt_graph *graph = bt_graph_create();
        int ret;
 
        BT_ASSERT(graph);
-       ret = bt_private_graph_add_source_component_output_port_added_listener(
+       ret = bt_graph_add_source_component_output_port_added_listener(
                graph, graph_src_output_port_added, NULL, NULL, NULL);
        BT_ASSERT(ret >= 0);
-       ret = bt_private_graph_add_sink_component_input_port_added_listener(
+       ret = bt_graph_add_sink_component_input_port_added_listener(
                graph, graph_sink_input_port_added, NULL, NULL, NULL);
        BT_ASSERT(ret >= 0);
-       ret = bt_private_graph_add_source_component_output_port_removed_listener(
+       ret = bt_graph_add_source_component_output_port_removed_listener(
                graph, graph_src_output_port_removed, NULL, NULL, NULL);
        BT_ASSERT(ret >= 0);
-       ret = bt_private_graph_add_sink_component_input_port_removed_listener(
+       ret = bt_graph_add_sink_component_input_port_removed_listener(
                graph, graph_sink_input_port_removed, NULL, NULL, NULL);
        BT_ASSERT(ret >= 0);
-       ret = bt_private_graph_add_source_sink_component_ports_connected_listener(
+       ret = bt_graph_add_source_sink_component_ports_connected_listener(
                graph, graph_src_sink_ports_connected, NULL, NULL, NULL);
        BT_ASSERT(ret >= 0);
-       ret = bt_private_graph_add_source_sink_component_ports_disconnected_listener(
+       ret = bt_graph_add_source_sink_component_ports_disconnected_listener(
                graph, graph_src_sink_ports_disconnected, NULL, NULL, NULL);
        BT_ASSERT(ret >= 0);
        return graph;
@@ -804,15 +800,15 @@ static
 void test_sink_removes_port_in_consume_then_src_removes_disconnected_port(void)
 {
        int ret;
-       struct bt_component_source *src;
-       struct bt_component_sink *sink;
-       struct bt_component *gsrc;
-       struct bt_component *gsink;
-       struct bt_private_graph *graph;
-       struct bt_port_output *src_def_port;
-       struct bt_port_input *sink_def_port;
-       struct bt_port *gsrc_def_port;
-       struct bt_port *gsink_def_port;
+       const struct bt_component_source *src;
+       const struct bt_component_sink *sink;
+       const struct bt_component *gsrc;
+       const struct bt_component *gsink;
+       struct bt_graph *graph;
+       const struct bt_port_output *src_def_port;
+       const struct bt_port_input *sink_def_port;
+       const struct bt_port *gsrc_def_port;
+       const struct bt_port *gsink_def_port;
        struct event event;
        enum bt_graph_status status;
        size_t src_accept_port_connection_pos;
@@ -832,17 +828,19 @@ void test_sink_removes_port_in_consume_then_src_removes_disconnected_port(void)
        BT_ASSERT(graph);
        src = create_src(graph);
        sink = create_sink(graph);
-       src_def_port = bt_component_source_borrow_output_port_by_name(src, "out");
+       src_def_port = bt_component_source_borrow_output_port_by_name_const(src,
+                                                                           "out");
        BT_ASSERT(src_def_port);
-       sink_def_port = bt_component_sink_borrow_input_port_by_name(sink, "in");
+       sink_def_port = bt_component_sink_borrow_input_port_by_name_const(sink,
+                                                                         "in");
        BT_ASSERT(sink_def_port);
-       status = bt_private_graph_connect_ports(graph, src_def_port,
+       status = bt_graph_connect_ports(graph, src_def_port,
                sink_def_port, NULL);
        BT_ASSERT(status == 0);
-       gsrc = bt_component_source_as_component(src);
-       gsink = bt_component_sink_as_component(sink);
-       gsrc_def_port = bt_port_output_as_port(src_def_port);
-       gsink_def_port = bt_port_input_as_port(sink_def_port);
+       gsrc = bt_component_source_as_component_const(src);
+       gsink = bt_component_sink_as_component_const(sink);
+       gsrc_def_port = bt_port_output_as_port_const(src_def_port);
+       gsink_def_port = bt_port_input_as_port_const(sink_def_port);
 
        /* We're supposed to have 7 events so far */
        ok(events->len == 7, "we have the expected number of events (before consume)");
@@ -912,7 +910,7 @@ void test_sink_removes_port_in_consume_then_src_removes_disconnected_port(void)
 
        /* Consume sink once */
        clear_events();
-       ret = bt_private_graph_consume(graph);
+       ret = bt_graph_consume(graph);
        BT_ASSERT(ret == 0);
 
        /* We're supposed to have 5 new events */
@@ -984,15 +982,15 @@ static
 void test_sink_removes_port_in_consume(void)
 {
        int ret;
-       struct bt_component_source *src;
-       struct bt_component_sink *sink;
-       struct bt_component *gsrc;
-       struct bt_component *gsink;
-       struct bt_private_graph *graph;
-       struct bt_port_output *src_def_port;
-       struct bt_port_input *sink_def_port;
-       struct bt_port *gsrc_def_port;
-       struct bt_port *gsink_def_port;
+       const struct bt_component_source *src;
+       const struct bt_component_sink *sink;
+       const struct bt_component *gsrc;
+       const struct bt_component *gsink;
+       struct bt_graph *graph;
+       const struct bt_port_output *src_def_port;
+       const struct bt_port_input *sink_def_port;
+       const struct bt_port *gsrc_def_port;
+       const struct bt_port *gsink_def_port;
        struct event event;
        enum bt_graph_status status;
        size_t src_accept_port_connection_pos;
@@ -1011,17 +1009,19 @@ void test_sink_removes_port_in_consume(void)
        BT_ASSERT(graph);
        src = create_src(graph);
        sink = create_sink(graph);
-       src_def_port = bt_component_source_borrow_output_port_by_name(src, "out");
+       src_def_port = bt_component_source_borrow_output_port_by_name_const(src,
+                                                                           "out");
        BT_ASSERT(src_def_port);
-       sink_def_port = bt_component_sink_borrow_input_port_by_name(sink, "in");
+       sink_def_port = bt_component_sink_borrow_input_port_by_name_const(sink,
+                                                                         "in");
        BT_ASSERT(sink_def_port);
-       status = bt_private_graph_connect_ports(graph, src_def_port,
+       status = bt_graph_connect_ports(graph, src_def_port,
                sink_def_port, NULL);
        BT_ASSERT(status == 0);
-       gsrc = bt_component_source_as_component(src);
-       gsink = bt_component_sink_as_component(sink);
-       gsrc_def_port = bt_port_output_as_port(src_def_port);
-       gsink_def_port = bt_port_input_as_port(sink_def_port);
+       gsrc = bt_component_source_as_component_const(src);
+       gsink = bt_component_sink_as_component_const(sink);
+       gsrc_def_port = bt_port_output_as_port_const(src_def_port);
+       gsink_def_port = bt_port_input_as_port_const(sink_def_port);
 
        /* We're supposed to have 7 events so far */
        ok(events->len == 7, "we have the expected number of events (before consume)");
@@ -1091,7 +1091,7 @@ void test_sink_removes_port_in_consume(void)
 
        /* Consume sink once */
        clear_events();
-       ret = bt_private_graph_consume(graph);
+       ret = bt_graph_consume(graph);
        BT_ASSERT(ret == 0);
 
        /* We're supposed to have 4 new events */
@@ -1147,17 +1147,17 @@ void test_sink_removes_port_in_consume(void)
 static
 void test_src_adds_port_in_port_connected(void)
 {
-       struct bt_component_source *src;
-       struct bt_component_sink *sink;
-       struct bt_component *gsrc;
-       struct bt_component *gsink;
-       struct bt_private_graph *graph;
-       struct bt_port_output *src_def_port;
-       struct bt_port_output *src_hello_port;
-       struct bt_port_input *sink_def_port;
-       struct bt_port *gsrc_def_port;
-       struct bt_port *gsrc_hello_port;
-       struct bt_port *gsink_def_port;
+       const struct bt_component_source *src;
+       const struct bt_component_sink *sink;
+       const struct bt_component *gsrc;
+       const struct bt_component *gsink;
+       struct bt_graph *graph;
+       const struct bt_port_output *src_def_port;
+       const struct bt_port_output *src_hello_port;
+       const struct bt_port_input *sink_def_port;
+       const struct bt_port *gsrc_def_port;
+       const struct bt_port *gsrc_hello_port;
+       const struct bt_port *gsink_def_port;
        struct event event;
        enum bt_graph_status status;
        size_t src_accept_port_connection_pos;
@@ -1173,21 +1173,23 @@ void test_src_adds_port_in_port_connected(void)
        BT_ASSERT(graph);
        src = create_src(graph);
        sink = create_sink(graph);
-       src_def_port = bt_component_source_borrow_output_port_by_name(src, "out");
+       src_def_port = bt_component_source_borrow_output_port_by_name_const(src,
+                                                                           "out");
        BT_ASSERT(src_def_port);
-       sink_def_port = bt_component_sink_borrow_input_port_by_name(sink, "in");
+       sink_def_port = bt_component_sink_borrow_input_port_by_name_const(sink,
+                                                                         "in");
        BT_ASSERT(sink_def_port);
-       status = bt_private_graph_connect_ports(graph, src_def_port,
+       status = bt_graph_connect_ports(graph, src_def_port,
                sink_def_port, NULL);
        BT_ASSERT(status == 0);
-       src_hello_port = bt_component_source_borrow_output_port_by_name(src,
-               "hello");
+       src_hello_port = bt_component_source_borrow_output_port_by_name_const(src,
+                                                                             "hello");
        BT_ASSERT(src_hello_port);
-       gsrc = bt_component_source_as_component(src);
-       gsink = bt_component_sink_as_component(sink);
-       gsrc_def_port = bt_port_output_as_port(src_def_port);
-       gsrc_hello_port = bt_port_output_as_port(src_hello_port);
-       gsink_def_port = bt_port_input_as_port(sink_def_port);
+       gsrc = bt_component_source_as_component_const(src);
+       gsink = bt_component_sink_as_component_const(sink);
+       gsrc_def_port = bt_port_output_as_port_const(src_def_port);
+       gsrc_hello_port = bt_port_output_as_port_const(src_hello_port);
+       gsink_def_port = bt_port_input_as_port_const(sink_def_port);
 
        /* We're supposed to have 8 events */
        ok(events->len == 8, "we have the expected number of events");
@@ -1274,15 +1276,15 @@ void test_src_adds_port_in_port_connected(void)
 static
 void test_simple(void)
 {
-       struct bt_component_source *src;
-       struct bt_component_sink *sink;
-       struct bt_component *gsrc;
-       struct bt_component *gsink;
-       struct bt_private_graph *graph;
-       struct bt_port_output *src_def_port;
-       struct bt_port_input *sink_def_port;
-       struct bt_port *gsrc_def_port;
-       struct bt_port *gsink_def_port;
+       const struct bt_component_source *src;
+       const struct bt_component_sink *sink;
+       const struct bt_component *gsrc;
+       const struct bt_component *gsink;
+       struct bt_graph *graph;
+       const struct bt_port_output *src_def_port;
+       const struct bt_port_input *sink_def_port;
+       const struct bt_port *gsrc_def_port;
+       const struct bt_port *gsink_def_port;
        struct event event;
        enum bt_graph_status status;
        size_t src_accept_port_connection_pos;
@@ -1296,17 +1298,19 @@ void test_simple(void)
        BT_ASSERT(graph);
        src = create_src(graph);
        sink = create_sink(graph);
-       src_def_port = bt_component_source_borrow_output_port_by_name(src, "out");
+       src_def_port = bt_component_source_borrow_output_port_by_name_const(src,
+                                                                           "out");
        BT_ASSERT(src_def_port);
-       sink_def_port = bt_component_sink_borrow_input_port_by_name(sink, "in");
+       sink_def_port = bt_component_sink_borrow_input_port_by_name_const(sink,
+                                                                         "in");
        BT_ASSERT(sink_def_port);
-       status = bt_private_graph_connect_ports(graph, src_def_port,
+       status = bt_graph_connect_ports(graph, src_def_port,
                sink_def_port, NULL);
        BT_ASSERT(status == 0);
-       gsrc = bt_component_source_as_component(src);
-       gsink = bt_component_sink_as_component(sink);
-       gsrc_def_port = bt_port_output_as_port(src_def_port);
-       gsink_def_port = bt_port_input_as_port(sink_def_port);
+       gsrc = bt_component_source_as_component_const(src);
+       gsink = bt_component_sink_as_component_const(sink);
+       gsrc_def_port = bt_port_output_as_port_const(src_def_port);
+       gsink_def_port = bt_port_input_as_port_const(sink_def_port);
 
        /* We're supposed to have 7 events */
        ok(events->len == 7, "we have the expected number of events");
@@ -1382,16 +1386,16 @@ void test_simple(void)
 static
 void test_src_port_connected_error(void)
 {
-       struct bt_component_source *src;
-       struct bt_component_sink *sink;
-       struct bt_component *gsrc;
-       struct bt_component *gsink;
-       struct bt_private_graph *graph;
-       struct bt_port_output *src_def_port;
-       struct bt_port_input *sink_def_port;
-       struct bt_port *gsrc_def_port;
-       struct bt_port *gsink_def_port;
-       struct bt_connection *conn = NULL;
+       const struct bt_component_source *src;
+       const struct bt_component_sink *sink;
+       const struct bt_component *gsrc;
+       const struct bt_component *gsink;
+       struct bt_graph *graph;
+       const struct bt_port_output *src_def_port;
+       const struct bt_port_input *sink_def_port;
+       const struct bt_port *gsrc_def_port;
+       const struct bt_port *gsink_def_port;
+       const struct bt_connection *conn = NULL;
        struct event event;
        enum bt_graph_status status;
        size_t src_accept_port_connection_pos;
@@ -1402,19 +1406,21 @@ void test_src_port_connected_error(void)
        BT_ASSERT(graph);
        src = create_src(graph);
        sink = create_sink(graph);
-       src_def_port = bt_component_source_borrow_output_port_by_name(src, "out");
+       src_def_port = bt_component_source_borrow_output_port_by_name_const(src,
+                                                                           "out");
        BT_ASSERT(src_def_port);
-       sink_def_port = bt_component_sink_borrow_input_port_by_name(sink, "in");
+       sink_def_port = bt_component_sink_borrow_input_port_by_name_const(sink,
+                                                                         "in");
        BT_ASSERT(sink_def_port);
-       status = bt_private_graph_connect_ports(graph, src_def_port,
+       status = bt_graph_connect_ports(graph, src_def_port,
                sink_def_port, &conn);
        ok(status != BT_GRAPH_STATUS_OK,
-               "bt_private_graph_connect_ports() returns an error");
+               "bt_graph_connect_ports() returns an error");
        ok(!conn, "returned connection is still NULL");
-       gsrc = bt_component_source_as_component(src);
-       gsink = bt_component_sink_as_component(sink);
-       gsrc_def_port = bt_port_output_as_port(src_def_port);
-       gsink_def_port = bt_port_input_as_port(sink_def_port);
+       gsrc = bt_component_source_as_component_const(src);
+       gsink = bt_component_sink_as_component_const(sink);
+       gsrc_def_port = bt_port_output_as_port_const(src_def_port);
+       gsink_def_port = bt_port_input_as_port_const(sink_def_port);
 
        /* We're supposed to have 5 events */
        ok(events->len == 5, "we have the expected number of events");
@@ -1467,16 +1473,16 @@ void test_src_port_connected_error(void)
 static
 void test_sink_port_connected_error(void)
 {
-       struct bt_component_source *src;
-       struct bt_component_sink *sink;
-       struct bt_component *gsrc;
-       struct bt_component *gsink;
-       struct bt_private_graph *graph;
-       struct bt_port_output *src_def_port;
-       struct bt_port_input *sink_def_port;
-       struct bt_port *gsrc_def_port;
-       struct bt_port *gsink_def_port;
-       struct bt_connection *conn = NULL;
+       const struct bt_component_source *src;
+       const struct bt_component_sink *sink;
+       const struct bt_component *gsrc;
+       const struct bt_component *gsink;
+       struct bt_graph *graph;
+       const struct bt_port_output *src_def_port;
+       const struct bt_port_input *sink_def_port;
+       const struct bt_port *gsrc_def_port;
+       const struct bt_port *gsink_def_port;
+       const struct bt_connection *conn = NULL;
        struct event event;
        enum bt_graph_status status;
        size_t src_accept_port_connection_pos;
@@ -1490,19 +1496,21 @@ void test_sink_port_connected_error(void)
        BT_ASSERT(graph);
        src = create_src(graph);
        sink = create_sink(graph);
-       src_def_port = bt_component_source_borrow_output_port_by_name(src, "out");
+       src_def_port = bt_component_source_borrow_output_port_by_name_const(src,
+                                                                           "out");
        BT_ASSERT(src_def_port);
-       sink_def_port = bt_component_sink_borrow_input_port_by_name(sink, "in");
+       sink_def_port = bt_component_sink_borrow_input_port_by_name_const(sink,
+                                                                         "in");
        BT_ASSERT(sink_def_port);
-       status = bt_private_graph_connect_ports(graph, src_def_port,
+       status = bt_graph_connect_ports(graph, src_def_port,
                sink_def_port, &conn);
        ok(status != BT_GRAPH_STATUS_OK,
-               "bt_private_graph_connect_ports() returns an error");
+               "bt_graph_connect_ports() returns an error");
        ok(!conn, "returned connection is still NULL");
-       gsrc = bt_component_source_as_component(src);
-       gsink = bt_component_sink_as_component(sink);
-       gsrc_def_port = bt_port_output_as_port(src_def_port);
-       gsink_def_port = bt_port_input_as_port(sink_def_port);
+       gsrc = bt_component_source_as_component_const(src);
+       gsink = bt_component_sink_as_component_const(sink);
+       gsrc_def_port = bt_port_output_as_port_const(src_def_port);
+       gsink_def_port = bt_port_input_as_port_const(sink_def_port);
 
        /* We're supposed to have 5 events */
        ok(events->len == 7, "we have the expected number of events");
@@ -1575,7 +1583,7 @@ void test_sink_port_connected_error(void)
 static
 void test_empty_graph(void)
 {
-       struct bt_private_graph *graph;
+       struct bt_graph *graph;
 
        prepare_test(TEST_EMPTY_GRAPH, "empty graph");
        graph = create_graph();
index 4cc1125515312e56f622c4414a970ab095d6a0f3..a8ddcb50215bb10707b16bdc9b93ece06ab3e439 100644 (file)
@@ -111,10 +111,10 @@ static void test_sfs(const char *plugin_dir)
 {
        const struct bt_plugin_set *plugin_set;
        const struct bt_plugin *plugin;
-       struct bt_component_class_sink *sink_comp_class;
-       struct bt_component_class_source *source_comp_class;
-       struct bt_component_class_filter *filter_comp_class;
-       struct bt_component_sink *sink_component;
+       const struct bt_component_class_sink *sink_comp_class;
+       const struct bt_component_class_source *source_comp_class;
+       const struct bt_component_class_filter *filter_comp_class;
+       const struct bt_component_sink *sink_component;
        char *sfs_path = get_test_plugin_path(plugin_dir, "sfs");
        unsigned int major, minor, patch;
        const char *extra;
@@ -122,11 +122,10 @@ static void test_sfs(const char *plugin_dir)
        const struct bt_value *results;
        const struct bt_value *object;
        const struct bt_value *res_params;
-       struct bt_private_graph *graph;
+       struct bt_graph *graph;
        const char *object_str;
        enum bt_graph_status graph_ret;
-       struct bt_private_query_executor *query_exec =
-               bt_private_query_executor_create();
+       struct bt_query_executor *query_exec = bt_query_executor_create();
        int ret;
 
        BT_ASSERT(query_exec);
@@ -163,12 +162,11 @@ static void test_sfs(const char *plugin_dir)
                plugin, "sink");
        ok(sink_comp_class,
                "bt_plugin_borrow_sink_component_class_by_name_const() finds a sink component class");
-       ok(strcmp(bt_component_class_get_help(
-               bt_component_class_sink_as_component_class(sink_comp_class)),
-               "Bacon ipsum dolor amet strip steak cupim pastrami venison shoulder.\n"
-               "Prosciutto beef ribs flank meatloaf pancetta brisket kielbasa drumstick\n"
-               "venison tenderloin cow tail. Beef short loin shoulder meatball, sirloin\n"
-               "ground round brisket salami cupim pork bresaola turkey bacon boudin.\n") == 0,
+       ok(strcmp(bt_component_class_get_help(bt_component_class_sink_as_component_class_const(sink_comp_class)),
+                 "Bacon ipsum dolor amet strip steak cupim pastrami venison shoulder.\n"
+                 "Prosciutto beef ribs flank meatloaf pancetta brisket kielbasa drumstick\n"
+                 "venison tenderloin cow tail. Beef short loin shoulder meatball, sirloin\n"
+                 "ground round brisket salami cupim pork bresaola turkey bacon boudin.\n") == 0,
                "bt_component_class_get_help() returns the expected help text");
 
        filter_comp_class = bt_plugin_borrow_filter_component_class_by_name_const(
@@ -177,10 +175,10 @@ static void test_sfs(const char *plugin_dir)
                "bt_plugin_borrow_filter_component_class_by_name_const() finds a filter component class");
        params = bt_value_integer_create_init(23);
        BT_ASSERT(params);
-       ret = bt_private_query_executor_query(query_exec,
-               bt_component_class_filter_as_component_class(filter_comp_class),
+       ret = bt_query_executor_query(query_exec,
+               bt_component_class_filter_as_component_class_const(filter_comp_class),
                "get-something", params, &results);
-       ok(ret == 0 && results, "bt_private_query_executor_query() succeeds");
+       ok(ret == 0 && results, "bt_query_executor_query() succeeds");
        BT_ASSERT(bt_value_is_array(results) && bt_value_array_get_size(results) == 2);
        object = bt_value_array_borrow_element_by_index_const(results, 0);
        BT_ASSERT(object && bt_value_is_string(object));
@@ -194,12 +192,12 @@ static void test_sfs(const char *plugin_dir)
        bt_object_get_ref(sink_comp_class);
        diag("> putting the plugin set object here");
        BT_OBJECT_PUT_REF_AND_RESET(plugin_set);
-       graph = bt_private_graph_create();
+       graph = bt_graph_create();
        BT_ASSERT(graph);
-       graph_ret = bt_private_graph_add_sink_component(graph, sink_comp_class, "the-sink",
-               NULL, &sink_component);
+       graph_ret = bt_graph_add_sink_component(graph, sink_comp_class,
+               "the-sink", NULL, &sink_component);
        ok(graph_ret == BT_GRAPH_STATUS_OK && sink_component,
-               "bt_private_graph_add_sink_component() still works after the plugin object is destroyed");
+               "bt_graph_add_sink_component() still works after the plugin object is destroyed");
        BT_OBJECT_PUT_REF_AND_RESET(sink_component);
        bt_object_put_ref(graph);
 
This page took 0.231895 seconds and 4 git commands to generate.