lib: graph: add "self" and some "private" APIs
[babeltrace.git] / include / babeltrace / graph / connection-internal.h
index 73fb1b020ef2475c14c70c30623b8b914e1df4e7..98222c04316a55b2949e892b5084849b8c335570 100644 (file)
@@ -2,8 +2,6 @@
 #define BABELTRACE_GRAPH_CONNECTION_INTERNAL_H
 
 /*
- * BabelTrace - Component Connection Internal
- *
  * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
@@ -30,7 +28,6 @@
 #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 <babeltrace/assert-internal.h>
 #include <stdbool.h>
@@ -60,17 +57,13 @@ struct bt_connection {
        GPtrArray *iterators;
 
        bool notified_upstream_port_connected;
+       bool notified_upstream_port_disconnected;
        bool notified_downstream_port_connected;
+       bool notified_downstream_port_disconnected;
        bool notified_graph_ports_connected;
+       bool notified_graph_ports_disconnected;
 };
 
-static inline
-struct bt_private_connection *bt_private_connection_from_connection(
-               struct bt_connection *connection)
-{
-       return (void *) connection;
-}
-
 BT_HIDDEN
 struct bt_connection *bt_connection_create(struct bt_graph *graph,
                struct bt_port *upstream_port,
@@ -81,7 +74,7 @@ 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_private_connection *iterator);
+               struct bt_self_component_port_input_notification_iterator *iterator);
 
 static inline
 struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn)
@@ -90,56 +83,4 @@ struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn)
        return (void *) conn->base.parent;
 }
 
-static inline
-enum bt_connection_status
-bt_connection_status_from_notification_iterator_status(
-               enum bt_notification_iterator_status iter_status)
-{
-       switch (iter_status) {
-       case BT_NOTIFICATION_ITERATOR_STATUS_CANCELED:
-               return BT_CONNECTION_STATUS_ERROR;
-       case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN:
-               return BT_CONNECTION_STATUS_ERROR;
-       case BT_NOTIFICATION_ITERATOR_STATUS_END:
-               return BT_CONNECTION_STATUS_ERROR;
-       case BT_NOTIFICATION_ITERATOR_STATUS_OK:
-               return BT_CONNECTION_STATUS_OK;
-       case BT_NOTIFICATION_ITERATOR_STATUS_INVALID:
-               return BT_CONNECTION_STATUS_INVALID;
-       case BT_NOTIFICATION_ITERATOR_STATUS_ERROR:
-               return BT_CONNECTION_STATUS_ERROR;
-       case BT_NOTIFICATION_ITERATOR_STATUS_NOMEM:
-               return BT_CONNECTION_STATUS_NOMEM;
-       case BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED:
-               return BT_CONNECTION_STATUS_ERROR;
-       default:
-#ifdef BT_LOGF
-               BT_LOGF("Unknown notification iterator status: status=%d",
-                       iter_status);
-#endif
-               abort();
-       }
-}
-
-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_GRAPH_CONNECTION_INTERNAL_H */
This page took 0.02537 seconds and 4 git commands to generate.