Split notification iterator API into base and specialized functions
[babeltrace.git] / include / babeltrace / graph / connection-internal.h
index 13e7d9ee65ad95aa0460819131a9e0dfb3b83347..f99d125f77e395b4483036b17c18a375744300ae 100644 (file)
 
 #include <babeltrace/graph/connection.h>
 #include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/notification-iterator-internal.h>
 #include <babeltrace/graph/private-connection.h>
 #include <babeltrace/object-internal.h>
+#include <stdbool.h>
 
 struct bt_graph;
 
@@ -77,11 +79,18 @@ struct bt_connection *bt_connection_create(struct bt_graph *graph,
                struct bt_port *downstream_port);
 
 BT_HIDDEN
-void bt_connection_disconnect_ports(struct bt_connection *conn);
+void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph);
 
 BT_HIDDEN
 void bt_connection_remove_iterator(struct bt_connection *conn,
-               struct bt_notification_iterator *iterator);
+               struct bt_notification_iterator_private_connection *iterator);
+
+static inline
+struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn)
+{
+       assert(conn);
+       return (void *) conn->base.parent;
+}
 
 static inline
 enum bt_connection_status
@@ -114,4 +123,25 @@ bt_connection_status_from_notification_iterator_status(
        }
 }
 
+static inline
+const char *bt_connection_status_string(enum bt_connection_status status)
+{
+       switch (status) {
+       case BT_CONNECTION_STATUS_GRAPH_IS_CANCELED:
+               return "BT_CONNECTION_STATUS_GRAPH_IS_CANCELED";
+       case BT_CONNECTION_STATUS_OK:
+               return "BT_CONNECTION_STATUS_OK";
+       case BT_CONNECTION_STATUS_INVALID:
+               return "BT_CONNECTION_STATUS_INVALID";
+       case BT_CONNECTION_STATUS_ERROR:
+               return "BT_CONNECTION_STATUS_ERROR";
+       case BT_CONNECTION_STATUS_NOMEM:
+               return "BT_CONNECTION_STATUS_NOMEM";
+       case BT_CONNECTION_STATUS_IS_ENDED:
+               return "BT_CONNECTION_STATUS_IS_ENDED";
+       default:
+               return "(unknown)";
+       }
+}
+
 #endif /* BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H */
This page took 0.026518 seconds and 4 git commands to generate.