bool init_can_consume;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
BT_ASSERT_PRE_NON_NULL(upstream_port, "Upstream port");
BT_ASSERT_PRE_NON_NULL(downstream_port, "Downstream port port");
BT_ASSERT_PRE(
enum bt_graph_run_once_status status;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(graph, "Graph");
+ BT_ASSERT_PRE_DEV_GRAPH_NON_NULL(graph);
BT_ASSERT_PRE_DEV(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
BT_ASSERT_PRE_DEV(graph->config_state !=
enum bt_graph_run_status status;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
BT_ASSERT_PRE(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
BT_ASSERT_PRE(graph->config_state != BT_GRAPH_CONFIGURATION_STATE_FAULTY,
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(func);
g_array_append_val(graph->listeners.source_output_port_added, listener);
listener_id = graph->listeners.source_output_port_added->len - 1;
BT_LIB_LOGD("Added \"source component output port added\" listener to graph: "
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(func);
g_array_append_val(graph->listeners.filter_output_port_added, listener);
listener_id = graph->listeners.filter_output_port_added->len - 1;
BT_LIB_LOGD("Added \"filter component output port added\" listener to graph: "
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(func);
g_array_append_val(graph->listeners.filter_input_port_added, listener);
listener_id = graph->listeners.filter_input_port_added->len - 1;
BT_LIB_LOGD("Added \"filter component input port added\" listener to graph: "
bt_listener_id listener_id;
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(func, "Listener");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_LISTENER_FUNC_NON_NULL(func);
g_array_append_val(graph->listeners.sink_input_port_added, listener);
listener_id = graph->listeners.sink_input_port_added->len - 1;
BT_LIB_LOGD("Added \"sink component input port added\" listener to graph: "
struct bt_value *new_params = NULL;
BT_ASSERT(comp_cls);
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(name, "Name");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_NAME_NON_NULL(name);
BT_ASSERT_PRE(
graph->config_state == BT_GRAPH_CONFIGURATION_STATE_CONFIGURING,
"Graph is not in the \"configuring\" state: %!+g", graph);
BT_ASSERT_PRE(!component_name_exists(graph, name),
"Duplicate component name: %!+g, name=\"%s\"", graph, name);
- BT_ASSERT_PRE(!params || bt_value_is_map(params),
- "Parameter value is not a map value: %!+v", params);
+ BT_ASSERT_PRE_PARAM_VALUE_IS_MAP(params);
init_can_consume = graph->can_consume;
bt_graph_set_can_consume(graph, false);
BT_LIB_LOGI("Adding component to graph: "
const struct bt_component_source **component)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
name, params, init_method_data, log_level, (void *) component);
const struct bt_component_filter **component)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
name, params, init_method_data, log_level, (void *) component);
const struct bt_component_sink **component)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
+ BT_ASSERT_PRE_COMP_CLS_NON_NULL(comp_cls);
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
name, params, init_method_data, log_level, (void *) component);
struct bt_graph *graph, const struct bt_interrupter *intr)
{
BT_ASSERT_PRE_NO_ERROR();
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
- BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
+ BT_ASSERT_PRE_INTR_NON_NULL(intr);
g_ptr_array_add(graph->interrupters, (void *) intr);
bt_object_get_ref_no_null_check(intr);
BT_LIB_LOGD("Added interrupter to graph: %![graph-]+g, %![intr-]+z",
struct bt_interrupter *bt_graph_borrow_default_interrupter(bt_graph *graph)
{
- BT_ASSERT_PRE_NON_NULL(graph, "Graph");
+ BT_ASSERT_PRE_GRAPH_NON_NULL(graph);
return graph->default_interrupter;
}