void btd_gatt_remove_service(struct btd_attribute *service)
{
	GList *list = g_list_find(local_attribute_db, service);
	bool first_node;

	if (!list)
		return;

	first_node = local_attribute_db == list;

	/* Remove service declaration attribute */
	free(list->data);
	list = g_list_delete_link(list, list);

	/* Remove all characteristics until next service declaration */
	while (list && !is_service(list->data)) {
		free(list->data);
		list = g_list_delete_link(list, list);
	}

	/*
	 * When removing the first node, local attribute database head
	 * needs to be updated. Node removed from middle doesn't change
	 * the list head address.
	 */
	if (first_node)
		local_attribute_db = list;
}
Ejemplo n.º 2
0
void workflow::transformation_activity(const processed_object& o) {
    auto p(profiler_.generate(o));

    bool nothing_set(!p.is_enumeration() && !p.is_exception() &&
        !p.is_value_object() && !p.is_service() && !p.is_concept());
    if (p.is_uml_class() && nothing_set)
        p.is_value_object(true);

    validator_.validate(p);
    transformer_->transform(o, p);
}