lib: Add functions to borrow specialized component classes from specialized components
[babeltrace.git] / include / babeltrace / graph / connection-internal.h
index d22c7eea04e8af898f647957c1a9086ee687b95c..2c9b9d0dfc40be014a7210001b45fa62e54b494b 100644 (file)
@@ -1,13 +1,10 @@
-#ifndef BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H
-#define BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H
+#ifndef BABELTRACE_GRAPH_CONNECTION_INTERNAL_H
+#define BABELTRACE_GRAPH_CONNECTION_INTERNAL_H
 
 /*
- * BabelTrace - Component Connection Internal
- *
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
  * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * in the Software without restriction, including without limitation the rights
  * SOFTWARE.
  */
 
-#include <babeltrace/graph/connection.h>
-#include <babeltrace/graph/private-connection.h>
+#include <babeltrace/graph/connection-const.h>
+#include <babeltrace/graph/message-iterator-const.h>
+#include <babeltrace/graph/message-iterator-internal.h>
 #include <babeltrace/object-internal.h>
+#include <babeltrace/assert-internal.h>
+#include <stdbool.h>
 
 struct bt_graph;
 
@@ -48,21 +48,17 @@ struct bt_connection {
        struct bt_port *downstream_port;
        /* Upstream port. */
        struct bt_port *upstream_port;
-};
 
-static inline
-struct bt_connection *bt_connection_from_private(
-               struct bt_private_connection *private_connection)
-{
-       return (void *) private_connection;
-}
+       /*
+        * Weak references to all the message iterators that were
+        * created on this connection.
+        */
+       GPtrArray *iterators;
 
-static inline
-struct bt_private_connection *bt_private_connection_from_connection(
-               struct bt_connection *connection)
-{
-       return (void *) connection;
-}
+       bool notified_upstream_port_connected;
+       bool notified_downstream_port_connected;
+       bool notified_graph_ports_connected;
+};
 
 BT_HIDDEN
 struct bt_connection *bt_connection_create(struct bt_graph *graph,
@@ -70,7 +66,17 @@ 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,
-               struct bt_component *comp);
+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_self_component_port_input_message_iterator *iterator);
+
+static inline
+struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn)
+{
+       BT_ASSERT(conn);
+       return (void *) conn->base.parent;
+}
 
-#endif /* BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H */
+#endif /* BABELTRACE_GRAPH_CONNECTION_INTERNAL_H */
This page took 0.024545 seconds and 4 git commands to generate.