X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fgraph%2Fconnection-internal.h;h=c86bc82dfc3fd15c7ec0bd365e527c9a5e475a8e;hb=d6e69534ef08a2dd8bff9eb5af1eab63736b3d31;hp=7b4d26d221911a1e4d955e611a622fd390ee692a;hpb=fed72692bfbbfbd110ab4ddb5fcb6e82ca19c496;p=babeltrace.git diff --git a/include/babeltrace/graph/connection-internal.h b/include/babeltrace/graph/connection-internal.h index 7b4d26d2..c86bc82d 100644 --- a/include/babeltrace/graph/connection-internal.h +++ b/include/babeltrace/graph/connection-internal.h @@ -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 * Copyright 2017 Jérémie Galarneau * - * Author: Jérémie Galarneau - * * 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 @@ -27,10 +24,11 @@ * SOFTWARE. */ -#include -#include -#include +#include +#include +#include #include +#include #include struct bt_graph; @@ -52,25 +50,18 @@ struct bt_connection { struct bt_port *upstream_port; /* - * Weak references to all the notification iterators that were + * Weak references to all the message iterators that were * created on this connection. */ GPtrArray *iterators; -}; - -static inline -struct bt_connection *bt_connection_from_private( - struct bt_private_connection *private_connection) -{ - return (void *) private_connection; -} -static inline -struct bt_private_connection *bt_private_connection_from_connection( - struct bt_connection *connection) -{ - return (void *) connection; -} + bool msgied_upstream_port_connected; + bool msgied_upstream_port_disconnected; + bool msgied_downstream_port_connected; + bool msgied_downstream_port_disconnected; + bool msgied_graph_ports_connected; + bool msgied_graph_ports_disconnected; +}; BT_HIDDEN struct bt_connection *bt_connection_create(struct bt_graph *graph, @@ -82,65 +73,13 @@ 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_self_component_port_input_message_iterator *iterator); static inline struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn) { - assert(conn); + BT_ASSERT(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_COMPONENT_CONNECTION_INTERNAL_H */ +#endif /* BABELTRACE_GRAPH_CONNECTION_INTERNAL_H */