};
/* 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;
static
BOOL WINAPI signal_handler(DWORD signal) {
if (the_graph) {
- bt_private_graph_cancel(the_graph);
+ bt_graph_cancel(the_graph);
}
canceled = true;
}
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;
{
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;
}
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)
{
}
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:
"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,
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\", "
}
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();
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;
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);
{
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) {
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,
}
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 =
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;
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;
GHashTable *sink_components;
/* Owned by this */
- struct bt_private_graph *graph;
+ struct bt_graph *graph;
/* Weak */
struct bt_config *cfg;
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;
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) ==
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,
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) {
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;
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;
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;
*/
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) {
*/
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;
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\"",
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) : "",
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);
}
}
}
- 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) {
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) {
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;
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");
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++) {
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);
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();
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,
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);
(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;
}
(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;
}
/* 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
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) {
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;
}
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;
}
# 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 \
#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>
#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>
#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>
--- /dev/null
+#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 */
--- /dev/null
+#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 */
* 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
* 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>
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;
};
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
#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;
};
--- /dev/null
+#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 */
* 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
--- /dev/null
+#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 */
* 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
* 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" {
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
}
--- /dev/null
+#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 */
--- /dev/null
+#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 */
*/
#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>
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);
+++ /dev/null
-#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 */
*/
#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>
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(
--- /dev/null
+#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 */
#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>
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);
+++ /dev/null
-#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 */
--- /dev/null
+#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 */
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);
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
--- /dev/null
+#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 */
* 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>
+++ /dev/null
-#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 */
--- /dev/null
+#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 */
--- /dev/null
+#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 */
#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>
/* 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
}
--- /dev/null
+#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 */
--- /dev/null
+#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 */
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
--- /dev/null
+#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 */
#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;
* 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
}
#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>
#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>
--- /dev/null
+#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 */
#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
--- /dev/null
+#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 */
* 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
}
+++ /dev/null
-#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 */
--- /dev/null
+#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 */
--- /dev/null
+#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 */
+++ /dev/null
-#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 */
* SOFTWARE.
*/
-#include <babeltrace/graph/port.h>
+#include <babeltrace/graph/port-const.h>
struct bt_port {
struct bt_object base;
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);
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)
{
--- /dev/null
+#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 */
/* 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" {
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
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
}
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
+++ /dev/null
-#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 */
--- /dev/null
+#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 */
#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;
* 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
}
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
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
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
}
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);
/* 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" {
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
}
}
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
}
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
};
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(
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
}
}
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 *
}
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 *
};
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);
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
}
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
}
/* 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
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));
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));
* _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 = { \
* _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 = { \
* _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 = { \
*
* _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)
*
* _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)
*
* _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)
*
* _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)
*
* _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)
*
* _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)
*
* _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)
*
* _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)
*
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
* _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)
*
* _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)
*
* _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)
*
* _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)
* 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)
* 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)
* 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)
* 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)
* 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)
* 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)
* 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)
* 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)
* 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)
*
* _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)
*
* _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)
*
* _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)
*
* _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)
* 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)
* 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)
* 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)
* 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)
* 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)
* 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)
* 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)
* 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)
*
* _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)
*
* _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)
*
* _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)
*
* _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)
* SOFTWARE.
*/
-#include <babeltrace/babeltrace.h>
+#include <babeltrace/version.h>
#include <babeltrace/types.h>
#include <stdlib.h>
#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;
};
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 =
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);
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:
#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>
#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
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;
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;
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;
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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 &&
}
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 &&
}
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;
}
#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>
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;
}
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);
(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);
}
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(
(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(
#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>
}
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;
}
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);
(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(
#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>
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;
}
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);
}
(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);
}
#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>
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,
}
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;
}
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;
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;
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));
* 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);
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;
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));
}
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;
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));
}
#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>
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;
}
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;
}
}
}
-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;
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;
}
#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;
};
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
* 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,
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;
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;
"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;
"%![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);
/*
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");
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");
*
* 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.
*/
}
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,
}
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,
}
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,
}
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,
}
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,
}
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,
}
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,
}
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,
}
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,
}
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,
}
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,
}
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,
}
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,
}
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,
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) {
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) {
}
}
-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;
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;
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;
}
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,
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,
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,
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);
}
#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>
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",
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 ==
}
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;
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)
{
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:
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 */
* 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: "
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;
}
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:
"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;
}
"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;
"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;
"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;
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++) {
}
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;
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;
*/
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++) {
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 ==
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;
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;
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) ==
/* 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,
* 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: "
#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>
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)
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);
}
#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>
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)
{
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");
"%![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;
#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>
}
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;
#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>
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)
{
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;
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);
}
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)
{
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;
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);
}
#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>
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)
{
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;
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");
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)
{
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;
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");
#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>
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(
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;
#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>
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;
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;
"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,
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;
#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>
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;
};
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\", "
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:
}
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.");
}
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.");
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
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) {
}
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) {
}
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) {
}
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) {
}
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) {
}
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) {
#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>
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);
}
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);
}
}
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");
}
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");
}
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,
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 {
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);
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: "
goto end;
}
- notit->event = bt_private_notification_event_borrow_event(
+ notit->event = bt_notification_event_borrow_event(
notit->event_notif);
BT_ASSERT(notit->event);
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;
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) {
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: "
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: "
}
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: "
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);
}
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: "
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;
}
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: "
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;
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
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;
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;
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);
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);
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;
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(
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) ==
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 {
}
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
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);
}
}
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 =
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)
{
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);
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 */
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;
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);
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,
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,
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) {
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;
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 =
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;
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;
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;
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 = {
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 = {
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 */
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;
};
}
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:
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,
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,
}
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;
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) {
}
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;
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) {
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;
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;
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;
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 =
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++;
}
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 */
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;
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;
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));
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 */
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;
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(
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;
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));
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)) {
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);
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;
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;
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(
/* 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;
};
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))) {
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 =
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;
* 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:
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;
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;
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);
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:
*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;
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;
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 =
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(
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;
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 =
"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 =
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));
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(
}
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)
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);
}
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)
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;
}
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;
/* 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;
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;
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;
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)
{
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;
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;
}
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);
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 =
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 =
}
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 };
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);
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:
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;
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(
}
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);
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,
{ .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");
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
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;
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,
.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),
},
};
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,
.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),
},
};
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 = {
.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),
},
};
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,
.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),
},
};
}
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),
},
};
}
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),
},
};
}
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),
},
};
}
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),
},
};
}
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),
},
};
}
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),
},
};
{
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));
}
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;
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;
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)");
/* 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 */
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;
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)");
/* 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 */
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;
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");
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;
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");
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;
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");
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;
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");
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();
{
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;
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);
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(
"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));
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);