We're not borrowing anything, we're just converting the type.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
ret = validate_all_components_connected_in_array(
cfg->cmd_data.run.sources,
- bt_private_value_borrow_value(connected_components),
+ bt_private_value_as_value(connected_components),
error_buf, error_buf_size);
if (ret) {
goto end;
ret = validate_all_components_connected_in_array(
cfg->cmd_data.run.filters,
- bt_private_value_borrow_value(connected_components),
+ bt_private_value_as_value(connected_components),
error_buf, error_buf_size);
if (ret) {
goto end;
ret = validate_all_components_connected_in_array(
cfg->cmd_data.run.sinks,
- bt_private_value_borrow_value(connected_components),
+ bt_private_value_as_value(connected_components),
error_buf, error_buf_size);
if (ret) {
goto end;
connection->downstream_comp_name->str,
connection->downstream_port_glob->str);
- if (bt_value_map_has_entry(bt_private_value_borrow_value(
+ if (bt_value_map_has_entry(bt_private_value_as_value(
flat_connection_names),
flat_connection_name->str)) {
snprintf(error_buf, error_buf_size,
}
if (bt_value_map_has_entry(
- bt_private_value_borrow_value(state->params),
+ bt_private_value_as_value(state->params),
state->last_map_key)) {
g_string_append_printf(state->ini_error,
"Duplicate parameter key: `%s`\n",
goto error;
}
- value = bt_private_value_borrow_value(
+ value = bt_private_value_as_value(
bt_private_value_integer_create_init(
(int64_t) int_val));
break;
}
case G_TOKEN_FLOAT:
/* Positive floating point number */
- value = bt_private_value_borrow_value(
+ value = bt_private_value_as_value(
bt_private_value_real_create_init(
state->scanner->value.v_float));
break;
case G_TOKEN_STRING:
/* Quoted string */
- value = bt_private_value_borrow_value(
+ value = bt_private_value_as_value(
bt_private_value_string_create_init(
state->scanner->value.v_string));
break;
} else if (!strcmp(id, "true") || !strcmp(id, "TRUE") ||
!strcmp(id, "yes") ||
!strcmp(id, "YES")) {
- value = bt_private_value_borrow_value(
+ value = bt_private_value_as_value(
bt_private_value_bool_create_init(true));
} else if (!strcmp(id, "false") ||
!strcmp(id, "FALSE") ||
!strcmp(id, "no") ||
!strcmp(id, "NO")) {
- value = bt_private_value_borrow_value(
+ value = bt_private_value_as_value(
bt_private_value_bool_create_init(false));
} else {
- value = bt_private_value_borrow_value(
+ value = bt_private_value_as_value(
bt_private_value_string_create_init(id));
}
break;
goto error;
}
- value = bt_private_value_borrow_value(
+ value = bt_private_value_as_value(
bt_private_value_integer_create_init(
-((int64_t) int_val)));
break;
}
case G_TOKEN_FLOAT:
/* Negative floating point number */
- value = bt_private_value_borrow_value(
+ value = bt_private_value_as_value(
bt_private_value_real_create_init(
-state->scanner->value.v_float));
break;
goto end;
}
- if (bt_value_map_has_entry(bt_private_value_borrow_value(instance_names),
+ if (bt_value_map_has_entry(bt_private_value_as_value(instance_names),
cfg_comp->instance_name->str)) {
printf_err("Duplicate component instance name:\n %s\n",
cfg_comp->instance_name->str);
bt_object_put_ref(cur_cfg_comp->params);
status = bt_value_copy(
&cur_cfg_comp->params,
- bt_private_value_borrow_value(cur_base_params));
+ bt_private_value_as_value(cur_base_params));
if (status != BT_VALUE_STATUS_OK) {
print_err_oom();
goto error;
}
status = bt_value_map_extend(¶ms_to_set,
- bt_private_value_borrow_value(cur_cfg_comp->params),
- bt_private_value_borrow_value(params));
+ bt_private_value_as_value(cur_cfg_comp->params),
+ bt_private_value_as_value(params));
BT_OBJECT_PUT_REF_AND_RESET(params);
if (status != BT_VALUE_STATUS_OK) {
printf_err("Cannot extend current component parameters with --params option's argument:\n %s\n",
}
ret = bt_config_cli_args_create_connections(cfg,
- bt_private_value_borrow_value(connection_args),
+ bt_private_value_as_value(connection_args),
error_buf, 256);
if (ret) {
printf_err("Cannot creation connections:\n%s", error_buf);
}
name = get_component_auto_name(prefix,
- bt_private_value_borrow_value(existing_names));
+ bt_private_value_as_value(existing_names));
if (!name) {
ret = -1;
}
for (i = 0; i < bt_value_array_get_size(
- bt_private_value_borrow_value(impl_args->extra_params));
+ bt_private_value_as_value(impl_args->extra_params));
i++) {
struct bt_value *elem;
const char *arg;
elem = bt_value_array_borrow_element_by_index(
- bt_private_value_borrow_value(impl_args->extra_params),
+ bt_private_value_as_value(impl_args->extra_params),
i);
if (!elem) {
goto error;
* component.
*/
name = get_component_auto_name(cur_name_prefix->str,
- bt_private_value_borrow_value(all_names));
+ bt_private_value_as_value(all_names));
append_name_opt = true;
} else {
/*
* component.
*/
if (bt_value_map_has_entry(
- bt_private_value_borrow_value(all_names),
+ bt_private_value_as_value(all_names),
cur_name->str)) {
printf_err("Duplicate component instance name:\n %s\n",
cur_name->str);
*/
BT_OBJECT_PUT_REF_AND_RESET(impl_args->extra_params);
status = bt_value_copy(&impl_args->extra_params,
- bt_private_value_borrow_value(
+ bt_private_value_as_value(
base_implicit_ctf_input_args->extra_params));
if (status != BT_VALUE_STATUS_OK) {
print_err_oom();
implicit_text_args.exists = true;
ret = insert_flat_params_from_array(
implicit_text_args.params_arg,
- bt_private_value_borrow_value(fields), "field");
+ bt_private_value_as_value(fields), "field");
bt_object_put_ref(fields);
if (ret) {
goto error;
implicit_text_args.exists = true;
ret = insert_flat_params_from_array(
implicit_text_args.params_arg,
- bt_private_value_borrow_value(names), "name");
+ bt_private_value_as_value(names), "name");
bt_object_put_ref(names);
if (ret) {
goto error;
}
for (i = 0; i < bt_value_array_get_size(
- bt_private_value_borrow_value(run_args)); i++) {
+ bt_private_value_as_value(run_args)); i++) {
struct bt_value *arg_value =
bt_value_array_borrow_element_by_index(
- bt_private_value_borrow_value(run_args),
+ bt_private_value_as_value(run_args),
i);
const char *arg;
GString *quoted = NULL;
}
if (i < bt_value_array_get_size(
- bt_private_value_borrow_value(run_args)) - 1) {
+ bt_private_value_as_value(run_args)) - 1) {
if (print_run_args) {
putchar(' ');
} else {
}
cfg = bt_config_run_from_args_array(
- bt_private_value_borrow_value(run_args), retcode,
+ bt_private_value_as_value(run_args), retcode,
force_omit_system_plugin_path, force_omit_home_plugin_path,
initial_plugin_paths);
if (!cfg) {
if (usleep(sleep_time_us)) {
if (bt_query_executor_is_canceled(
- bt_private_query_executor_borrow_query_executor(the_query_executor))) {
+ bt_private_query_executor_as_query_executor(the_query_executor))) {
BT_LOGI("Query was canceled by user: "
"comp-cls-addr=%p, comp-cls-name=\"%s\", "
"query-obj=\"%s\"", comp_cls,
switch (comp_class_type) {
case BT_COMPONENT_CLASS_TYPE_SOURCE:
- comp_cls = bt_component_class_source_borrow_component_class(
+ comp_cls = bt_component_class_source_as_component_class(
find_source_component_class(plugin_name,
comp_class_name));
break;
case BT_COMPONENT_CLASS_TYPE_FILTER:
- comp_cls = bt_component_class_filter_borrow_component_class(
+ comp_cls = bt_component_class_filter_as_component_class(
find_filter_component_class(plugin_name,
comp_class_name));
break;
case BT_COMPONENT_CLASS_TYPE_SINK:
- comp_cls = bt_component_class_sink_borrow_component_class(
+ comp_cls = bt_component_class_sink_as_component_class(
find_sink_component_class(plugin_name,
comp_class_name));
break;
fprintf(stderr, " Parameters:\n");
print_value(stderr,
- bt_private_value_borrow_value(bt_config_component->params), 8);
+ bt_private_value_as_value(bt_config_component->params), 8);
}
static
{
size_t i;
- print_plugin_paths(bt_private_value_borrow_value(cfg->plugin_paths));
+ print_plugin_paths(bt_private_value_as_value(cfg->plugin_paths));
fprintf(stderr, " Source component instances:\n");
print_bt_config_components(cfg->cmd_data.run.sources);
static
void print_cfg_list_plugins(struct bt_config *cfg)
{
- print_plugin_paths(bt_private_value_borrow_value(cfg->plugin_paths));
+ print_plugin_paths(bt_private_value_as_value(cfg->plugin_paths));
}
static
void print_cfg_help(struct bt_config *cfg)
{
- print_plugin_paths(bt_private_value_borrow_value(cfg->plugin_paths));
+ print_plugin_paths(bt_private_value_as_value(cfg->plugin_paths));
}
static
void print_cfg_print_ctf_metadata(struct bt_config *cfg)
{
- print_plugin_paths(bt_private_value_borrow_value(cfg->plugin_paths));
+ print_plugin_paths(bt_private_value_as_value(cfg->plugin_paths));
fprintf(stderr, " Path: %s\n",
cfg->cmd_data.print_ctf_metadata.path->str);
}
static
void print_cfg_print_lttng_live_sessions(struct bt_config *cfg)
{
- print_plugin_paths(bt_private_value_borrow_value(cfg->plugin_paths));
+ print_plugin_paths(bt_private_value_as_value(cfg->plugin_paths));
fprintf(stderr, " URL: %s\n",
cfg->cmd_data.print_lttng_live_sessions.url->str);
}
static
void print_cfg_query(struct bt_config *cfg)
{
- print_plugin_paths(bt_private_value_borrow_value(cfg->plugin_paths));
+ print_plugin_paths(bt_private_value_as_value(cfg->plugin_paths));
fprintf(stderr, " Object: `%s`\n", cfg->cmd_data.query.object->str);
fprintf(stderr, " Component class:\n");
print_bt_config_component(cfg->cmd_data.query.cfg_component);
}
ret = query(comp_cls, cfg->cmd_data.query.object->str,
- bt_private_value_borrow_value(
+ bt_private_value_as_value(
cfg->cmd_data.query.cfg_component->params),
&results, &fail_reason);
if (ret) {
int plugins_count, component_classes_count = 0, i;
printf("From the following plugin paths:\n\n");
- print_value(stdout, bt_private_value_borrow_value(cfg->plugin_paths), 2);
+ print_value(stdout, bt_private_value_as_value(cfg->plugin_paths), 2);
printf("\n");
plugins_count = loaded_plugins->len;
if (plugins_count == 0) {
(plugin_borrow_comp_cls_by_index_func_t)
bt_plugin_borrow_source_component_class_by_name,
(spec_comp_cls_borrow_comp_cls_func_t)
- bt_component_class_source_borrow_component_class);
+ bt_component_class_source_as_component_class);
cmd_list_plugins_print_component_classes(plugin, "Filter",
bt_plugin_get_filter_component_class_count(plugin),
(plugin_borrow_comp_cls_by_index_func_t)
bt_plugin_borrow_filter_component_class_by_name,
(spec_comp_cls_borrow_comp_cls_func_t)
- bt_component_class_filter_borrow_component_class);
+ bt_component_class_filter_as_component_class);
cmd_list_plugins_print_component_classes(plugin, "Sink",
bt_plugin_get_sink_component_class_count(plugin),
(plugin_borrow_comp_cls_by_index_func_t)
bt_plugin_borrow_sink_component_class_by_name,
(spec_comp_cls_borrow_comp_cls_func_t)
- bt_component_class_sink_borrow_component_class);
+ bt_component_class_sink_as_component_class);
}
end:
goto error;
}
- ret = query(comp_cls, "sessions", bt_private_value_borrow_value(params),
+ ret = query(comp_cls, "sessions", bt_private_value_as_value(params),
&results, &fail_reason);
if (ret) {
goto failed;
}
ret = query(comp_cls, "metadata-info",
- bt_private_value_borrow_value(params), &results, &fail_reason);
+ bt_private_value_as_value(params), &results, &fail_reason);
if (ret) {
goto failed;
}
typedef struct bt_port_input *(*borrow_input_port_by_index_func_t)(
void *, uint64_t);
struct bt_port *upstream_port =
- bt_port_output_borrow_port(out_upstream_port);
+ bt_port_output_as_port(out_upstream_port);
int ret = 0;
GQuark downstreamp_comp_name_quark;
struct bt_port_input *in_downstream_port =
port_by_index_fn(downstream_comp, i);
struct bt_port *downstream_port =
- bt_port_input_borrow_port(in_downstream_port);
+ bt_port_input_as_port(in_downstream_port);
const char *upstream_port_name;
const char *downstream_port_name;
ctx->connect_ports = false;
graph_status = bt_private_graph_add_filter_component(
ctx->graph, trimmer_class, trimmer_name,
- bt_private_value_borrow_value(trimmer_params),
+ bt_private_value_as_value(trimmer_params),
&trimmer);
free(trimmer_name);
if (graph_status != BT_GRAPH_STATUS_OK) {
*/
in_downstream_port = trimmer_input;
downstream_port =
- bt_port_input_borrow_port(in_downstream_port);
+ bt_port_input_as_port(in_downstream_port);
downstream_port_name = bt_port_get_name(
downstream_port);
BT_ASSERT(downstream_port_name);
*/
ret = cmd_run_ctx_connect_upstream_port_to_downstream_component(
ctx,
- bt_component_filter_borrow_component(trimmer),
+ bt_component_filter_as_component(trimmer),
trimmer_output, cfg_conn);
if (ret) {
goto error;
BT_ASSERT(ctx);
BT_ASSERT(upstream_port);
upstream_port_name = bt_port_get_name(
- bt_port_output_borrow_port(upstream_port));
+ bt_port_output_as_port(upstream_port));
BT_ASSERT(upstream_port_name);
upstream_comp = bt_port_borrow_component(
- bt_port_output_borrow_port(upstream_port));
+ bt_port_output_as_port(upstream_port));
if (!upstream_comp) {
BT_LOGW("Upstream port to connect is not part of a component: "
"port-addr=%p, port-name=\"%s\"",
struct bt_port_output *out_port)
{
struct bt_component *comp;
- struct bt_port *port = bt_port_output_borrow_port(out_port);
+ struct bt_port *port = bt_port_output_as_port(out_port);
comp = bt_port_borrow_component(port);
BT_LOGI("Port added to a graph's component: comp-addr=%p, "
struct trace_range *trace_range = NULL;
const char *fail_reason = NULL;
struct bt_component_class *comp_cls =
- bt_component_class_source_borrow_component_class(src_comp_cls);
+ bt_component_class_source_as_component_class(src_comp_cls);
component_path_value = bt_value_map_borrow_entry_value(
- bt_private_value_borrow_value(cfg_comp->params),
+ bt_private_value_as_value(cfg_comp->params),
"path");
if (component_path_value && !bt_value_is_string(component_path_value)) {
BT_LOGD("Cannot get path parameter: component-name=%s",
}
ret = query(comp_cls, "trace-info",
- bt_private_value_borrow_value(query_params), &query_result,
+ bt_private_value_as_value(query_params), &query_result,
&fail_reason);
if (ret) {
BT_LOGD("Component class does not support the `trace-info` query: %s: "
case BT_COMPONENT_CLASS_TYPE_SOURCE:
ret = bt_private_graph_add_source_component(ctx->graph,
comp_cls, cfg_comp->instance_name->str,
- bt_private_value_borrow_value(cfg_comp->params),
+ bt_private_value_as_value(cfg_comp->params),
(void *) &comp);
break;
case BT_COMPONENT_CLASS_TYPE_FILTER:
ret = bt_private_graph_add_filter_component(ctx->graph,
comp_cls, cfg_comp->instance_name->str,
- bt_private_value_borrow_value(cfg_comp->params),
+ bt_private_value_as_value(cfg_comp->params),
(void *) &comp);
break;
case BT_COMPONENT_CLASS_TYPE_SINK:
ret = bt_private_graph_add_sink_component(ctx->graph,
comp_cls, cfg_comp->instance_name->str,
- bt_private_value_borrow_value(cfg_comp->params),
+ bt_private_value_as_value(cfg_comp->params),
(void *) &comp);
break;
default:
goto error;
case BT_GRAPH_STATUS_AGAIN:
if (bt_graph_is_canceled(
- bt_private_graph_borrow_graph(ctx.graph))) {
+ bt_private_graph_as_graph(ctx.graph))) {
BT_LOGI_STR("Graph was canceled by user.");
goto error;
}
if (usleep(cfg->cmd_data.run.retry_duration_us)) {
if (bt_graph_is_canceled(
- bt_private_graph_borrow_graph(ctx.graph))) {
+ bt_private_graph_as_graph(ctx.graph))) {
BT_LOGI_STR("Graph was canceled by user.");
goto error;
}
if (cfg->command_needs_plugins) {
ret = load_all_plugins(
- bt_private_value_borrow_value(cfg->plugin_paths));
+ bt_private_value_as_value(cfg->plugin_paths));
if (ret) {
BT_LOGE("Failed to load plugins: ret=%d", ret);
retcode = 1;
static inline
struct bt_component_class *
-bt_component_class_filter_borrow_component_class(
+bt_component_class_filter_as_component_class(
struct bt_component_class_filter *comp_cls_filter)
{
return (void *) comp_cls_filter;
static inline
struct bt_component_class *
-bt_component_class_sink_borrow_component_class(
+bt_component_class_sink_as_component_class(
struct bt_component_class_sink *comp_cls_sink)
{
return (void *) comp_cls_sink;
static inline
struct bt_component_class *
-bt_component_class_source_borrow_component_class(
+bt_component_class_source_as_component_class(
struct bt_component_class_source *comp_cls_source)
{
return (void *) comp_cls_source;
struct bt_port_output;
static inline
-struct bt_component *bt_component_filter_borrow_component(
+struct bt_component *bt_component_filter_as_component(
struct bt_component_filter *component)
{
return (void *) component;
struct bt_port_input;
static inline
-struct bt_component *bt_component_sink_borrow_component(
+struct bt_component *bt_component_sink_as_component(
struct bt_component_sink *component)
{
return (void *) component;
struct bt_port_output;
static inline
-struct bt_component *bt_component_source_borrow_component(
+struct bt_component *bt_component_source_as_component(
struct bt_component_source *component)
{
return (void *) component;
struct bt_port_input;
static inline
-struct bt_port *bt_port_input_borrow_port(struct bt_port_input *port_input)
+struct bt_port *bt_port_input_as_port(struct bt_port_input *port_input)
{
return (void *) port_input;
}
static inline
struct bt_notification_iterator *
-bt_port_output_notification_iterator_borrow_notification_iterator(
+bt_port_output_notification_iterator_as_notification_iterator(
struct bt_port_output_notification_iterator *iterator)
{
return (void *) iterator;
struct bt_port_output;
static inline
-struct bt_port *bt_port_output_borrow_port(struct bt_port_output *port_output)
+struct bt_port *bt_port_output_as_port(struct bt_port_output *port_output)
{
return (void *) port_output;
}
static inline
struct bt_private_component_class *
-bt_private_component_class_filter_borrow_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_borrow_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;
static inline
struct bt_private_component_class *
-bt_private_component_class_sink_borrow_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_borrow_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;
static inline
struct bt_private_component_class *
-bt_private_component_class_source_borrow_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_borrow_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;
static inline
struct bt_component_class *
-bt_private_component_class_borrow_component_class(
+bt_private_component_class_as_component_class(
struct bt_private_component_class *priv_comp_cls)
{
return (void *) priv_comp_cls;
typedef void (* bt_private_graph_listener_removed)(void *data);
static inline
-struct bt_graph *bt_private_graph_borrow_graph(struct bt_private_graph *graph)
+struct bt_graph *bt_private_graph_as_graph(struct bt_private_graph *graph)
{
return (void *) graph;
}
struct bt_private_notification;
static inline
-struct bt_notification *bt_private_notification_borrow_notification(
+struct bt_notification *bt_private_notification_as_notification(
struct bt_private_notification *notification)
{
return (void *) notification;
struct bt_value;
static inline
-struct bt_query_executor *bt_private_query_executor_borrow_query_executor(
+struct bt_query_executor *bt_private_query_executor_as_query_executor(
struct bt_private_query_executor *priv_query_executor)
{
return (void *) priv_query_executor;
static inline
struct bt_component_class_filter *
-bt_self_component_class_filter_borrow_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;
static inline
struct bt_component_class_sink *
-bt_self_component_class_sink_borrow_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;
static inline
struct bt_component_class_source *
-bt_self_component_class_source_borrow_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;
struct bt_self_component_port_output;
static inline
-struct bt_self_component *bt_self_component_filter_borrow_self_component(
+struct bt_self_component *bt_self_component_filter_as_self_component(
struct bt_self_component_filter *self_comp_filter)
{
return (void *) self_comp_filter;
static inline
struct bt_component_filter *
-bt_self_component_filter_borrow_component_filter(
+bt_self_component_filter_as_component_filter(
struct bt_self_component_filter *self_comp_filter)
{
return (void *) self_comp_filter;
static inline
struct bt_notification_iterator *
-bt_self_component_port_input_notification_iterator_borrow_notification_iterator(
+bt_self_component_port_input_notification_iterator_as_notification_iterator(
struct bt_self_component_port_input_notification_iterator *iterator)
{
return (void *) iterator;
static inline
struct bt_self_component_port *
-bt_self_component_port_input_borrow_self_component_port(
+bt_self_component_port_input_as_self_component_port(
struct bt_self_component_port_input *self_component_port)
{
return (void *) self_component_port;
}
static inline
-struct bt_port_input *bt_self_component_port_input_borrow_port_input(
+struct bt_port_input *bt_self_component_port_input_as_port_input(
struct bt_self_component_port_input *self_component_port)
{
return (void *) self_component_port;
static inline
struct bt_self_component_port *
-bt_self_component_port_output_borrow_self_component_port(
+bt_self_component_port_output_as_self_component_port(
struct bt_self_component_port_output *self_component_port)
{
return (void *) self_component_port;
}
static inline
-struct bt_port_output *bt_self_component_port_output_borrow_port_output(
+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;
};
static inline
-struct bt_port *bt_self_component_port_borrow_port(
+struct bt_port *bt_self_component_port_as_port(
struct bt_self_component_port *self_port)
{
return (void *) self_port;
struct bt_self_component_port_input;
static inline
-struct bt_self_component *bt_self_component_sink_borrow_self_component(
+struct bt_self_component *bt_self_component_sink_as_self_component(
struct bt_self_component_sink *self_comp_sink)
{
return (void *) self_comp_sink;
static inline
struct bt_component_sink *
-bt_self_component_sink_borrow_component_sink(
+bt_self_component_sink_as_component_sink(
struct bt_self_component_sink *self_comp_sink)
{
return (void *) self_comp_sink;
struct bt_self_component_port_output;
static inline
-struct bt_self_component *bt_self_component_source_borrow_self_component(
+struct bt_self_component *bt_self_component_source_as_self_component(
struct bt_self_component_source *self_comp_source)
{
return (void *) self_comp_source;
static inline
struct bt_component_source *
-bt_self_component_source_borrow_component_source(
+bt_self_component_source_as_component_source(
struct bt_self_component_source *self_comp_source)
{
return (void *) self_comp_source;
};
static inline
-struct bt_component *bt_self_component_borrow_component(
+struct bt_component *bt_self_component_as_component(
struct bt_self_component *self_component)
{
return (void *) self_component;
extern struct bt_private_value *bt_private_value_null;
static inline
-struct bt_value *bt_private_value_borrow_value(
+struct bt_value *bt_private_value_as_value(
struct bt_private_value *priv_value)
{
return (void *) priv_value;
struct bt_private_clock_class;
static inline
-struct bt_clock_class *bt_private_clock_class_borrow_clock_class(
+struct bt_clock_class *bt_private_clock_class_as_clock_class(
struct bt_private_clock_class *priv_clock_class)
{
return (void *) priv_clock_class;
struct bt_private_stream_class;
static inline
-struct bt_event_class *bt_private_event_class_borrow_event_class(
+struct bt_event_class *bt_private_event_class_as_event_class(
struct bt_private_event_class *priv_event_class)
{
return (void *) priv_event_class;
struct bt_private_packet;
static inline
-struct bt_event *bt_private_event_borrow_event(
+struct bt_event *bt_private_event_as_event(
struct bt_private_event *priv_event)
{
return (void *) priv_event;
struct bt_private_field_class_unsigned_enumeration_mapping_ranges;
static inline
-struct bt_field_class *bt_private_field_class_borrow_field_class(
+struct bt_field_class *bt_private_field_class_as_field_class(
struct bt_private_field_class *priv_field_class)
{
return (void *) priv_field_class;
struct bt_private_field_class;
static inline
-struct bt_field *bt_private_field_borrow_field(
+struct bt_field *bt_private_field_as_field(
struct bt_private_field *priv_field)
{
return (void *) priv_field;
struct bt_private_stream;
static inline
-struct bt_packet *bt_private_packet_borrow_packet(
+struct bt_packet *bt_private_packet_as_packet(
struct bt_private_packet *priv_packet)
{
return (void *) priv_packet;
struct bt_private_clock_class;
static inline
-struct bt_stream_class *bt_private_stream_class_borrow_stream_class(
+struct bt_stream_class *bt_private_stream_class_as_stream_class(
struct bt_private_stream_class *priv_stream_class)
{
return (void *) priv_stream_class;
struct bt_private_stream_class;
static inline
-struct bt_stream *bt_private_stream_borrow_stream(
+struct bt_stream *bt_private_stream_as_stream(
struct bt_private_stream *priv_stream)
{
return (void *) priv_stream;
struct bt_private_trace *trace, void *data);
static inline
-struct bt_trace *bt_private_trace_borrow_trace(
+struct bt_trace *bt_private_trace_as_trace(
struct bt_private_trace *priv_trace)
{
return (void *) priv_trace;
BT_HIDDEN
int64_t bt_ctf_attributes_get_count(struct bt_private_value *attr_obj)
{
- return bt_value_array_get_size(bt_private_value_borrow_value(attr_obj));
+ return bt_value_array_get_size(bt_private_value_as_value(attr_obj));
}
BT_HIDDEN
goto end;
}
- if (index >= bt_value_array_get_size(bt_private_value_borrow_value(attr_obj))) {
+ if (index >= bt_value_array_get_size(bt_private_value_as_value(attr_obj))) {
BT_LOGW("Invalid parameter: index is out of bounds: "
"index=%" PRIu64 ", count=%" PRId64,
- index, bt_value_array_get_size(bt_private_value_borrow_value(attr_obj)));
+ index, bt_value_array_get_size(bt_private_value_as_value(attr_obj)));
goto end;
}
}
ret = bt_value_string_get(
- bt_private_value_borrow_value(attr_field_name_obj));
+ bt_private_value_as_value(attr_field_name_obj));
end:
return ret;
goto end;
}
- if (index >= bt_value_array_get_size(bt_private_value_borrow_value(attr_obj))) {
+ if (index >= bt_value_array_get_size(bt_private_value_as_value(attr_obj))) {
BT_LOGW("Invalid parameter: index is out of bounds: "
"index=%" PRIu64 ", count=%" PRId64,
- index, bt_value_array_get_size(bt_private_value_borrow_value(attr_obj)));
+ index, bt_value_array_get_size(bt_private_value_as_value(attr_obj)));
goto end;
}
struct bt_private_value *value_obj = NULL;
struct bt_private_value *attr_field_name_obj = NULL;
- attr_size = bt_value_array_get_size(bt_private_value_borrow_value(attr_obj));
+ attr_size = bt_value_array_get_size(bt_private_value_as_value(attr_obj));
if (attr_size < 0) {
BT_LOGE("Cannot get array value's size: value-addr=%p",
attr_obj);
}
field_name = bt_value_string_get(
- bt_private_value_borrow_value(attr_field_name_obj));
+ bt_private_value_as_value(attr_field_name_obj));
if (!strcmp(field_name, name)) {
break;
if (attr_field_obj) {
ret = bt_private_value_array_set_element_by_index(
attr_field_obj, BT_CTF_ATTR_VALUE_INDEX,
- bt_private_value_borrow_value(value_obj));
+ bt_private_value_as_value(value_obj));
attr_field_obj = NULL;
goto end;
}
ret = bt_private_value_array_append_string_element(attr_field_obj, name);
ret |= bt_private_value_array_append_element(attr_field_obj,
- bt_private_value_borrow_value(value_obj));
+ bt_private_value_as_value(value_obj));
if (ret) {
BT_LOGE("Cannot append elements to array value: addr=%p",
attr_field_obj);
}
ret = bt_private_value_array_append_element(attr_obj,
- bt_private_value_borrow_value(attr_field_obj));
+ bt_private_value_as_value(attr_field_obj));
if (ret) {
BT_LOGE("Cannot append element to array value: "
"array-value-addr=%p, element-value-addr=%p",
}
BT_LOGD("Freezing attributes object: value-addr=%p", attr_obj);
- count = bt_value_array_get_size(bt_private_value_borrow_value(attr_obj));
+ count = bt_value_array_get_size(bt_private_value_as_value(attr_obj));
BT_ASSERT(count >= 0);
/*
goto end;
}
- bt_value_freeze(bt_private_value_borrow_value(obj));
+ bt_value_freeze(bt_private_value_as_value(obj));
}
end:
goto end;
}
- if (!bt_value_is_integer(bt_private_value_borrow_value(value)) &&
- !bt_value_is_string(bt_private_value_borrow_value(value))) {
+ if (!bt_value_is_integer(bt_private_value_as_value(value)) &&
+ !bt_value_is_string(bt_private_value_as_value(value))) {
BT_LOGW("Invalid parameter: environment field's value is not an integer or string value: "
"trace-addr=%p, trace-name=\"%s\", "
"env-name=\"%s\", env-value-type=%s",
trace, bt_ctf_trace_common_get_name(trace), name,
bt_common_value_type_string(
bt_value_get_type(
- bt_private_value_borrow_value(value))));
+ bt_private_value_as_value(value))));
ret = -1;
goto end;
}
goto end;
}
- bt_value_freeze(bt_private_value_borrow_value(value));
+ bt_value_freeze(bt_private_value_as_value(value));
}
ret = bt_ctf_attributes_set_field_value(trace->environment, name,
BT_ASSERT(env_field_value_obj);
switch (bt_value_get_type(
- bt_private_value_borrow_value(env_field_value_obj))) {
+ bt_private_value_as_value(env_field_value_obj))) {
case BT_VALUE_TYPE_INTEGER:
{
int64_t int_value;
int_value = bt_value_integer_get(
- bt_private_value_borrow_value(
+ bt_private_value_as_value(
env_field_value_obj));
g_string_append_printf(context->string,
"\t%s = %" PRId64 ";\n", entry_name,
char *escaped_str = NULL;
str_value = bt_value_string_get(
- bt_private_value_borrow_value(
+ bt_private_value_as_value(
env_field_value_obj));
escaped_str = g_strescape(str_value, NULL);
if (!escaped_str) {
}
bt_self_component_set_data(
- bt_self_component_sink_borrow_self_component(self_comp),
+ bt_self_component_sink_as_self_component(self_comp),
colander_data);
end:
{
struct colander_data *colander_data =
bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(self_comp));
+ bt_self_component_sink_as_self_component(self_comp));
if (!colander_data) {
return;
enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
struct colander_data *colander_data =
bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(self_comp));
+ bt_self_component_sink_as_self_component(self_comp));
BT_ASSERT(colander_data);
BT_OBJECT_PUT_REF_AND_RESET(colander_data->notif_iter);
enum bt_notification_iterator_status notif_iter_status;
struct colander_data *colander_data =
bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(self_comp));
+ bt_self_component_sink_as_self_component(self_comp));
bt_notification_array notifs;
BT_ASSERT(colander_data);
end:
return bt_object_get_ref(
- bt_private_component_class_sink_borrow_component_class_sink(
+ bt_private_component_class_sink_as_component_class_sink(
colander_comp_cls));
}
graph, comp_cls, name, params, init_method_data);
if (!params) {
- params = bt_private_value_borrow_value(
+ params = bt_private_value_as_value(
bt_private_value_map_create());
if (!params) {
BT_LOGE_STR("Cannot create map value object.");
src_comp_class = bt_private_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_borrow_private_component_class(
+ comp_class = bt_private_component_class_source_as_private_component_class(
src_comp_class);
break;
case BT_COMPONENT_CLASS_TYPE_FILTER:
flt_comp_class = bt_private_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_borrow_private_component_class(
+ comp_class = bt_private_component_class_filter_as_private_component_class(
flt_comp_class);
break;
case BT_COMPONENT_CLASS_TYPE_SINK:
sink_comp_class = bt_private_component_class_sink_create(
cc_full_descr->descriptor->name,
cc_full_descr->descriptor->methods.sink.consume);
- comp_class = bt_private_component_class_sink_borrow_private_component_class(
+ comp_class = bt_private_component_class_sink_as_private_component_class(
sink_comp_class);
break;
default:
BT_HIDDEN
int64_t bt_attributes_get_count(struct bt_private_value *attr_obj)
{
- return bt_value_array_get_size(bt_private_value_borrow_value(attr_obj));
+ return bt_value_array_get_size(bt_private_value_as_value(attr_obj));
}
BT_HIDDEN
}
if (index >= bt_value_array_get_size(
- bt_private_value_borrow_value(attr_obj))) {
+ bt_private_value_as_value(attr_obj))) {
BT_LOGW("Invalid parameter: index is out of bounds: "
"index=%" PRIu64 ", count=%" PRId64,
index, bt_value_array_get_size(
- bt_private_value_borrow_value(attr_obj)));
+ bt_private_value_as_value(attr_obj)));
goto end;
}
}
ret = bt_value_string_get(
- bt_private_value_borrow_value(attr_field_name_obj));
+ bt_private_value_as_value(attr_field_name_obj));
end:
return ret;
goto end;
}
- if (index >= bt_value_array_get_size(bt_private_value_borrow_value(attr_obj))) {
+ if (index >= bt_value_array_get_size(bt_private_value_as_value(attr_obj))) {
BT_LOGW("Invalid parameter: index is out of bounds: "
"index=%" PRIu64 ", count=%" PRId64,
index, bt_value_array_get_size(
- bt_private_value_borrow_value(attr_obj)));
+ bt_private_value_as_value(attr_obj)));
goto end;
}
struct bt_private_value *attr_field_name_obj = NULL;
attr_size = bt_value_array_get_size(
- bt_private_value_borrow_value(attr_obj));
+ bt_private_value_as_value(attr_obj));
if (attr_size < 0) {
BT_LOGE("Cannot get array value's size: value-addr=%p",
attr_obj);
}
field_name = bt_value_string_get(
- bt_private_value_borrow_value(attr_field_name_obj));
+ bt_private_value_as_value(attr_field_name_obj));
if (!strcmp(field_name, name)) {
break;
if (attr_field_obj) {
ret = bt_private_value_array_set_element_by_index(
attr_field_obj, BT_ATTR_VALUE_INDEX,
- bt_private_value_borrow_value(value_obj));
+ bt_private_value_as_value(value_obj));
attr_field_obj = NULL;
goto end;
}
ret = bt_private_value_array_append_string_element(attr_field_obj,
name);
ret |= bt_private_value_array_append_element(attr_field_obj,
- bt_private_value_borrow_value(value_obj));
+ bt_private_value_as_value(value_obj));
if (ret) {
BT_LOGE("Cannot append elements to array value: addr=%p",
attr_field_obj);
}
ret = bt_private_value_array_append_element(attr_obj,
- bt_private_value_borrow_value(attr_field_obj));
+ bt_private_value_as_value(attr_field_obj));
if (ret) {
BT_LOGE("Cannot append element to array value: "
"array-value-addr=%p, element-value-addr=%p",
}
BT_LOGD("Freezing attributes object: value-addr=%p", attr_obj);
- count = bt_value_array_get_size(bt_private_value_borrow_value(attr_obj));
+ count = bt_value_array_get_size(bt_private_value_as_value(attr_obj));
BT_ASSERT(count >= 0);
/*
goto end;
}
- bt_value_freeze(bt_private_value_borrow_value(obj));
+ bt_value_freeze(bt_private_value_as_value(obj));
}
end:
"%![trace-]+t, entry-name=\"%s\"", trace, name);
ret = bt_attributes_set_field_value(trace->environment, name,
value);
- bt_value_freeze(bt_private_value_borrow_value(value));
+ bt_value_freeze(bt_private_value_as_value(value));
if (ret) {
BT_LIB_LOGE("Cannot set trace's environment entry: "
"%![trace-]+t, entry-name=\"%s\"", trace, name);
BT_ASSERT_PRE_NON_NULL(value, "Value");
BT_ASSERT_PRE_VALID_INDEX(index,
bt_attributes_get_count(trace->environment));
- *value = bt_private_value_borrow_value(
+ *value = bt_private_value_as_value(
bt_attributes_borrow_field_value(trace->environment, index));
BT_ASSERT(*value);
*name = bt_attributes_get_field_name(trace->environment, index);
{
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
- return bt_private_value_borrow_value(
+ return bt_private_value_as_value(
bt_attributes_borrow_field_value_by_name(trace->environment,
name));
}
if (sc->default_clock_class) {
ret = bt_private_stream_class_set_default_clock_class(ir_sc,
- bt_private_clock_class_borrow_clock_class(sc->default_clock_class));
+ bt_private_clock_class_as_clock_class(sc->default_clock_class));
BT_ASSERT(ret == 0);
}
"clock class: expected-cc-name=\"%s\", "
"other-cc-name=\"%s\"",
bt_clock_class_get_name(
- bt_private_clock_class_borrow_clock_class(
+ bt_private_clock_class_as_clock_class(
*clock_class)),
bt_clock_class_get_name(
- bt_private_clock_class_borrow_clock_class(
+ bt_private_clock_class_as_clock_class(
int_fc->mapped_clock_class)));
ret = -1;
goto end;
for (i = 0; i < tc->clock_classes->len; i++) {
struct bt_private_clock_class *cc = tc->clock_classes->pdata[i];
const char *cc_name = bt_clock_class_get_name(
- bt_private_clock_class_borrow_clock_class(cc));
+ bt_private_clock_class_as_clock_class(cc));
BT_ASSERT(cc_name);
if (strcmp(cc_name, name) == 0) {
}
freq = bt_clock_class_get_frequency(
- bt_private_clock_class_borrow_clock_class(clock));
- bt_clock_class_get_offset(bt_private_clock_class_borrow_clock_class(clock),
+ bt_private_clock_class_as_clock_class(clock));
+ bt_clock_class_get_offset(bt_private_clock_class_as_clock_class(clock),
&cur_offset_s, &cur_offset_cycles);
/* Apply offsets */
}
clock_class_name = bt_clock_class_get_name(
- bt_private_clock_class_borrow_clock_class(clock));
+ bt_private_clock_class_as_clock_class(clock));
BT_ASSERT(clock_class_name);
if (ctx->is_lttng && strcmp(clock_class_name, "monotonic") == 0) {
/*
* frequency (move to the part in seconds).
*/
freq = bt_clock_class_get_frequency(
- bt_private_clock_class_borrow_clock_class(clock));
+ bt_private_clock_class_as_clock_class(clock));
calibrate_clock_class_offsets(&offset_seconds, &offset_cycles, freq);
BT_ASSERT(offset_cycles < bt_clock_class_get_frequency(
- bt_private_clock_class_borrow_clock_class(clock)));
+ bt_private_clock_class_as_clock_class(clock)));
bt_private_clock_class_set_offset(clock, offset_seconds, offset_cycles);
apply_clock_class_offset(ctx, clock);
g_ptr_array_add(ctx->ctf_tc->clock_classes, bt_object_get_ref(clock));
BT_ASSERT(base_fc);
switch (bt_field_class_get_type(
- bt_private_field_class_borrow_field_class(base_fc))) {
+ bt_private_field_class_as_field_class(base_fc))) {
case BT_FIELD_CLASS_TYPE_STRUCTURE:
{
BT_ASSERT(index <
bt_field_class_structure_get_member_count(
- bt_private_field_class_borrow_field_class(
+ bt_private_field_class_as_field_class(
bt_private_field_borrow_class(
base_field))));
next_field =
case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
BT_ASSERT(index < bt_field_array_get_length(
- bt_private_field_borrow_field(base_field)));
+ bt_private_field_as_field(base_field)));
next_field = bt_private_field_array_borrow_element_field_by_index(
base_field, index);
break;
BT_ASSERT(field);
BT_ASSERT(bt_private_field_borrow_class(field) == fc->ir_fc);
BT_ASSERT(bt_field_get_class_type(
- bt_private_field_borrow_field(field)) ==
+ bt_private_field_as_field(field)) ==
BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
- bt_field_get_class_type(bt_private_field_borrow_field(field)) ==
+ bt_field_get_class_type(bt_private_field_as_field(field)) ==
BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
bt_private_field_unsigned_integer_set_value(field, value);
stack_top(notit->stack)->index++;
string_field = stack_top(notit->stack)->base;
BT_ASSERT(bt_field_get_class_type(
- bt_private_field_borrow_field(string_field)) ==
+ bt_private_field_as_field(string_field)) ==
BT_FIELD_CLASS_TYPE_STRING);
/* Append character */
BT_ASSERT(field);
BT_ASSERT(bt_private_field_borrow_class(field) == fc->ir_fc);
BT_ASSERT(bt_field_get_class_type(
- bt_private_field_borrow_field(field)) ==
+ bt_private_field_as_field(field)) ==
BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
- bt_field_get_class_type(bt_private_field_borrow_field(field)) ==
+ bt_field_get_class_type(bt_private_field_as_field(field)) ==
BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
bt_private_field_signed_integer_set_value(field, value);
stack_top(notit->stack)->index++;
BT_ASSERT(field);
BT_ASSERT(bt_private_field_borrow_class(field) == fc->ir_fc);
BT_ASSERT(bt_field_get_class_type(
- bt_private_field_borrow_field(field)) ==
+ bt_private_field_as_field(field)) ==
BT_FIELD_CLASS_TYPE_REAL);
bt_private_field_real_set_value(field, value);
stack_top(notit->stack)->index++;
BT_ASSERT(field);
BT_ASSERT(bt_private_field_borrow_class(field) == fc->ir_fc);
BT_ASSERT(bt_field_get_class_type(
- bt_private_field_borrow_field(field)) ==
+ bt_private_field_as_field(field)) ==
BT_FIELD_CLASS_TYPE_STRING);
ret = bt_private_field_string_clear(field);
BT_ASSERT(ret == 0);
int ret;
BT_ASSERT(bt_field_get_class_type(
- bt_private_field_borrow_field(field)) ==
+ bt_private_field_as_field(field)) ==
BT_FIELD_CLASS_TYPE_STRING);
notit->done_filling_string = false;
ret = bt_private_field_string_clear(field);
if (array_fc->is_text) {
BT_ASSERT(bt_field_get_class_type(
- bt_private_field_borrow_field(
+ bt_private_field_as_field(
stack_top(notit->stack)->base)) ==
BT_FIELD_CLASS_TYPE_STRING);
bt_bfcr_set_unsigned_int_cb(notit->bfcr,
struct bt_private_event *event =
bt_private_notification_event_borrow_event(
notit->event_notif);
- struct bt_stream_class *sc = bt_private_stream_class_borrow_stream_class(
+ struct bt_stream_class *sc = bt_private_stream_class_as_stream_class(
notit->meta.sc->ir_sc);
BT_ASSERT(event);
}
BT_ASSERT(notit->packet);
- sc = bt_private_stream_class_borrow_stream_class(notit->meta.sc->ir_sc);
+ sc = bt_private_stream_class_as_stream_class(notit->meta.sc->ir_sc);
BT_ASSERT(sc);
if (bt_stream_class_packets_have_discarded_event_counter_snapshot(sc)) {
uint64_t cycles, int64_t *ns)
{
return bt_clock_class_cycles_to_ns_from_origin(
- bt_private_clock_class_borrow_clock_class(clock_class), cycles, ns);
+ bt_private_clock_class_as_clock_class(clock_class), cycles, ns);
}
static
BT_ASSERT(notif_iter_data->ds_file);
status = ctf_fs_ds_file_next(notif_iter_data->ds_file, &priv_notif);
- *notif = bt_private_notification_borrow_notification(priv_notif);
+ *notif = bt_private_notification_as_notification(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_borrow_notification(priv_notif);
+ *notif = bt_private_notification_as_notification(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_borrow_notification(priv_notif);
+ *notif = bt_private_notification_as_notification(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_borrow_notification(priv_notif);
+ *notif = bt_private_notification_as_notification(priv_notif);
BT_ASSERT(status != BT_SELF_NOTIFICATION_ITERATOR_STATUS_END);
}
}
int iret;
port_data = bt_self_component_port_get_data(
- bt_self_component_port_output_borrow_self_component_port(
+ bt_self_component_port_output_as_self_component_port(
self_port));
BT_ASSERT(port_data);
notif_iter_data = g_new0(struct ctf_fs_notif_iter_data, 1);
void ctf_fs_finalize(struct bt_self_component_source *component)
{
ctf_fs_destroy(bt_self_component_get_data(
- bt_self_component_source_borrow_self_component(component)));
+ bt_self_component_source_as_self_component(component)));
}
static
if (props.snapshots.beginning_clock != UINT64_C(-1)) {
BT_ASSERT(sc->default_clock_class);
ret = bt_clock_class_cycles_to_ns_from_origin(
- bt_private_clock_class_borrow_clock_class(
+ bt_private_clock_class_as_clock_class(
sc->default_clock_class),
props.snapshots.beginning_clock, &begin_ns);
if (ret) {
}
bt_self_component_set_data(
- bt_self_component_source_borrow_self_component(self_comp),
+ bt_self_component_source_as_self_component(self_comp),
ctf_fs);
/*
ctf_fs_destroy(ctf_fs);
ctf_fs = NULL;
bt_self_component_set_data(
- bt_self_component_source_borrow_self_component(self_comp),
+ bt_self_component_source_as_self_component(self_comp),
NULL);
end:
fclose(metadata_fp);
}
- *user_result = bt_private_value_borrow_value(result);
+ *user_result = bt_private_value_as_value(result);
return status;
}
}
status = bt_private_value_map_insert_entry(info, range_name,
- bt_private_value_borrow_value(range_map));
+ bt_private_value_as_value(range_map));
if (status != BT_VALUE_STATUS_OK) {
ret = -1;
goto end;
}
status = bt_private_value_map_insert_entry(group_info, "paths",
- bt_private_value_borrow_value(file_paths));
+ bt_private_value_as_value(file_paths));
if (status != BT_VALUE_STATUS_OK) {
ret = -1;
goto end;
}
ret = add_stream_ids(group_info,
- bt_private_stream_borrow_stream(group->stream));
+ bt_private_stream_as_stream(group->stream));
if (ret) {
goto end;
}
trace_intersection.set = true;
status = bt_private_value_array_append_element(
file_groups,
- bt_private_value_borrow_value(group_info));
+ bt_private_value_as_value(group_info));
bt_object_put_ref(group_info);
if (status != BT_VALUE_STATUS_OK) {
goto end;
}
status = bt_private_value_map_insert_entry(trace_info, "streams",
- bt_private_value_borrow_value(file_groups));
+ bt_private_value_as_value(file_groups));
BT_OBJECT_PUT_REF_AND_RESET(file_groups);
if (status != BT_VALUE_STATUS_OK) {
ret = -1;
}
status = bt_private_value_array_append_element(result,
- bt_private_value_borrow_value(trace_info));
+ bt_private_value_as_value(trace_info));
bt_object_put_ref(trace_info);
if (status != BT_VALUE_STATUS_OK) {
goto error;
g_list_free(trace_names);
}
- *user_result = bt_private_value_borrow_value(result);
+ *user_result = bt_private_value_as_value(result);
return status;
}
ret = bt_private_stream_class_set_default_clock_class(
dmesg_comp->stream_class,
- bt_private_clock_class_borrow_clock_class(
+ bt_private_clock_class_as_clock_class(
dmesg_comp->clock_class));
if (ret) {
BT_LOGE_STR("Cannot set stream class's default clock class.");
}
bt_self_component_set_data(
- bt_self_component_source_borrow_self_component(self_comp),
+ bt_self_component_source_as_self_component(self_comp),
dmesg_comp);
goto end;
error:
destroy_dmesg_component(dmesg_comp);
bt_self_component_set_data(
- bt_self_component_source_borrow_self_component(self_comp),
+ bt_self_component_source_as_self_component(self_comp),
NULL);
if (status >= 0) {
void dmesg_finalize(struct bt_self_component_source *self_comp)
{
destroy_dmesg_component(bt_self_component_get_data(
- bt_self_component_source_borrow_self_component(self_comp)));
+ bt_self_component_source_as_self_component(self_comp)));
}
static
}
dmesg_comp = bt_self_component_get_data(
- bt_self_component_source_borrow_self_component(self_comp));
+ bt_self_component_source_as_self_component(self_comp));
BT_ASSERT(dmesg_comp);
dmesg_notif_iter->dmesg_comp = dmesg_comp;
dmesg_notif_iter->pc_notif_iter = self_notif_iter;
status = dmesg_notif_iter_next_one(dmesg_notif_iter,
&priv_notif);
- notifs[i] = bt_private_notification_borrow_notification(
+ notifs[i] = bt_private_notification_as_notification(
priv_notif);
if (status == BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK) {
i++;
{
destroy_pretty_data(
bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(comp)));
+ bt_self_component_sink_as_self_component(comp)));
}
static
struct pretty_component *pretty;
pretty = bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(comp));
+ bt_self_component_sink_as_self_component(comp));
BT_ASSERT(pretty);
BT_ASSERT(!pretty->iterator);
pretty->iterator = bt_self_component_port_input_notification_iterator_create(
bt_notification_array notifs;
struct bt_self_component_port_input_notification_iterator *it;
struct pretty_component *pretty = bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(comp));
+ bt_self_component_sink_as_self_component(comp));
enum bt_notification_iterator_status it_ret;
uint64_t count = 0;
uint64_t i = 0;
struct pretty_component *pretty = data;
if (!bt_value_map_has_entry(
- bt_private_value_borrow_value(pretty->plugin_opt_map),
+ bt_private_value_as_value(pretty->plugin_opt_map),
key)) {
fprintf(pretty->err,
"[warning] Parameter \"%s\" unknown to \"text.pretty\" sink component\n", key);
set_use_colors(pretty);
bt_self_component_set_data(
- bt_self_component_sink_borrow_self_component(comp), pretty);
+ bt_self_component_sink_as_self_component(comp), pretty);
init_stream_packet_context_quarks();
end:
BT_ASSERT(comp);
counter = bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(comp));
+ bt_self_component_sink_as_self_component(comp));
BT_ASSERT(counter);
try_print_last(counter);
bt_object_put_ref(counter->notif_iter);
}
bt_self_component_set_data(
- bt_self_component_sink_borrow_self_component(component),
+ bt_self_component_sink_as_self_component(component),
counter);
goto end;
struct bt_self_component_port_input_notification_iterator *iterator;
counter = bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(comp));
+ bt_self_component_sink_as_self_component(comp));
BT_ASSERT(counter);
iterator = bt_self_component_port_input_notification_iterator_create(
self_port);
bt_notification_array notifs;
counter = bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(comp));
+ bt_self_component_sink_as_self_component(comp));
BT_ASSERT(counter);
if (unlikely(!counter->notif_iter)) {
BT_ASSERT(comp);
dummy = bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(comp));
+ bt_self_component_sink_as_self_component(comp));
BT_ASSERT(dummy);
destroy_private_dummy_data(dummy);
}
}
bt_self_component_set_data(
- bt_self_component_sink_borrow_self_component(component), dummy);
+ bt_self_component_sink_as_self_component(component), dummy);
goto end;
error:
struct bt_self_component_port_input_notification_iterator *iterator;
dummy = bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(comp));
+ bt_self_component_sink_as_self_component(comp));
BT_ASSERT(dummy);
iterator = bt_self_component_port_input_notification_iterator_create(
self_port);
uint64_t i;
dummy = bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(component));
+ bt_self_component_sink_as_self_component(component));
BT_ASSERT(dummy);
if (unlikely(!dummy->notif_iter)) {
struct bt_self_component_filter *self_comp)
{
struct muxer_comp *muxer_comp = bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(self_comp));
+ bt_self_component_filter_as_self_component(self_comp));
enum bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK;
GString *port_name = NULL;
}
ret = bt_value_map_extend(&real_params,
- bt_private_value_borrow_value(default_params), params);
+ bt_private_value_as_value(default_params), params);
if (ret) {
BT_LOGE("Cannot extend default parameters map value: "
"muxer-comp-addr=%p, def-params-addr=%p, "
}
assume_absolute_clock_classes = bt_value_map_borrow_entry_value(
- bt_private_value_borrow_value(real_params),
+ bt_private_value_as_value(real_params),
ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME);
if (assume_absolute_clock_classes &&
!bt_value_is_bool(assume_absolute_clock_classes)) {
muxer_comp->self_comp = self_comp;
bt_self_component_set_data(
- bt_self_component_filter_borrow_self_component(self_comp),
+ bt_self_component_filter_as_self_component(self_comp),
muxer_comp);
status = ensure_available_input_port(self_comp);
if (status != BT_SELF_COMPONENT_STATUS_OK) {
error:
destroy_muxer_comp(muxer_comp);
bt_self_component_set_data(
- bt_self_component_filter_borrow_self_component(self_comp),
+ bt_self_component_filter_as_self_component(self_comp),
NULL);
if (status == BT_SELF_COMPONENT_STATUS_OK) {
void muxer_finalize(struct bt_self_component_filter *self_comp)
{
struct muxer_comp *muxer_comp = bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(self_comp));
+ bt_self_component_filter_as_self_component(self_comp));
BT_LOGD("Finalizing muxer component: comp-addr=%p",
self_comp);
create_notif_iter_on_input_port(
struct bt_self_component_port_input *self_port, int *ret)
{
- struct bt_port *port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ 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 =
NULL;
}
self_port = node->data;
- port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ port = bt_self_component_port_as_port(
+ bt_self_component_port_input_as_self_component_port(
(self_port)));
BT_ASSERT(port);
* handled by muxer_notif_iter_handle_newly_connected_ports().
*/
count = bt_component_filter_get_input_port_count(
- bt_self_component_filter_borrow_component_filter(
+ bt_self_component_filter_as_component_filter(
muxer_comp->self_comp));
if (count < 0) {
BT_LOGD("No input port to initialize for muxer component's notification iterator: "
struct bt_port *port;
BT_ASSERT(self_port);
- port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ port = bt_self_component_port_as_port(
+ bt_self_component_port_input_as_self_component_port(
self_port));
BT_ASSERT(port);
int ret;
muxer_comp = bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(self_comp));
+ bt_self_component_filter_as_self_component(self_comp));
BT_ASSERT(muxer_comp);
BT_LOGD("Initializing muxer component's notification iterator: "
"comp-addr=%p, muxer-comp-addr=%p, notif-iter-addr=%p",
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_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ 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 =
bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(
+ bt_self_component_filter_as_self_component(
self_comp));
size_t i;
int ret;
"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_borrow_port(other_port)));
+ bt_port_get_name(bt_port_output_as_port(other_port)));
for (i = 0; i < muxer_comp->muxer_notif_iters->len; i++) {
struct muxer_notif_iter *muxer_notif_iter =
{
struct muxer_comp *muxer_comp =
bt_self_component_get_data(
- bt_self_component_filter_borrow_self_component(
+ bt_self_component_filter_as_self_component(
self_component));
struct bt_port *port =
- bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ bt_self_component_port_as_port(
+ bt_self_component_port_input_as_self_component_port(
self_port));
BT_ASSERT(port);
struct bt_value **result)
{
struct bt_private_value *res = bt_private_value_array_create();
- *result = bt_private_value_borrow_value(res);
+ *result = bt_private_value_as_value(res);
int iret;
BT_ASSERT(*result);
BT_ASSERT(src_event_class);
src_stream1 = bt_private_stream_create(src_stream_class);
BT_ASSERT(src_stream1);
- pub_src_stream1 = bt_private_stream_borrow_stream(src_stream1);
+ pub_src_stream1 = bt_private_stream_as_stream(src_stream1);
src_stream2 = bt_private_stream_create(src_stream_class);
BT_ASSERT(src_stream2);
- pub_src_stream2 = bt_private_stream_borrow_stream(src_stream2);
+ pub_src_stream2 = bt_private_stream_as_stream(src_stream2);
src_stream1_packet1 = bt_private_packet_create(src_stream1);
BT_ASSERT(src_stream1_packet1);
- pub_src_stream1_packet1 = bt_private_packet_borrow_packet(
+ pub_src_stream1_packet1 = bt_private_packet_as_packet(
src_stream1_packet1);
src_stream1_packet2 = bt_private_packet_create(src_stream1);
BT_ASSERT(src_stream1_packet2);
- pub_src_stream1_packet2 = bt_private_packet_borrow_packet(
+ pub_src_stream1_packet2 = bt_private_packet_as_packet(
src_stream1_packet2);
src_stream2_packet1 = bt_private_packet_create(src_stream2);
BT_ASSERT(src_stream2_packet1);
- pub_src_stream2_packet1 = bt_private_packet_borrow_packet(
+ pub_src_stream2_packet1 = bt_private_packet_as_packet(
src_stream2_packet1);
src_stream2_packet2 = bt_private_packet_create(src_stream2);
BT_ASSERT(src_stream2_packet2);
- pub_src_stream2_packet2 = bt_private_packet_borrow_packet(
+ pub_src_stream2_packet2 = bt_private_packet_as_packet(
src_stream2_packet2);
if (debug) {
switch (user_data->seq[user_data->at]) {
case SEQ_STREAM1_BEGIN:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_stream_begin_create(
notif_iter, src_stream1));
break;
case SEQ_STREAM2_BEGIN:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_stream_begin_create(
notif_iter, src_stream2));
break;
case SEQ_STREAM1_END:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_stream_end_create(
notif_iter, src_stream1));
break;
case SEQ_STREAM2_END:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_stream_end_create(
notif_iter, src_stream2));
break;
case SEQ_STREAM1_PACKET1_BEGIN:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_packet_begin_create(
notif_iter, src_stream1_packet1));
break;
case SEQ_STREAM1_PACKET2_BEGIN:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_packet_begin_create(
notif_iter, src_stream1_packet2));
break;
case SEQ_STREAM2_PACKET1_BEGIN:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_packet_begin_create(
notif_iter, src_stream2_packet1));
break;
case SEQ_STREAM2_PACKET2_BEGIN:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_packet_begin_create(
notif_iter, src_stream2_packet2));
break;
case SEQ_STREAM1_PACKET1_END:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_packet_end_create(
notif_iter, src_stream1_packet1));
break;
case SEQ_STREAM1_PACKET2_END:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_packet_end_create(
notif_iter, src_stream1_packet2));
break;
case SEQ_STREAM2_PACKET1_END:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_packet_end_create(
notif_iter, src_stream2_packet1));
break;
case SEQ_STREAM2_PACKET2_END:
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_packet_end_create(
notif_iter, src_stream2_packet2));
break;
}
if (event_packet) {
- *notif = bt_private_notification_borrow_notification(
+ *notif = bt_private_notification_as_notification(
bt_private_notification_event_create(
notif_iter, src_event_class, event_packet));
}
enum bt_self_component_status ret = BT_SELF_COMPONENT_STATUS_OK;
struct sink_user_data *user_data =
bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(
+ bt_self_component_sink_as_self_component(
self_comp));
enum bt_notification_iterator_status it_ret;
{
struct sink_user_data *user_data =
bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(
+ bt_self_component_sink_as_self_component(
self_comp));
BT_ASSERT(user_data);
BT_ASSERT(user_data);
bt_self_component_set_data(
- bt_self_component_sink_borrow_self_component(self_comp),
+ bt_self_component_sink_as_self_component(self_comp),
user_data);
ret = bt_self_component_sink_add_input_port(
self_comp, "in", NULL, NULL);
{
struct sink_user_data *user_data =
bt_self_component_get_data(
- bt_self_component_sink_borrow_self_component(
+ bt_self_component_sink_as_self_component(
self_comp));
if (user_data) {
src_comp_class, src_iter_finalize);
BT_ASSERT(ret == 0);
ret = bt_private_graph_add_source_component(graph,
- bt_private_component_class_source_borrow_component_class_source(
+ bt_private_component_class_source_as_component_class_source(
src_comp_class), "source", NULL, source);
BT_ASSERT(ret == 0);
bt_object_put_ref(src_comp_class);
sink_comp_class, sink_port_connected);
BT_ASSERT(ret == 0);
ret = bt_private_graph_add_sink_component(graph,
- bt_private_component_class_sink_borrow_component_class_sink(
+ bt_private_component_class_sink_as_component_class_sink(
sink_comp_class),
"sink", NULL, sink);
BT_ASSERT(ret == 0);
struct bt_value *obj;
priv_obj = bt_private_value_bool_create();
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ok(obj && bt_value_is_bool(obj),
"bt_private_value_bool_create() returns a boolean value object");
value = BT_FALSE;
priv_obj = bt_private_value_bool_create_init(BT_TRUE);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ok(obj && bt_value_is_bool(obj),
"bt_private_value_bool_create_init() returns a boolean value object");
value = bt_value_bool_get(obj);
struct bt_value *obj;
priv_obj = bt_private_value_integer_create();
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ok(obj && bt_value_is_integer(obj),
"bt_private_value_integer_create() returns an integer value object");
pass("putting an existing integer value object does not cause a crash")
priv_obj = bt_private_value_integer_create_init(321456987);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ok(obj && bt_value_is_integer(obj),
"bt_private_value_integer_create_init() returns an integer value object");
value = bt_value_integer_get(obj);
struct bt_value *obj;
priv_obj = bt_private_value_real_create();
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ok(obj && bt_value_is_real(obj),
"bt_private_value_real_create() returns a real number value object");
pass("putting an existing real number value object does not cause a crash")
priv_obj = bt_private_value_real_create_init(33.1649758);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ok(obj && bt_value_is_real(obj),
"bt_private_value_real_create_init() returns a real number value object");
value = bt_value_real_get(obj);
struct bt_value *obj;
priv_obj = bt_private_value_string_create();
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ok(obj && bt_value_is_string(obj),
"bt_private_value_string_create() returns a string value object");
pass("putting an existing string value object does not cause a crash")
priv_obj = bt_private_value_string_create_init("initial value");
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ok(obj && bt_value_is_string(obj),
"bt_private_value_string_create_init() returns a string value object");
value = bt_value_string_get(obj);
struct bt_value *array_obj;
priv_array_obj = bt_private_value_array_create();
- array_obj = bt_private_value_borrow_value(priv_array_obj);
+ array_obj = bt_private_value_as_value(priv_array_obj);
ok(array_obj && bt_value_is_array(array_obj),
"bt_private_value_array_create() returns an array value object");
ok(bt_value_array_is_empty(array_obj),
"initial array value object size is 0");
priv_obj = bt_private_value_integer_create_init(345);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ret = bt_private_value_array_append_element(priv_array_obj, obj);
BT_OBJECT_PUT_REF_AND_RESET(priv_obj);
priv_obj = bt_private_value_real_create_init(-17.45);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ret |= bt_private_value_array_append_element(priv_array_obj, obj);
BT_OBJECT_PUT_REF_AND_RESET(priv_obj);
priv_obj = bt_private_value_bool_create_init(BT_TRUE);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ret |= bt_private_value_array_append_element(priv_array_obj, obj);
BT_OBJECT_PUT_REF_AND_RESET(priv_obj);
ret |= bt_private_value_array_append_element(priv_array_obj,
"bt_value_array_borrow_element_by_index() returns an value object with the appropriate type (null)");
priv_obj = bt_private_value_integer_create_init(1001);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
BT_ASSERT(obj);
ok(!bt_private_value_array_set_element_by_index(priv_array_obj, 2, obj),
"bt_value_array_set_element_by_index() succeeds");
struct map_foreach_checklist checklist;
priv_map_obj = bt_private_value_map_create();
- map_obj = bt_private_value_borrow_value(priv_map_obj);
+ map_obj = bt_private_value_as_value(priv_map_obj);
ok(map_obj && bt_value_is_map(map_obj),
"bt_private_value_map_create() returns a map value object");
ok(bt_value_map_get_size(map_obj) == 0,
"initial map value object size is 0");
priv_obj = bt_private_value_integer_create_init(19457);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ret = bt_private_value_map_insert_entry(priv_map_obj, "int", obj);
BT_OBJECT_PUT_REF_AND_RESET(priv_obj);
priv_obj = bt_private_value_real_create_init(5.444);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ret |= bt_private_value_map_insert_entry(priv_map_obj, "real", obj);
BT_OBJECT_PUT_REF_AND_RESET(priv_obj);
priv_obj = bt_private_value_bool_create();
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ret |= bt_private_value_map_insert_entry(priv_map_obj, "bt_bool", obj);
BT_OBJECT_PUT_REF_AND_RESET(priv_obj);
ret |= bt_private_value_map_insert_entry(priv_map_obj, "null",
"inserting an element into a map value object increment its size");
priv_obj = bt_private_value_bool_create_init(BT_TRUE);
- obj = bt_private_value_borrow_value(priv_obj);
+ obj = bt_private_value_as_value(priv_obj);
ret = bt_private_value_map_insert_entry(priv_map_obj, "bt_bool", obj);
BT_OBJECT_PUT_REF_AND_RESET(priv_obj);
ok(!ret, "bt_private_value_map_insert_entry() accepts an existing key");
BT_ASSERT(bool1 && bool2 && bool3);
ok(!bt_value_compare(bt_value_null,
- bt_private_value_borrow_value(bool1)),
+ bt_private_value_as_value(bool1)),
"cannot compare null value object and bt_bool value object");
- ok(!bt_value_compare(bt_private_value_borrow_value(bool1),
- bt_private_value_borrow_value(bool2)),
+ ok(!bt_value_compare(bt_private_value_as_value(bool1),
+ bt_private_value_as_value(bool2)),
"boolean value objects are not equivalent (BT_FALSE and BT_TRUE)");
- ok(bt_value_compare(bt_private_value_borrow_value(bool1),
- bt_private_value_borrow_value(bool3)),
+ ok(bt_value_compare(bt_private_value_as_value(bool1),
+ bt_private_value_as_value(bool3)),
"boolean value objects are equivalent (BT_FALSE and BT_FALSE)");
BT_OBJECT_PUT_REF_AND_RESET(bool1);
BT_ASSERT(int1 && int2 && int3);
ok(!bt_value_compare(bt_value_null,
- bt_private_value_borrow_value(int1)),
+ bt_private_value_as_value(int1)),
"cannot compare null value object and integer value object");
- ok(!bt_value_compare(bt_private_value_borrow_value(int1),
- bt_private_value_borrow_value(int2)),
+ ok(!bt_value_compare(bt_private_value_as_value(int1),
+ bt_private_value_as_value(int2)),
"integer value objects are not equivalent (10 and -23)");
- ok(bt_value_compare(bt_private_value_borrow_value(int1),
- bt_private_value_borrow_value(int3)),
+ ok(bt_value_compare(bt_private_value_as_value(int1),
+ bt_private_value_as_value(int3)),
"integer value objects are equivalent (10 and 10)");
BT_OBJECT_PUT_REF_AND_RESET(int1);
BT_ASSERT(real1 && real2 && real3);
ok(!bt_value_compare(bt_value_null,
- bt_private_value_borrow_value(real1)),
+ bt_private_value_as_value(real1)),
"cannot compare null value object and real number value object");
- ok(!bt_value_compare(bt_private_value_borrow_value(real1),
- bt_private_value_borrow_value(real2)),
+ ok(!bt_value_compare(bt_private_value_as_value(real1),
+ bt_private_value_as_value(real2)),
"real number value objects are not equivalent (17.38 and -14.23)");
- ok(bt_value_compare(bt_private_value_borrow_value(real1),
- bt_private_value_borrow_value(real3)),
+ ok(bt_value_compare(bt_private_value_as_value(real1),
+ bt_private_value_as_value(real3)),
"real number value objects are equivalent (17.38 and 17.38)");
BT_OBJECT_PUT_REF_AND_RESET(real1);
BT_ASSERT(string1 && string2 && string3);
ok(!bt_value_compare(bt_value_null,
- bt_private_value_borrow_value(string1)),
+ bt_private_value_as_value(string1)),
"cannot compare null value object and string value object");
- ok(!bt_value_compare(bt_private_value_borrow_value(string1),
- bt_private_value_borrow_value(string2)),
+ ok(!bt_value_compare(bt_private_value_as_value(string1),
+ bt_private_value_as_value(string2)),
"string value objects are not equivalent (\"hello\" and \"bt_value\")");
- ok(bt_value_compare(bt_private_value_borrow_value(string1),
- bt_private_value_borrow_value(string3)),
+ ok(bt_value_compare(bt_private_value_as_value(string1),
+ bt_private_value_as_value(string3)),
"string value objects are equivalent (\"hello\" and \"hello\")");
BT_OBJECT_PUT_REF_AND_RESET(string1);
BT_ASSERT(array1 && array2 && array3);
- ok(bt_value_compare(bt_private_value_borrow_value(array1),
- bt_private_value_borrow_value(array2)),
+ ok(bt_value_compare(bt_private_value_as_value(array1),
+ bt_private_value_as_value(array2)),
"empty array value objects are equivalent");
status = bt_private_value_array_append_integer_element(array1, 23);
status = bt_private_value_array_append_bool_element(array3, BT_FALSE);
BT_ASSERT(status == BT_VALUE_STATUS_OK);
BT_ASSERT(bt_value_array_get_size(
- bt_private_value_borrow_value(array1)) == 3);
+ bt_private_value_as_value(array1)) == 3);
BT_ASSERT(bt_value_array_get_size(
- bt_private_value_borrow_value(array2)) == 3);
+ bt_private_value_as_value(array2)) == 3);
BT_ASSERT(bt_value_array_get_size(
- bt_private_value_borrow_value(array3)) == 3);
+ bt_private_value_as_value(array3)) == 3);
ok(!bt_value_compare(bt_value_null,
- bt_private_value_borrow_value(array1)),
+ bt_private_value_as_value(array1)),
"cannot compare null value object and array value object");
- ok(!bt_value_compare(bt_private_value_borrow_value(array1),
- bt_private_value_borrow_value(array2)),
+ ok(!bt_value_compare(bt_private_value_as_value(array1),
+ bt_private_value_as_value(array2)),
"array value objects are not equivalent ([23, 14.2, BT_FALSE] and [14.2, 23, BT_FALSE])");
- ok(bt_value_compare(bt_private_value_borrow_value(array1),
- bt_private_value_borrow_value(array3)),
+ ok(bt_value_compare(bt_private_value_as_value(array1),
+ bt_private_value_as_value(array3)),
"array value objects are equivalent ([23, 14.2, BT_FALSE] and [23, 14.2, BT_FALSE])");
BT_OBJECT_PUT_REF_AND_RESET(array1);
BT_ASSERT(map1 && map2 && map3);
- ok(bt_value_compare(bt_private_value_borrow_value(map1),
- bt_private_value_borrow_value(map2)),
+ ok(bt_value_compare(bt_private_value_as_value(map1),
+ bt_private_value_as_value(map2)),
"empty map value objects are equivalent");
status = bt_private_value_map_insert_real_entry(map3, "two", 14.2);
BT_ASSERT(status == BT_VALUE_STATUS_OK);
BT_ASSERT(bt_value_map_get_size(
- bt_private_value_borrow_value(map1)) == 3);
+ bt_private_value_as_value(map1)) == 3);
BT_ASSERT(bt_value_map_get_size(
- bt_private_value_borrow_value(map2)) == 3);
+ bt_private_value_as_value(map2)) == 3);
BT_ASSERT(bt_value_map_get_size(
- bt_private_value_borrow_value(map3)) == 3);
+ bt_private_value_as_value(map3)) == 3);
ok(!bt_value_compare(bt_value_null,
- bt_private_value_borrow_value(map1)),
+ bt_private_value_as_value(map1)),
"cannot compare null value object and map value object");
- ok(!bt_value_compare(bt_private_value_borrow_value(map1),
- bt_private_value_borrow_value(map2)),
+ ok(!bt_value_compare(bt_private_value_as_value(map1),
+ bt_private_value_as_value(map2)),
"map value objects are not equivalent");
- ok(bt_value_compare(bt_private_value_borrow_value(map1),
- bt_private_value_borrow_value(map3)),
+ ok(bt_value_compare(bt_private_value_as_value(map1),
+ bt_private_value_as_value(map3)),
"map value objects are equivalent");
BT_OBJECT_PUT_REF_AND_RESET(map1);
array_obj && map_obj);
status = bt_private_value_array_append_element(array_obj,
- bt_private_value_borrow_value(bool_obj));
+ bt_private_value_as_value(bool_obj));
BT_ASSERT(status == BT_VALUE_STATUS_OK);
status = bt_private_value_array_append_element(array_obj,
- bt_private_value_borrow_value(integer_obj));
+ bt_private_value_as_value(integer_obj));
BT_ASSERT(status == BT_VALUE_STATUS_OK);
status = bt_private_value_array_append_element(array_obj,
- bt_private_value_borrow_value(real_obj));
+ bt_private_value_as_value(real_obj));
BT_ASSERT(status == BT_VALUE_STATUS_OK);
status = bt_private_value_array_append_element(array_obj,
bt_value_null);
BT_ASSERT(status == BT_VALUE_STATUS_OK);
status = bt_private_value_map_insert_entry(map_obj, "array",
- bt_private_value_borrow_value(array_obj));
+ bt_private_value_as_value(array_obj));
BT_ASSERT(status == BT_VALUE_STATUS_OK);
status = bt_private_value_map_insert_entry(map_obj, "string",
- bt_private_value_borrow_value(string_obj));
+ bt_private_value_as_value(string_obj));
BT_ASSERT(status == BT_VALUE_STATUS_OK);
status = bt_value_copy(&map_copy_obj,
- bt_private_value_borrow_value(map_obj));
+ bt_private_value_as_value(map_obj));
ok(status == BT_VALUE_STATUS_OK && map_copy_obj,
"bt_value_copy() succeeds");
"bt_value_copy() returns a different pointer (real)");
null_copy_obj = bt_private_value_array_borrow_element_by_index(
array_copy_obj, 3);
- ok(bt_private_value_borrow_value(null_copy_obj) == bt_value_null,
+ ok(bt_private_value_as_value(null_copy_obj) == bt_value_null,
"bt_value_copy() returns the same pointer (null)");
- ok(bt_value_compare(bt_private_value_borrow_value(map_obj),
- bt_private_value_borrow_value(map_copy_obj)),
+ ok(bt_value_compare(bt_private_value_as_value(map_obj),
+ bt_private_value_as_value(map_copy_obj)),
"source and destination value objects have the same content");
BT_OBJECT_PUT_REF_AND_RESET(map_copy_obj);
BT_ASSERT(status == BT_VALUE_STATUS_OK);
status = bt_value_map_extend(
&extended_map,
- bt_private_value_borrow_value(base_map),
- bt_private_value_borrow_value(extension_map));
+ bt_private_value_as_value(base_map),
+ bt_private_value_as_value(extension_map));
ok(status == BT_VALUE_STATUS_OK &&
extended_map, "bt_value_map_extend() succeeds");
ok(bt_value_map_get_size(
- bt_private_value_borrow_value(extended_map)) == 5,
+ bt_private_value_as_value(extended_map)) == 5,
"bt_value_map_extend() returns a map object with the correct size");
- ok(compare_map_elements(bt_private_value_borrow_value(base_map),
- bt_private_value_borrow_value(extended_map), "file"),
+ ok(compare_map_elements(bt_private_value_as_value(base_map),
+ bt_private_value_as_value(extended_map), "file"),
"bt_value_map_extend() picks the appropriate element (file)");
- ok(compare_map_elements(bt_private_value_borrow_value(extension_map),
- bt_private_value_borrow_value(extended_map), "edit"),
+ ok(compare_map_elements(bt_private_value_as_value(extension_map),
+ bt_private_value_as_value(extended_map), "edit"),
"bt_value_map_extend() picks the appropriate element (edit)");
- ok(compare_map_elements(bt_private_value_borrow_value(base_map),
- bt_private_value_borrow_value(extended_map), "selection"),
+ ok(compare_map_elements(bt_private_value_as_value(base_map),
+ bt_private_value_as_value(extended_map), "selection"),
"bt_value_map_extend() picks the appropriate element (selection)");
- ok(compare_map_elements(bt_private_value_borrow_value(extension_map),
- bt_private_value_borrow_value(extended_map), "find"),
+ ok(compare_map_elements(bt_private_value_as_value(extension_map),
+ bt_private_value_as_value(extended_map), "find"),
"bt_value_map_extend() picks the appropriate element (find)");
- ok(compare_map_elements(bt_private_value_borrow_value(extension_map),
- bt_private_value_borrow_value(extended_map), "project"),
+ ok(compare_map_elements(bt_private_value_as_value(extension_map),
+ bt_private_value_as_value(extended_map), "project"),
"bt_value_map_extend() picks the appropriate element (project)");
BT_OBJECT_PUT_REF_AND_RESET(array);
struct event event = {
.type = SRC_COMP_ACCEPT_OUTPUT_PORT_CONNECTION,
.data.src_comp_accept_output_port_connection = {
- .comp = bt_self_component_borrow_component(
- bt_self_component_source_borrow_self_component(
+ .comp = bt_self_component_as_component(
+ bt_self_component_source_as_self_component(
self_comp)),
- .self_port = bt_self_component_port_borrow_port(
- bt_self_component_port_output_borrow_self_component_port(
+ .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_borrow_port(other_port),
+ .other_port = bt_port_input_as_port(other_port),
},
};
struct event event = {
.type = SINK_COMP_ACCEPT_INPUT_PORT_CONNECTION,
.data.sink_comp_accept_input_port_connection = {
- .comp = bt_self_component_borrow_component(
- bt_self_component_sink_borrow_self_component(
+ .comp = bt_self_component_as_component(
+ bt_self_component_sink_as_self_component(
self_comp)),
- .self_port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ .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_borrow_port(other_port),
+ .other_port = bt_port_output_as_port(other_port),
},
};
struct event event = {
.type = SRC_COMP_OUTPUT_PORT_CONNECTED,
.data.src_comp_output_port_connected = {
- .comp = bt_self_component_borrow_component(
- bt_self_component_source_borrow_self_component(
+ .comp = bt_self_component_as_component(
+ bt_self_component_source_as_self_component(
self_comp)),
- .self_port = bt_self_component_port_borrow_port(
- bt_self_component_port_output_borrow_self_component_port(
+ .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_borrow_port(other_port),
+ .other_port = bt_port_input_as_port(other_port),
},
};
struct event event = {
.type = SINK_COMP_INPUT_PORT_CONNECTED,
.data.sink_comp_input_port_connected = {
- .comp = bt_self_component_borrow_component(
- bt_self_component_sink_borrow_self_component(
+ .comp = bt_self_component_as_component(
+ bt_self_component_sink_as_self_component(
self_comp)),
- .self_port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ .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_borrow_port(other_port),
+ .other_port = bt_port_output_as_port(other_port),
},
};
struct event event = {
.type = SRC_COMP_OUTPUT_PORT_DISCONNECTED,
.data.src_comp_output_port_disconnected = {
- .comp = bt_self_component_borrow_component(
- bt_self_component_source_borrow_self_component(
+ .comp = bt_self_component_as_component(
+ bt_self_component_source_as_self_component(
self_comp)),
- .self_port = bt_self_component_port_borrow_port(
- bt_self_component_port_output_borrow_self_component_port(
+ .self_port = bt_self_component_port_as_port(
+ bt_self_component_port_output_as_self_component_port(
self_comp_port)),
},
};
switch (current_test) {
case TEST_SINK_REMOVES_PORT_IN_CONSUME_THEN_SRC_REMOVES_DISCONNECTED_PORT:
ret = bt_self_component_port_remove_from_component(
- bt_self_component_port_output_borrow_self_component_port(
+ bt_self_component_port_output_as_self_component_port(
self_comp_port));
BT_ASSERT(ret == 0);
default:
struct event event = {
.type = SINK_COMP_INPUT_PORT_DISCONNECTED,
.data.sink_comp_input_port_disconnected = {
- .comp = bt_self_component_borrow_component(
- bt_self_component_sink_borrow_self_component(
+ .comp = bt_self_component_as_component(
+ bt_self_component_sink_as_self_component(
self_comp)),
- .self_port = bt_self_component_port_borrow_port(
- bt_self_component_port_input_borrow_self_component_port(
+ .self_port = bt_self_component_port_as_port(
+ bt_self_component_port_input_as_self_component_port(
self_comp_port)),
},
};
self_comp, "in");
BT_ASSERT(def_port);
ret = bt_self_component_port_remove_from_component(
- bt_self_component_port_input_borrow_self_component_port(
+ bt_self_component_port_input_as_self_component_port(
def_port));
BT_ASSERT(ret == 0);
break;
struct event event = {
.type = GRAPH_SRC_OUTPUT_PORT_ADDED,
.data.graph_src_output_port_added = {
- .comp = bt_component_source_borrow_component(comp),
- .port = bt_port_output_borrow_port(port),
+ .comp = bt_component_source_as_component(comp),
+ .port = bt_port_output_as_port(port),
},
};
struct event event = {
.type = GRAPH_SINK_INPUT_PORT_ADDED,
.data.graph_sink_input_port_added = {
- .comp = bt_component_sink_borrow_component(comp),
- .port = bt_port_input_borrow_port(port),
+ .comp = bt_component_sink_as_component(comp),
+ .port = bt_port_input_as_port(port),
},
};
struct event event = {
.type = GRAPH_SRC_OUTPUT_PORT_REMOVED,
.data.graph_src_output_port_removed = {
- .comp = bt_component_source_borrow_component(comp),
- .port = bt_port_output_borrow_port(port),
+ .comp = bt_component_source_as_component(comp),
+ .port = bt_port_output_as_port(port),
},
};
struct event event = {
.type = GRAPH_SINK_INPUT_PORT_REMOVED,
.data.graph_sink_input_port_removed = {
- .comp = bt_component_sink_borrow_component(comp),
- .port = bt_port_input_borrow_port(port),
+ .comp = bt_component_sink_as_component(comp),
+ .port = bt_port_input_as_port(port),
},
};
.type = GRAPH_SRC_SINK_PORTS_CONNECTED,
.data.graph_src_sink_ports_connected = {
.upstream_comp =
- bt_component_source_borrow_component(upstream_comp),
+ bt_component_source_as_component(upstream_comp),
.downstream_comp =
- bt_component_sink_borrow_component(downstream_comp),
+ bt_component_sink_as_component(downstream_comp),
.upstream_port =
- bt_port_output_borrow_port(upstream_port),
+ bt_port_output_as_port(upstream_port),
.downstream_port =
- bt_port_input_borrow_port(downstream_port),
+ bt_port_input_as_port(downstream_port),
},
};
.type = GRAPH_SRC_SINK_PORTS_DISCONNECTED,
.data.graph_src_sink_ports_disconnected = {
.upstream_comp =
- bt_component_source_borrow_component(upstream_comp),
+ bt_component_source_as_component(upstream_comp),
.downstream_comp =
- bt_component_sink_borrow_component(downstream_comp),
+ bt_component_sink_as_component(downstream_comp),
.upstream_port =
- bt_port_output_borrow_port(upstream_port),
+ bt_port_output_as_port(upstream_port),
.downstream_port =
- bt_port_input_borrow_port(downstream_port),
+ bt_port_input_as_port(downstream_port),
},
};
int ret;
ret = bt_private_graph_add_source_component(graph,
- bt_private_component_class_source_borrow_component_class_source(
+ bt_private_component_class_source_as_component_class_source(
src_comp_class),
"src-comp", NULL, &comp);
BT_ASSERT(ret == 0);
int ret;
ret = bt_private_graph_add_sink_component(graph,
- bt_private_component_class_sink_borrow_component_class_sink(
+ bt_private_component_class_sink_as_component_class_sink(
sink_comp_class),
"sink-comp", NULL, &comp);
BT_ASSERT(ret == 0);
status = bt_private_graph_connect_ports(graph, src_def_port,
sink_def_port, NULL);
BT_ASSERT(status == 0);
- gsrc = bt_component_source_borrow_component(src);
- gsink = bt_component_sink_borrow_component(sink);
- gsrc_def_port = bt_port_output_borrow_port(src_def_port);
- gsink_def_port = bt_port_input_borrow_port(sink_def_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);
+ gsink_def_port = bt_port_input_as_port(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)");
status = bt_private_graph_connect_ports(graph, src_def_port,
sink_def_port, NULL);
BT_ASSERT(status == 0);
- gsrc = bt_component_source_borrow_component(src);
- gsink = bt_component_sink_borrow_component(sink);
- gsrc_def_port = bt_port_output_borrow_port(src_def_port);
- gsink_def_port = bt_port_input_borrow_port(sink_def_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);
+ gsink_def_port = bt_port_input_as_port(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)");
src_hello_port = bt_component_source_borrow_output_port_by_name(src,
"hello");
BT_ASSERT(src_hello_port);
- gsrc = bt_component_source_borrow_component(src);
- gsink = bt_component_sink_borrow_component(sink);
- gsrc_def_port = bt_port_output_borrow_port(src_def_port);
- gsrc_hello_port = bt_port_output_borrow_port(src_hello_port);
- gsink_def_port = bt_port_input_borrow_port(sink_def_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);
/* We're supposed to have 8 events */
ok(events->len == 8, "we have the expected number of events");
status = bt_private_graph_connect_ports(graph, src_def_port,
sink_def_port, NULL);
BT_ASSERT(status == 0);
- gsrc = bt_component_source_borrow_component(src);
- gsink = bt_component_sink_borrow_component(sink);
- gsrc_def_port = bt_port_output_borrow_port(src_def_port);
- gsink_def_port = bt_port_input_borrow_port(sink_def_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);
+ gsink_def_port = bt_port_input_as_port(sink_def_port);
/* We're supposed to have 7 events */
ok(events->len == 7, "we have the expected number of events");
ok(status != BT_GRAPH_STATUS_OK,
"bt_private_graph_connect_ports() returns an error");
ok(!conn, "returned connection is still NULL");
- gsrc = bt_component_source_borrow_component(src);
- gsink = bt_component_sink_borrow_component(sink);
- gsrc_def_port = bt_port_output_borrow_port(src_def_port);
- gsink_def_port = bt_port_input_borrow_port(sink_def_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);
+ gsink_def_port = bt_port_input_as_port(sink_def_port);
/* We're supposed to have 5 events */
ok(events->len == 5, "we have the expected number of events");
ok(status != BT_GRAPH_STATUS_OK,
"bt_private_graph_connect_ports() returns an error");
ok(!conn, "returned connection is still NULL");
- gsrc = bt_component_source_borrow_component(src);
- gsink = bt_component_sink_borrow_component(sink);
- gsrc_def_port = bt_port_output_borrow_port(src_def_port);
- gsink_def_port = bt_port_input_borrow_port(sink_def_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);
+ gsink_def_port = bt_port_input_as_port(sink_def_port);
/* We're supposed to have 5 events */
ok(events->len == 7, "we have the expected number of events");
ok(sink_comp_class,
"bt_plugin_borrow_sink_component_class_by_name() finds a sink component class");
ok(strcmp(bt_component_class_get_help(
- bt_component_class_sink_borrow_component_class(sink_comp_class)),
+ 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"
params = bt_private_value_integer_create_init(23);
BT_ASSERT(params);
ret = bt_private_query_executor_query(query_exec,
- bt_component_class_filter_borrow_component_class(filter_comp_class),
- "get-something", bt_private_value_borrow_value(params),
+ bt_component_class_filter_as_component_class(filter_comp_class),
+ "get-something", bt_private_value_as_value(params),
&results);
ok(ret == 0 && results, "bt_private_query_executor_query() succeeds");
BT_ASSERT(bt_value_is_array(results) && bt_value_array_get_size(results) == 2);
ok(strcmp(object_str, "get-something") == 0,
"bt_component_class_query() receives the expected object name");
res_params = bt_value_array_borrow_element_by_index(results, 1);
- ok(res_params == bt_private_value_borrow_value(params),
+ ok(res_params == bt_private_value_as_value(params),
"bt_component_class_query() receives the expected parameters");
bt_object_get_ref(sink_comp_class);