Split notification iterator API into base and specialized functions
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 24 Aug 2017 20:52:12 +0000 (16:52 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 15 Sep 2017 18:31:29 +0000 (14:31 -0400)
This patch splits the notification iterator API into base functions
(<babeltrace/graph/notification-iterator.h>) shared by all notification
iterators:

* bt_notification_iterator_next()
* bt_notification_iterator_get_notification()

and specialized functions
(<babeltrace/graph/private-connection-notification-iterator.h>):

* bt_private_connection_notification_iterator_get_component()

This allows the future creation of specialized notification iterators
which can use the common API for basic operations. A "private connection
notification iterator", the only type of notification iterator as of
this patch, is a notification iterator created from a private connection
with bt_private_connection_create_notification_iterator().

The bt2 Python package is updated accordingly.
_GenericNotificationIterator has only the __next__() method, while
_PrivateConnectionNotificationIterator extends
_GenericNotificationIterator with the `component` property.

The name "private connection" is excluded from component class type
definitions and functions, and also from plugin development macros,
because this is the only type of notification iterator which a user can
provide anyway, for example:

* bt_component_class_notification_iterator_init_method
* bt_component_class_source_set_notification_iterator_init_method()

`bt_notification_iterator_next_return` is renamed to
`bt_notification_iterator_next_method_return` to indicate that this is
the user notification iterator's "next" method return type.
`bt_component_class_query_return` is renamed to
`bt_component_class_query_method_return` to match this convention.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
42 files changed:
bindings/python/bt2/bt2/connection.py
bindings/python/bt2/bt2/native_btcomponentclass.i
bindings/python/bt2/bt2/native_btnotifiter.i
bindings/python/bt2/bt2/notification_iterator.py
include/Makefile.am
include/babeltrace/babeltrace.h
include/babeltrace/graph/component-class-filter.h
include/babeltrace/graph/component-class-internal.h
include/babeltrace/graph/component-class-source.h
include/babeltrace/graph/component-class.h
include/babeltrace/graph/connection-internal.h
include/babeltrace/graph/notification-iterator-internal.h
include/babeltrace/graph/notification-iterator.h
include/babeltrace/graph/private-connection-notification-iterator.h [new file with mode: 0644]
include/babeltrace/graph/private-connection-private-notification-iterator.h [new file with mode: 0644]
include/babeltrace/graph/private-notification-iterator.h [deleted file]
lib/graph/component-class.c
lib/graph/component.c
lib/graph/connection.c
lib/graph/iterator.c
lib/graph/query-executor.c
lib/plugin/plugin-so.c
plugins/ctf/fs-src/data-stream-file.c
plugins/ctf/fs-src/data-stream-file.h
plugins/ctf/fs-src/fs.c
plugins/ctf/fs-src/fs.h
plugins/ctf/fs-src/query.c
plugins/ctf/fs-src/query.h
plugins/ctf/lttng-live/lttng-live-internal.h
plugins/ctf/lttng-live/lttng-live.c
plugins/lttng-utils/plugin.c
plugins/text/dmesg/dmesg.c
plugins/text/dmesg/dmesg.h
plugins/utils/muxer/muxer.c
plugins/utils/muxer/muxer.h
plugins/utils/trimmer/iterator.c
plugins/utils/trimmer/iterator.h
plugins/utils/trimmer/trimmer.c
tests/lib/test-plugin-plugins/sfs.c
tests/lib/test_bt_notification_iterator.c
tests/lib/test_graph_topo.c
tests/plugins/test-utils-muxer.c

index 09092af087c1505396704673d56d11261ae32434..fdeb84d97669502df52d41e2d9f296af40f4484b 100644 (file)
@@ -95,7 +95,7 @@ class _PrivateConnection(object._PrivateObject, _Connection):
                                                                 notif_types)
         _handle_status(status, 'cannot create notification iterator object')
         assert(notif_iter_ptr)
-        return bt2.notification_iterator._GenericNotificationIterator._create_from_ptr(notif_iter_ptr)
+        return bt2.notification_iterator._PrivateConnectionNotificationIterator._create_from_ptr(notif_iter_ptr)
 
     @property
     def is_ended(self):
index 2fe6ce3469ab9201288f7382d4f76214d90be428..aa36452856660fb37acee8248ae05a43371b51cb 100644 (file)
@@ -522,7 +522,7 @@ static void bt_py3_cc_port_disconnected(
        Py_XDECREF(py_method_result);
 }
 
-static struct bt_component_class_query_return bt_py3_cc_query(
+static struct bt_component_class_query_method_return bt_py3_cc_query(
                struct bt_component_class *comp_cls,
                struct bt_query_executor *query_exec,
                const char *object, struct bt_value *params)
@@ -533,7 +533,7 @@ static struct bt_component_class_query_return bt_py3_cc_query(
        PyObject *py_query_func = NULL;
        PyObject *py_object = NULL;
        PyObject *py_results_addr = NULL;
-       struct bt_component_class_query_return ret = {
+       struct bt_component_class_query_method_return ret = {
                .status = BT_QUERY_STATUS_OK,
                .result = NULL,
        };
@@ -612,7 +612,7 @@ end:
 }
 
 static enum bt_notification_iterator_status bt_py3_cc_notification_iterator_init(
-               struct bt_private_notification_iterator *priv_notif_iter,
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter,
                struct bt_private_port *priv_port)
 {
        enum bt_notification_iterator_status status =
@@ -623,7 +623,7 @@ static enum bt_notification_iterator_status bt_py3_cc_notification_iterator_init
        PyObject *py_init_method_result = NULL;
        PyObject *py_iter = NULL;
        struct bt_private_component *priv_comp =
-               bt_private_notification_iterator_get_private_component(
+               bt_private_connection_private_notification_iterator_get_private_component(
                        priv_notif_iter);
        PyObject *py_comp;
 
@@ -644,7 +644,7 @@ static enum bt_notification_iterator_status bt_py3_cc_notification_iterator_init
        }
 
        py_iter_ptr = SWIG_NewPointerObj(SWIG_as_voidptr(priv_notif_iter),
-               SWIGTYPE_p_bt_private_notification_iterator, 0);
+               SWIGTYPE_p_bt_private_connection_private_notification_iterator, 0);
        if (!py_iter_ptr) {
                BT_LOGE_STR("Failed to create a SWIG pointer object.");
                goto error;
@@ -695,10 +695,10 @@ static enum bt_notification_iterator_status bt_py3_cc_notification_iterator_init
         *         owns a native bt_notification_iterator object (iter)
         *             owns a _UserNotificationIterator instance (py_iter)
         *                 self._ptr is a borrowed reference to the
-        *                 native bt_private_notification_iterator
+        *                 native bt_private_connection_private_notification_iterator
         *                 object (iter)
         */
-       bt_private_notification_iterator_set_user_data(priv_notif_iter,
+       bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
                py_iter);
        py_iter = NULL;
        goto end;
@@ -731,10 +731,10 @@ end:
 }
 
 static void bt_py3_cc_notification_iterator_finalize(
-               struct bt_private_notification_iterator *priv_notif_iter)
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter)
 {
        PyObject *py_notif_iter =
-               bt_private_notification_iterator_get_user_data(priv_notif_iter);
+               bt_private_connection_private_notification_iterator_get_user_data(priv_notif_iter);
        PyObject *py_method_result = NULL;
 
        assert(py_notif_iter);
@@ -757,16 +757,16 @@ static void bt_py3_cc_notification_iterator_finalize(
        Py_DECREF(py_notif_iter);
 }
 
-static struct bt_notification_iterator_next_return
+static struct bt_notification_iterator_next_method_return
 bt_py3_cc_notification_iterator_next(
-                       struct bt_private_notification_iterator *priv_notif_iter)
+                       struct bt_private_connection_private_notification_iterator *priv_notif_iter)
 {
-       struct bt_notification_iterator_next_return next_ret = {
+       struct bt_notification_iterator_next_method_return next_ret = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
                .notification = NULL,
        };
        PyObject *py_notif_iter =
-               bt_private_notification_iterator_get_user_data(priv_notif_iter);
+               bt_private_connection_private_notification_iterator_get_user_data(priv_notif_iter);
        PyObject *py_method_result = NULL;
 
        assert(py_notif_iter);
index bdc7e73de7c7c1bfa6888ddb02d53788ec10807f..13cc9987ebebd7f224b4c98c1372b6c03a408a01 100644 (file)
@@ -37,21 +37,23 @@ enum bt_notification_iterator_status {
        BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED = -2,
 };
 
-/* Functions */
+/* Functions (base) */
 struct bt_notification *bt_notification_iterator_get_notification(
                struct bt_notification_iterator *iterator);
 enum bt_notification_iterator_status bt_notification_iterator_next(
                struct bt_notification_iterator *iterator);
-struct bt_component *bt_notification_iterator_get_component(
+
+/* Functions (private connection) */
+struct bt_component *bt_private_connection_notification_iterator_get_component(
                struct bt_notification_iterator *iterator);
 
 /* Helper functions for Python */
 %{
 static PyObject *bt_py3_get_user_component_from_user_notif_iter(
-               struct bt_private_notification_iterator *priv_notif_iter)
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter)
 {
        struct bt_private_component *priv_comp =
-               bt_private_notification_iterator_get_private_component(
+               bt_private_connection_private_notification_iterator_get_private_component(
                        priv_notif_iter);
        PyObject *py_comp;
 
@@ -67,4 +69,4 @@ static PyObject *bt_py3_get_user_component_from_user_notif_iter(
 %}
 
 PyObject *bt_py3_get_user_component_from_user_notif_iter(
-               struct bt_private_notification_iterator *priv_notif_iter);
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter);
index 39b6bf0e3b776dd8160342c2d49250141e25a2ec..99bc813621a78b79a81175331044ac8ee34a810d 100644 (file)
@@ -45,12 +45,6 @@ class _NotificationIterator(collections.abc.Iterator):
 
 
 class _GenericNotificationIterator(object._Object, _NotificationIterator):
-    @property
-    def component(self):
-        comp_ptr = native_bt.notification_iterator_get_component(self._ptr)
-        assert(comp_ptr)
-        return bt2.component._create_generic_component_from_ptr(comp_ptr)
-
     def _get_notif(self):
         notif_ptr = native_bt.notification_iterator_get_notification(self._ptr)
         utils._handle_ptr(notif_ptr, "cannot get notification iterator object's current notification object")
@@ -66,6 +60,14 @@ class _GenericNotificationIterator(object._Object, _NotificationIterator):
         return self._get_notif()
 
 
+class _PrivateConnectionNotificationIterator(_GenericNotificationIterator):
+    @property
+    def component(self):
+        comp_ptr = native_bt.private_connection_notification_iterator_get_component(self._ptr)
+        assert(comp_ptr)
+        return bt2.component._create_generic_component_from_ptr(comp_ptr)
+
+
 class _UserNotificationIterator(_NotificationIterator):
     def __new__(cls, ptr):
         # User iterator objects are always created by the native side,
index e115d36b4e8a727971c010866e883c89963b1d42..43a7adb1c8cd7ac344f7f7c9879e8e9e06a64221 100644 (file)
@@ -72,14 +72,15 @@ babeltracegraphinclude_HEADERS = \
        babeltrace/graph/notification-packet.h \
        babeltrace/graph/notification-stream.h \
        babeltrace/graph/port.h \
-       babeltrace/graph/query-executor.h \
        babeltrace/graph/private-component-filter.h \
        babeltrace/graph/private-component-sink.h \
        babeltrace/graph/private-component-source.h \
        babeltrace/graph/private-component.h \
+       babeltrace/graph/private-connection-notification-iterator.h \
+       babeltrace/graph/private-connection-private-notification-iterator.h \
        babeltrace/graph/private-connection.h \
-       babeltrace/graph/private-notification-iterator.h \
-       babeltrace/graph/private-port.h
+       babeltrace/graph/private-port.h \
+       babeltrace/graph/query-executor.h
 
 noinst_HEADERS = \
        babeltrace/align-internal.h \
index 02c83dc13820eeda22882e72d7b3859b350adc6d..859cb41b98c7eca0fbb227c704eca0eee0bd02ab 100644 (file)
@@ -90,8 +90,9 @@
 #include <babeltrace/graph/private-component-sink.h>
 #include <babeltrace/graph/private-component-source.h>
 #include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/private-connection-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/private-notification-iterator.h>
 #include <babeltrace/graph/private-port.h>
 #include <babeltrace/graph/query-executor.h>
 
index aa9b6c0bcfa019d2f1fe26524f8d44c5b0efefcc..b7e28c123b9403638bbc8071ef2418a8182eb406 100644 (file)
@@ -35,20 +35,20 @@ struct bt_component_class;
 
 extern
 struct bt_component_class *bt_component_class_filter_create(const char *name,
-               bt_component_class_notification_iterator_next_method notification_iterator_next_method);
+               bt_component_class_notification_iterator_next_method method);
 
 extern
 int bt_component_class_filter_set_notification_iterator_init_method(
                struct bt_component_class *component_class,
-               bt_component_class_notification_iterator_init_method notification_iterator_init_method);
+               bt_component_class_notification_iterator_init_method method);
 
 extern
 int bt_component_class_filter_set_notification_iterator_finalize_method(
                struct bt_component_class *component_class,
-               bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method);
+               bt_component_class_notification_iterator_finalize_method method);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* BABELTRACEGRAPHCOMPONENT_COMPONENT_CLASS_FILTER_H */
+#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_H */
index 95ec97068acb34c51fd52790fe63c165cfc6f687..c8f95d3187553a6266de9a73e77bbd31867b6979 100644 (file)
@@ -71,7 +71,7 @@ struct bt_component_class {
        struct bt_plugin_so_shared_lib_handle *so_handle;
 };
 
-struct bt_component_class_iterator_methods {
+struct bt_component_class_notification_iterator_methods {
        bt_component_class_notification_iterator_init_method init;
        bt_component_class_notification_iterator_finalize_method finalize;
        bt_component_class_notification_iterator_next_method next;
@@ -80,7 +80,7 @@ struct bt_component_class_iterator_methods {
 struct bt_component_class_source {
        struct bt_component_class parent;
        struct {
-               struct bt_component_class_iterator_methods iterator;
+               struct bt_component_class_notification_iterator_methods iterator;
        } methods;
 };
 
@@ -94,7 +94,7 @@ struct bt_component_class_sink {
 struct bt_component_class_filter {
        struct bt_component_class parent;
        struct {
-               struct bt_component_class_iterator_methods iterator;
+               struct bt_component_class_notification_iterator_methods iterator;
        } methods;
 };
 
index c89b44bc4790cd8ce7ca185b4fecdf56b8c7b475..dc69f03f853d848a6ffe9394b0109df00878bf30 100644 (file)
@@ -35,17 +35,17 @@ struct bt_component_class;
 
 extern
 struct bt_component_class *bt_component_class_source_create(const char *name,
-               bt_component_class_notification_iterator_next_method notification_iterator_next_method);
+               bt_component_class_notification_iterator_next_method method);
 
 extern
 int bt_component_class_source_set_notification_iterator_init_method(
                struct bt_component_class *component_class,
-               bt_component_class_notification_iterator_init_method notification_iterator_init_method);
+               bt_component_class_notification_iterator_init_method method);
 
 extern
 int bt_component_class_source_set_notification_iterator_finalize_method(
                struct bt_component_class *component_class,
-               bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method);
+               bt_component_class_notification_iterator_finalize_method method);
 
 #ifdef __cplusplus
 }
index 19f50876fee299f080cd6ff5a7e8b4191af7a7e2..a8498ee303d4c8ebd0b35ffdb1938ebd1ec1e156 100644 (file)
@@ -41,7 +41,7 @@ struct bt_private_component;
 struct bt_private_port;
 struct bt_port;
 struct bt_value;
-struct bt_private_notification_iterator;
+struct bt_private_connection_private_notification_iterator;
 struct bt_query_executor;
 
 /**
@@ -60,12 +60,12 @@ enum bt_component_class_type {
        BT_COMPONENT_CLASS_TYPE_FILTER =        2,
 };
 
-struct bt_notification_iterator_next_return {
+struct bt_notification_iterator_next_method_return {
        struct bt_notification *notification;
        enum bt_notification_iterator_status status;
 };
 
-struct bt_component_class_query_return {
+struct bt_component_class_query_method_return {
        struct bt_value *result;
        enum bt_query_status status;
 };
@@ -79,16 +79,17 @@ typedef void (*bt_component_class_finalize_method)(
 
 typedef enum bt_notification_iterator_status
                (*bt_component_class_notification_iterator_init_method)(
-               struct bt_private_notification_iterator *private_notification_iterator,
+               struct bt_private_connection_private_notification_iterator *notification_iterator,
                struct bt_private_port *private_port);
 
 typedef void (*bt_component_class_notification_iterator_finalize_method)(
-               struct bt_private_notification_iterator *private_notification_iterator);
+               struct bt_private_connection_private_notification_iterator *notification_iterator);
 
-typedef struct bt_notification_iterator_next_return (*bt_component_class_notification_iterator_next_method)(
-               struct bt_private_notification_iterator *private_notification_iterator);
+typedef struct bt_notification_iterator_next_method_return
+(*bt_component_class_notification_iterator_next_method)(
+               struct bt_private_connection_private_notification_iterator *notification_iterator);
 
-typedef struct bt_component_class_query_return (*bt_component_class_query_method)(
+typedef struct bt_component_class_query_method_return (*bt_component_class_query_method)(
                struct bt_component_class *component_class,
                struct bt_query_executor *query_executor,
                const char *object, struct bt_value *params);
@@ -109,27 +110,27 @@ typedef void (*bt_component_class_port_disconnected_method)(
 
 extern int bt_component_class_set_init_method(
                struct bt_component_class *component_class,
-               bt_component_class_init_method init_method);
+               bt_component_class_init_method method);
 
 extern int bt_component_class_set_finalize_method(
                struct bt_component_class *component_class,
-               bt_component_class_finalize_method finalize_method);
+               bt_component_class_finalize_method method);
 
 extern int bt_component_class_set_accept_port_connection_method(
                struct bt_component_class *component_class,
-               bt_component_class_accept_port_connection_method accept_port_connection_method);
+               bt_component_class_accept_port_connection_method method);
 
 extern int bt_component_class_set_port_connected_method(
                struct bt_component_class *component_class,
-               bt_component_class_port_connected_method port_connected_method);
+               bt_component_class_port_connected_method method);
 
 extern int bt_component_class_set_port_disconnected_method(
                struct bt_component_class *component_class,
-               bt_component_class_port_disconnected_method port_disconnected_method);
+               bt_component_class_port_disconnected_method method);
 
 extern int bt_component_class_set_query_method(
                struct bt_component_class *component_class,
-               bt_component_class_query_method query_method);
+               bt_component_class_query_method method);
 
 extern int bt_component_class_set_description(
                struct bt_component_class *component_class,
index 7b4d26d221911a1e4d955e611a622fd390ee692a..f99d125f77e395b4483036b17c18a375744300ae 100644 (file)
@@ -29,6 +29,7 @@
 
 #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>
@@ -82,7 +83,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 *iterator);
+               struct bt_notification_iterator_private_connection *iterator);
 
 static inline
 struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn)
index 567c47387f8136075b5bf50530e7d649cb83551d..d69ea117c13647c4ffc80ae4779605f89d854c95 100644 (file)
 #include <babeltrace/graph/connection.h>
 #include <babeltrace/graph/notification.h>
 #include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/types.h>
 #include <stdbool.h>
 
 struct bt_port;
 
-enum bt_notification_iterator_notif_type {
-       BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT =             (1U << 0),
-       BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY =        (1U << 1),
-       BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN =      (1U << 2),
-       BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END =        (1U << 3),
-       BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN =      (1U << 4),
-       BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END =        (1U << 5),
-       BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS =  (1U << 6),
-       BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS = (1U << 7),
+enum bt_notification_iterator_type {
+       BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION,
 };
 
-enum bt_notification_iterator_state {
+enum bt_private_connection_notification_iterator_notif_type {
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT =                  (1U << 0),
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY =             (1U << 1),
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN =           (1U << 2),
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END =             (1U << 3),
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN =           (1U << 4),
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END =             (1U << 5),
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS =       (1U << 6),
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS =      (1U << 7),
+};
+
+enum bt_private_connection_notification_iterator_state {
        /* Iterator is not initialized. */
-       BT_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED,
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED,
 
        /* Iterator is active, not at the end yet, and not finalized. */
-       BT_NOTIFICATION_ITERATOR_STATE_ACTIVE,
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE,
 
        /*
         * Iterator is ended, not finalized yet: the "next" method
         * returns BT_NOTIFICATION_ITERATOR_STATUS_END.
         */
-       BT_NOTIFICATION_ITERATOR_STATE_ENDED,
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED,
 
        /*
         * Iterator is finalized, but not at the end yet. This means
@@ -68,17 +72,22 @@ enum bt_notification_iterator_state {
         * before returning the BT_NOTIFICATION_ITERATOR_STATUS_CANCELED
         * status.
         */
-       BT_NOTIFICATION_ITERATOR_STATE_FINALIZED,
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED,
 
        /*
         * Iterator is finalized and ended: the "next" method always
         * returns BT_NOTIFICATION_ITERATOR_STATUS_CANCELED.
         */
-       BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED,
+       BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED,
 };
 
 struct bt_notification_iterator {
        struct bt_object base;
+       enum bt_notification_iterator_type type;
+};
+
+struct bt_notification_iterator_private_connection {
+       struct bt_notification_iterator base;
        struct bt_component *upstream_component; /* Weak */
        struct bt_port *upstream_port; /* Weak */
        struct bt_connection *connection; /* Weak */
@@ -115,44 +124,46 @@ struct bt_notification_iterator {
        /*
         * This is a mask of notifications to which the user of this
         * iterator is subscribed
-        * (see enum bt_notification_iterator_notif_type above).
+        * (see enum bt_private_connection_notification_iterator_notif_type
+        * above).
         */
        uint32_t subscription_mask;
 
-       enum bt_notification_iterator_state state;
+       enum bt_private_connection_notification_iterator_state state;
        void *user_data;
 };
 
 static inline
-struct bt_notification_iterator *bt_notification_iterator_from_private(
-               struct bt_private_notification_iterator *private_notification_iterator)
+struct bt_notification_iterator_private_connection *
+bt_private_connection_notification_iterator_from_private(
+               struct bt_private_connection_private_notification_iterator *private_notification_iterator)
 {
        return (void *) private_notification_iterator;
 }
 
 static inline
-struct bt_private_notification_iterator *
-bt_private_notification_iterator_from_notification_iterator(
-               struct bt_notification_iterator *notification_iterator)
+struct bt_private_connection_private_notification_iterator *
+bt_private_connection_private_notification_iterator_from_notification_iterator(
+               struct bt_notification_iterator_private_connection *iterator)
 {
-       return (void *) notification_iterator;
+       return (void *) iterator;
 }
 
 BT_HIDDEN
-enum bt_connection_status bt_notification_iterator_create(
+enum bt_connection_status bt_private_connection_notification_iterator_create(
                struct bt_component *upstream_comp,
                struct bt_port *upstream_port,
                const enum bt_notification_type *notification_types,
                struct bt_connection *connection,
-               struct bt_notification_iterator **iterator);
+               struct bt_notification_iterator_private_connection **iterator);
 
 BT_HIDDEN
-void bt_notification_iterator_finalize(
-               struct bt_notification_iterator *iterator);
+void bt_private_connection_notification_iterator_finalize(
+               struct bt_notification_iterator_private_connection *iterator);
 
 BT_HIDDEN
-void bt_notification_iterator_set_connection(
-               struct bt_notification_iterator *iterator,
+void bt_private_connection_notification_iterator_set_connection(
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_connection *connection);
 
 static inline
@@ -182,18 +193,18 @@ const char *bt_notification_iterator_status_string(
 };
 
 static inline
-const char *bt_notification_iterator_state_string(
-               enum bt_notification_iterator_state state)
+const char *bt_private_connection_notification_iterator_state_string(
+               enum bt_private_connection_notification_iterator_state state)
 {
        switch (state) {
-       case BT_NOTIFICATION_ITERATOR_STATE_ACTIVE:
-               return "BT_NOTIFICATION_ITERATOR_STATE_ACTIVE";
-       case BT_NOTIFICATION_ITERATOR_STATE_ENDED:
-               return "BT_NOTIFICATION_ITERATOR_STATE_ENDED";
-       case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED:
-               return "BT_NOTIFICATION_ITERATOR_STATE_FINALIZED";
-       case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
-               return "BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED";
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE:
+               return "BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE";
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED:
+               return "BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED";
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED:
+               return "BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED";
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
+               return "BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED";
        default:
                return "(unknown)";
        }
index 29d787a9c42ca2011fb76517c9382d5fc69cf85d..4d94e22c4a2ce9998ea961a08b2c77c4329b5ffc 100644 (file)
@@ -86,9 +86,6 @@ extern struct bt_notification *bt_notification_iterator_get_notification(
 extern enum bt_notification_iterator_status
 bt_notification_iterator_next(struct bt_notification_iterator *iterator);
 
-extern struct bt_component *bt_notification_iterator_get_component(
-               struct bt_notification_iterator *iterator);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/babeltrace/graph/private-connection-notification-iterator.h b/include/babeltrace/graph/private-connection-notification-iterator.h
new file mode 100644 (file)
index 0000000..6075da0
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef BABELTRACE_GRAPH_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_H
+#define BABELTRACE_GRAPH_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component;
+struct bt_notification_iterator;
+
+extern struct bt_component *bt_private_connection_notification_iterator_get_component(
+               struct bt_notification_iterator *iterator);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_H */
diff --git a/include/babeltrace/graph/private-connection-private-notification-iterator.h b/include/babeltrace/graph/private-connection-private-notification-iterator.h
new file mode 100644 (file)
index 0000000..56dc1c1
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef BABELTRACE_GRAPH_PRIVATE_CONNECTION_PRIVATE_NOTIFICATION_ITERATOR_H
+#define BABELTRACE_GRAPH_PRIVATE_CONNECTION_PRIVATE_NOTIFICATION_ITERATOR_H
+
+/*
+ * Copyright 2017 Philippe Proulx <pproulx@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
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_connection;
+struct bt_private_port;
+struct bt_private_connection;
+struct bt_private_connection_private_notification_iterator;
+
+struct bt_notification_iterator *
+bt_private_connection_notification_iterator_from_private_notification_iterator(
+               struct bt_private_connection_private_notification_iterator *private_notification_iterator);
+
+extern struct bt_private_component *
+bt_private_connection_private_notification_iterator_get_private_component(
+               struct bt_private_connection_private_notification_iterator *private_notification_iterator);
+
+extern enum bt_notification_iterator_status
+bt_private_connection_private_notification_iterator_set_user_data(
+               struct bt_private_connection_private_notification_iterator *private_notification_iterator,
+               void *user_data);
+
+extern void *bt_private_connection_private_notification_iterator_get_user_data(
+               struct bt_private_connection_private_notification_iterator *private_notification_iterator);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PRIVATE_CONNECTION_PRIVATE_NOTIFICATION_ITERATOR_H */
diff --git a/include/babeltrace/graph/private-notification-iterator.h b/include/babeltrace/graph/private-notification-iterator.h
deleted file mode 100644 (file)
index 9cc8c66..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H
-
-/*
- * Copyright 2017 Philippe Proulx <pproulx@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
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_connection;
-struct bt_private_port;
-struct bt_private_connection;
-struct bt_private_notification_iterator;
-
-struct bt_notification_iterator *
-bt_notification_iterator_from_private_notification_iterator(
-               struct bt_private_notification_iterator *private_notification_iterator);
-
-extern struct bt_private_component *
-bt_private_notification_iterator_get_private_component(
-               struct bt_private_notification_iterator *private_notification_iterator);
-
-extern enum bt_notification_iterator_status
-bt_private_notification_iterator_set_user_data(
-               struct bt_private_notification_iterator *private_notification_iterator,
-               void *user_data);
-
-extern void *bt_private_notification_iterator_get_user_data(
-               struct bt_private_notification_iterator *private_notification_iterator);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H */
index 997b3937b1d8df7d9ba6b3309970583a6fe1aba0..2e7b3c9c40d3bf5bb6d2c8bb110814e26ec5e682 100644 (file)
@@ -121,7 +121,7 @@ end:
 }
 
 struct bt_component_class *bt_component_class_source_create(const char *name,
-               bt_component_class_notification_iterator_next_method notification_iterator_next_method)
+               bt_component_class_notification_iterator_next_method method)
 {
        struct bt_component_class_source *source_class = NULL;
        int ret;
@@ -131,14 +131,14 @@ struct bt_component_class *bt_component_class_source_create(const char *name,
                goto end;
        }
 
-       if (!notification_iterator_next_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                goto end;
        }
 
        BT_LOGD("Creating source component class: "
                "name=\"%s\", notif-iter-next-method-addr=%p",
-               name, notification_iterator_next_method);
+               name, method);
        source_class = g_new0(struct bt_component_class_source, 1);
        if (!source_class) {
                BT_LOGE_STR("Failed to allocate one source component class.");
@@ -158,17 +158,17 @@ struct bt_component_class *bt_component_class_source_create(const char *name,
                goto end;
        }
 
-       source_class->methods.iterator.next = notification_iterator_next_method;
+       source_class->methods.iterator.next = method;
        BT_LOGD("Created source component class: "
                "name=\"%s\", notif-iter-next-method-addr=%p, addr=%p",
-               name, notification_iterator_next_method, &source_class->parent);
+               name, method, &source_class->parent);
 
 end:
        return &source_class->parent;
 }
 
 struct bt_component_class *bt_component_class_filter_create(const char *name,
-               bt_component_class_notification_iterator_next_method notification_iterator_next_method)
+               bt_component_class_notification_iterator_next_method method)
 {
        struct bt_component_class_filter *filter_class = NULL;
        int ret;
@@ -178,14 +178,14 @@ struct bt_component_class *bt_component_class_filter_create(const char *name,
                goto end;
        }
 
-       if (!notification_iterator_next_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                goto end;
        }
 
        BT_LOGD("Creating filter component class: "
                "name=\"%s\", notif-iter-next-method-addr=%p",
-               name, notification_iterator_next_method);
+               name, method);
        filter_class = g_new0(struct bt_component_class_filter, 1);
        if (!filter_class) {
                BT_LOGE_STR("Failed to allocate one filter component class.");
@@ -205,17 +205,17 @@ struct bt_component_class *bt_component_class_filter_create(const char *name,
                goto end;
        }
 
-       filter_class->methods.iterator.next = notification_iterator_next_method;
+       filter_class->methods.iterator.next = method;
        BT_LOGD("Created filter component class: "
                "name=\"%s\", notif-iter-next-method-addr=%p, addr=%p",
-               name, notification_iterator_next_method, &filter_class->parent);
+               name, method, &filter_class->parent);
 
 end:
        return &filter_class->parent;
 }
 
 struct bt_component_class *bt_component_class_sink_create(const char *name,
-               bt_component_class_sink_consume_method consume_method)
+               bt_component_class_sink_consume_method method)
 {
        struct bt_component_class_sink *sink_class = NULL;
        int ret;
@@ -225,14 +225,14 @@ struct bt_component_class *bt_component_class_sink_create(const char *name,
                goto end;
        }
 
-       if (!consume_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                goto end;
        }
 
        BT_LOGD("Creating sink component class: "
                "name=\"%s\", consume-method-addr=%p",
-               name, consume_method);
+               name, method);
        sink_class = g_new0(struct bt_component_class_sink, 1);
        if (!sink_class) {
                BT_LOGE_STR("Failed to allocate one sink component class.");
@@ -252,10 +252,10 @@ struct bt_component_class *bt_component_class_sink_create(const char *name,
                goto end;
        }
 
-       sink_class->methods.consume = consume_method;
+       sink_class->methods.consume = method;
        BT_LOGD("Created sink component class: "
                "name=\"%s\", consume-method-addr=%p, addr=%p",
-               name, consume_method, &sink_class->parent);
+               name, method, &sink_class->parent);
 
 end:
        return &sink_class->parent;
@@ -263,7 +263,7 @@ end:
 
 int bt_component_class_set_init_method(
                struct bt_component_class *component_class,
-               bt_component_class_init_method init_method)
+               bt_component_class_init_method method)
 {
        int ret = 0;
 
@@ -273,7 +273,7 @@ int bt_component_class_set_init_method(
                goto end;
        }
 
-       if (!init_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                ret = -1;
                goto end;
@@ -289,13 +289,13 @@ int bt_component_class_set_init_method(
                goto end;
        }
 
-       component_class->methods.init = init_method;
+       component_class->methods.init = method;
        BT_LOGV("Set component class's initialization method: "
                "addr=%p, name=\"%s\", type=%s, method-addr=%p",
                component_class,
                bt_component_class_get_name(component_class),
                bt_component_class_type_string(component_class->type),
-               init_method);
+               method);
 
 end:
        return ret;
@@ -303,7 +303,7 @@ end:
 
 int bt_component_class_set_query_method(
                struct bt_component_class *component_class,
-               bt_component_class_query_method query_method)
+               bt_component_class_query_method method)
 {
        int ret = 0;
 
@@ -313,7 +313,7 @@ int bt_component_class_set_query_method(
                goto end;
        }
 
-       if (!query_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                ret = -1;
                goto end;
@@ -329,13 +329,13 @@ int bt_component_class_set_query_method(
                goto end;
        }
 
-       component_class->methods.query = query_method;
+       component_class->methods.query = method;
        BT_LOGV("Set component class's query method: "
                "addr=%p, name=\"%s\", type=%s, method-addr=%p",
                component_class,
                bt_component_class_get_name(component_class),
                bt_component_class_type_string(component_class->type),
-               query_method);
+               method);
 
 end:
        return ret;
@@ -463,7 +463,7 @@ end:
 
 int bt_component_class_set_finalize_method(
                struct bt_component_class *component_class,
-               bt_component_class_finalize_method finalize_method)
+               bt_component_class_finalize_method method)
 {
        int ret = 0;
 
@@ -473,7 +473,7 @@ int bt_component_class_set_finalize_method(
                goto end;
        }
 
-       if (!finalize_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                ret = -1;
                goto end;
@@ -489,13 +489,13 @@ int bt_component_class_set_finalize_method(
                goto end;
        }
 
-       component_class->methods.finalize = finalize_method;
+       component_class->methods.finalize = method;
        BT_LOGV("Set component class's finalization method: "
                "addr=%p, name=\"%s\", type=%s, method-addr=%p",
                component_class,
                bt_component_class_get_name(component_class),
                bt_component_class_type_string(component_class->type),
-               finalize_method);
+               method);
 
 end:
        return ret;
@@ -503,7 +503,7 @@ end:
 
 int bt_component_class_source_set_notification_iterator_init_method(
                struct bt_component_class *component_class,
-               bt_component_class_notification_iterator_init_method notification_iterator_init_method)
+               bt_component_class_notification_iterator_init_method method)
 {
        struct bt_component_class_source *source_class;
        int ret = 0;
@@ -514,7 +514,7 @@ int bt_component_class_source_set_notification_iterator_init_method(
                goto end;
        }
 
-       if (!notification_iterator_init_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                ret = -1;
                goto end;
@@ -542,12 +542,12 @@ int bt_component_class_source_set_notification_iterator_init_method(
 
        source_class = container_of(component_class,
                struct bt_component_class_source, parent);
-       source_class->methods.iterator.init = notification_iterator_init_method;
+       source_class->methods.iterator.init = method;
        BT_LOGV("Set filter component class's notification iterator initialization method: "
                "addr=%p, name=\"%s\", method-addr=%p",
                component_class,
                bt_component_class_get_name(component_class),
-               notification_iterator_init_method);
+               method);
 
 end:
        return ret;
@@ -555,7 +555,7 @@ end:
 
 int bt_component_class_source_set_notification_iterator_finalize_method(
                struct bt_component_class *component_class,
-               bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method)
+               bt_component_class_notification_iterator_finalize_method method)
 {
        struct bt_component_class_source *source_class;
        int ret = 0;
@@ -566,7 +566,7 @@ int bt_component_class_source_set_notification_iterator_finalize_method(
                goto end;
        }
 
-       if (!notification_iterator_finalize_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                ret = -1;
                goto end;
@@ -595,12 +595,12 @@ int bt_component_class_source_set_notification_iterator_finalize_method(
        source_class = container_of(component_class,
                struct bt_component_class_source, parent);
        source_class->methods.iterator.finalize =
-               notification_iterator_finalize_method;
+               method;
        BT_LOGV("Set filter component class's notification iterator finalization method: "
                "addr=%p, name=\"%s\", method-addr=%p",
                component_class,
                bt_component_class_get_name(component_class),
-               notification_iterator_finalize_method);
+               method);
 
 end:
        return ret;
@@ -608,7 +608,7 @@ end:
 
 int bt_component_class_filter_set_notification_iterator_init_method(
                struct bt_component_class *component_class,
-               bt_component_class_notification_iterator_init_method notification_iterator_init_method)
+               bt_component_class_notification_iterator_init_method method)
 {
        struct bt_component_class_filter *filter_class;
        int ret = 0;
@@ -619,7 +619,7 @@ int bt_component_class_filter_set_notification_iterator_init_method(
                goto end;
        }
 
-       if (!notification_iterator_init_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                ret = -1;
                goto end;
@@ -647,12 +647,12 @@ int bt_component_class_filter_set_notification_iterator_init_method(
 
        filter_class = container_of(component_class,
                struct bt_component_class_filter, parent);
-       filter_class->methods.iterator.init = notification_iterator_init_method;
+       filter_class->methods.iterator.init = method;
        BT_LOGV("Set filter component class's notification iterator initialization method: "
                "addr=%p, name=\"%s\", method-addr=%p",
                component_class,
                bt_component_class_get_name(component_class),
-               notification_iterator_init_method);
+               method);
 
 end:
        return ret;
@@ -660,7 +660,7 @@ end:
 
 int bt_component_class_filter_set_notification_iterator_finalize_method(
                struct bt_component_class *component_class,
-               bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method)
+               bt_component_class_notification_iterator_finalize_method method)
 {
        struct bt_component_class_filter *filter_class;
        int ret = 0;
@@ -671,7 +671,7 @@ int bt_component_class_filter_set_notification_iterator_finalize_method(
                goto end;
        }
 
-       if (!notification_iterator_finalize_method) {
+       if (!method) {
                BT_LOGW_STR("Invalid parameter: method is NULL.");
                ret = -1;
                goto end;
@@ -700,12 +700,12 @@ int bt_component_class_filter_set_notification_iterator_finalize_method(
        filter_class = container_of(component_class,
                struct bt_component_class_filter, parent);
        filter_class->methods.iterator.finalize =
-               notification_iterator_finalize_method;
+               method;
        BT_LOGV("Set filter component class's notification iterator finalization method: "
                "addr=%p, name=\"%s\", method-addr=%p",
                component_class,
                bt_component_class_get_name(component_class),
-               notification_iterator_finalize_method);
+               method);
 
 end:
        return ret;
index 0fb9be8195ff5debd33df3e6b6db5e354cf84eae..ab5d0ad2ce6251d4d533b138cf8aa99967b7fbcc 100644 (file)
@@ -40,7 +40,7 @@
 #include <babeltrace/graph/connection-internal.h>
 #include <babeltrace/graph/graph-internal.h>
 #include <babeltrace/graph/notification-iterator-internal.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/compiler-internal.h>
 #include <babeltrace/ref.h>
index f3fbe7c0526997f2eeee5e7c4fcd70dca0d076c6..32146b132c8f86626958d6ebf03a4d442090ed40 100644 (file)
@@ -235,20 +235,20 @@ void bt_connection_end(struct bt_connection *conn,
         * notification iterator created from it.
         */
        for (i = 0; i < conn->iterators->len; i++) {
-               struct bt_notification_iterator *iterator =
+               struct bt_notification_iterator_private_connection *iterator =
                        g_ptr_array_index(conn->iterators, i);
 
                BT_LOGD("Finalizing notification iterator created by this ended connection: "
                        "conn-addr=%p, iter-addr=%p", conn, iterator);
-               bt_notification_iterator_finalize(iterator);
+               bt_private_connection_notification_iterator_finalize(iterator);
 
                /*
                 * Make sure this iterator does not try to remove itself
                 * from this connection's iterators on destruction
                 * because this connection won't exist anymore.
                 */
-               bt_notification_iterator_set_connection(iterator,
-                       NULL);
+               bt_private_connection_notification_iterator_set_connection(
+                       iterator, NULL);
        }
 
        g_ptr_array_set_size(conn->iterators, 0);
@@ -277,7 +277,7 @@ bt_private_connection_create_notification_iterator(
                struct bt_notification_iterator **user_iterator)
 {
        enum bt_component_class_type upstream_comp_class_type;
-       struct bt_notification_iterator *iterator = NULL;
+       struct bt_notification_iterator_private_connection *iterator = NULL;
        struct bt_port *upstream_port = NULL;
        struct bt_component *upstream_component = NULL;
        struct bt_component_class *upstream_comp_class = NULL;
@@ -346,7 +346,7 @@ bt_private_connection_create_notification_iterator(
                bt_component_get_class_type(upstream_component);
        assert(upstream_comp_class_type == BT_COMPONENT_CLASS_TYPE_SOURCE ||
                        upstream_comp_class_type == BT_COMPONENT_CLASS_TYPE_FILTER);
-       status = bt_notification_iterator_create(upstream_component,
+       status = bt_private_connection_notification_iterator_create(upstream_component,
                upstream_port, notification_types, connection, &iterator);
        if (status != BT_CONNECTION_STATUS_OK) {
                BT_LOGW("Cannot create notification iterator from connection.");
@@ -383,7 +383,7 @@ bt_private_connection_create_notification_iterator(
                BT_LOGD("Calling user's initialization method: iter-addr=%p",
                        iterator);
                iter_status = init_method(
-                       bt_private_notification_iterator_from_notification_iterator(iterator),
+                       bt_private_connection_private_notification_iterator_from_notification_iterator((void *) iterator),
                        bt_private_port_from_port(upstream_port));
                BT_LOGD("User method returned: status=%s",
                        bt_notification_iterator_status_string(iter_status));
@@ -395,7 +395,7 @@ bt_private_connection_create_notification_iterator(
                }
        }
 
-       iterator->state = BT_NOTIFICATION_ITERATOR_STATE_ACTIVE;
+       iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE;
        g_ptr_array_add(connection->iterators, iterator);
        BT_LOGD("Created notification iterator from connection: "
                "conn-addr=%p, upstream-port-addr=%p, "
@@ -407,7 +407,7 @@ bt_private_connection_create_notification_iterator(
                iterator);
 
        /* Move reference to user */
-       *user_iterator = iterator;
+       *user_iterator = (void *) iterator;
        iterator = NULL;
 
 end:
@@ -418,7 +418,7 @@ end:
 
 BT_HIDDEN
 void bt_connection_remove_iterator(struct bt_connection *conn,
-               struct bt_notification_iterator *iterator)
+               struct bt_notification_iterator_private_connection *iterator)
 {
        g_ptr_array_remove(conn->iterators, iterator);
        BT_LOGV("Removed notification iterator from connection: "
index 1f1f0cdd5484e91287dc06a9631e7a256c5302f9..f011373b0592918b739bd413647a11d03eee20d5 100644 (file)
@@ -126,7 +126,7 @@ struct action {
 static
 void stream_destroy_listener(struct bt_ctf_stream *stream, void *data)
 {
-       struct bt_notification_iterator *iterator = data;
+       struct bt_notification_iterator_private_connection *iterator = data;
 
        /* Remove associated stream state */
        g_hash_table_remove(iterator->stream_states, stream);
@@ -185,14 +185,14 @@ void destroy_action(struct action *action)
 }
 
 static
-void add_action(struct bt_notification_iterator *iterator,
+void add_action(struct bt_notification_iterator_private_connection *iterator,
                struct action *action)
 {
        g_array_append_val(iterator->actions, *action);
 }
 
 static
-void clear_actions(struct bt_notification_iterator *iterator)
+void clear_actions(struct bt_notification_iterator_private_connection *iterator)
 {
        size_t i;
 
@@ -230,7 +230,7 @@ const char *action_type_string(enum action_type type)
 }
 
 static
-void apply_actions(struct bt_notification_iterator *iterator)
+void apply_actions(struct bt_notification_iterator_private_connection *iterator)
 {
        size_t i;
 
@@ -358,9 +358,9 @@ end:
 }
 
 static
-void bt_notification_iterator_destroy(struct bt_object *obj)
+void bt_private_connection_notification_iterator_destroy(struct bt_object *obj)
 {
-       struct bt_notification_iterator *iterator;
+       struct bt_notification_iterator_private_connection *iterator;
 
        assert(obj);
 
@@ -375,10 +375,10 @@ void bt_notification_iterator_destroy(struct bt_object *obj)
         * would be called again.
         */
        obj->ref_count.count++;
-       iterator = container_of(obj, struct bt_notification_iterator, base);
+       iterator = (void *) container_of(obj, struct bt_notification_iterator, base);
        BT_LOGD("Destroying notification iterator object: addr=%p",
                iterator);
-       bt_notification_iterator_finalize(iterator);
+       bt_private_connection_notification_iterator_finalize(iterator);
 
        if (iterator->queue) {
                struct bt_notification *notif;
@@ -435,8 +435,8 @@ void bt_notification_iterator_destroy(struct bt_object *obj)
 }
 
 BT_HIDDEN
-void bt_notification_iterator_finalize(
-               struct bt_notification_iterator *iterator)
+void bt_private_connection_notification_iterator_finalize(
+               struct bt_notification_iterator_private_connection *iterator)
 {
        struct bt_component_class *comp_class = NULL;
        bt_component_class_notification_iterator_finalize_method
@@ -445,13 +445,13 @@ void bt_notification_iterator_finalize(
        assert(iterator);
 
        switch (iterator->state) {
-       case BT_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED:
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED:
                /* Skip user finalization if user initialization failed */
                BT_LOGD("Not finalizing non-initialized notification iterator: "
                        "addr=%p", iterator);
                return;
-       case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED:
-       case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED:
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
                /* Already finalized */
                BT_LOGD("Not finalizing notification iterator: already finalized: "
                        "addr=%p", iterator);
@@ -462,14 +462,14 @@ void bt_notification_iterator_finalize(
 
        BT_LOGD("Finalizing notification iterator: addr=%p", iterator);
 
-       if (iterator->state == BT_NOTIFICATION_ITERATOR_STATE_ENDED) {
+       if (iterator->state == BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED) {
                BT_LOGD("Updating notification iterator's state: "
-                       "new-state=BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED");
-               iterator->state = BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED;
+                       "new-state=BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED");
+               iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED;
        } else {
                BT_LOGD("Updating notification iterator's state: "
-                       "new-state=BT_NOTIFICATION_ITERATOR_STATE_FINALIZED");
-               iterator->state = BT_NOTIFICATION_ITERATOR_STATE_FINALIZED;
+                       "new-state=BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED");
+               iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED;
        }
 
        assert(iterator->upstream_component);
@@ -502,7 +502,7 @@ void bt_notification_iterator_finalize(
                BT_LOGD("Calling user's finalization method: addr=%p",
                        iterator);
                finalize_method(
-                       bt_private_notification_iterator_from_notification_iterator(iterator));
+                       bt_private_connection_private_notification_iterator_from_notification_iterator(iterator));
        }
 
        iterator->upstream_component = NULL;
@@ -511,8 +511,8 @@ void bt_notification_iterator_finalize(
 }
 
 BT_HIDDEN
-void bt_notification_iterator_set_connection(
-               struct bt_notification_iterator *iterator,
+void bt_private_connection_notification_iterator_set_connection(
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_connection *connection)
 {
        assert(iterator);
@@ -523,7 +523,7 @@ void bt_notification_iterator_set_connection(
 
 static
 int create_subscription_mask_from_notification_types(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                const enum bt_notification_type *notif_types)
 {
        const enum bt_notification_type *notif_type;
@@ -538,38 +538,38 @@ int create_subscription_mask_from_notification_types(
                switch (*notif_type) {
                case BT_NOTIFICATION_TYPE_ALL:
                        iterator->subscription_mask |=
-                               BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT |
-                               BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY |
-                               BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN |
-                               BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END |
-                               BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN |
-                               BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END |
-                               BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS |
-                               BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
+                               BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT |
+                               BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY |
+                               BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN |
+                               BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END |
+                               BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN |
+                               BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END |
+                               BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS |
+                               BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
                        break;
                case BT_NOTIFICATION_TYPE_EVENT:
-                       iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT;
+                       iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT;
                        break;
                case BT_NOTIFICATION_TYPE_INACTIVITY:
-                       iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY;
+                       iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY;
                        break;
                case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
-                       iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN;
+                       iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN;
                        break;
                case BT_NOTIFICATION_TYPE_STREAM_END:
-                       iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END;
+                       iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END;
                        break;
                case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
-                       iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN;
+                       iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN;
                        break;
                case BT_NOTIFICATION_TYPE_PACKET_END:
-                       iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END;
+                       iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END;
                        break;
                case BT_NOTIFICATION_TYPE_DISCARDED_EVENTS:
-                       iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS;
+                       iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS;
                        break;
                case BT_NOTIFICATION_TYPE_DISCARDED_PACKETS:
-                       iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
+                       iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
                        break;
                default:
                        ret = -1;
@@ -586,17 +586,26 @@ end:
        return ret;
 }
 
+static
+void init_notification_iterator(struct bt_notification_iterator *iterator,
+               enum bt_notification_iterator_type type,
+               bt_object_release_func destroy)
+{
+       bt_object_init(iterator, destroy);
+       iterator->type = type;
+}
+
 BT_HIDDEN
-enum bt_connection_status bt_notification_iterator_create(
+enum bt_connection_status bt_private_connection_notification_iterator_create(
                struct bt_component *upstream_comp,
                struct bt_port *upstream_port,
                const enum bt_notification_type *notification_types,
                struct bt_connection *connection,
-               struct bt_notification_iterator **user_iterator)
+               struct bt_notification_iterator_private_connection **user_iterator)
 {
        enum bt_connection_status status = BT_CONNECTION_STATUS_OK;
        enum bt_component_class_type type;
-       struct bt_notification_iterator *iterator = NULL;
+       struct bt_notification_iterator_private_connection *iterator = NULL;
 
        assert(upstream_comp);
        assert(upstream_port);
@@ -613,14 +622,16 @@ enum bt_connection_status bt_notification_iterator_create(
        type = bt_component_get_class_type(upstream_comp);
        assert(type == BT_COMPONENT_CLASS_TYPE_SOURCE ||
                type == BT_COMPONENT_CLASS_TYPE_FILTER);
-       iterator = g_new0(struct bt_notification_iterator, 1);
+       iterator = g_new0(struct bt_notification_iterator_private_connection, 1);
        if (!iterator) {
                BT_LOGE_STR("Failed to allocate one notification iterator.");
                status = BT_CONNECTION_STATUS_NOMEM;
                goto end;
        }
 
-       bt_object_init(iterator, bt_notification_iterator_destroy);
+       init_notification_iterator((void *) iterator,
+               BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION,
+               bt_private_connection_notification_iterator_destroy);
 
        if (create_subscription_mask_from_notification_types(iterator,
                        notification_types)) {
@@ -654,7 +665,7 @@ enum bt_connection_status bt_notification_iterator_create(
        iterator->upstream_component = upstream_comp;
        iterator->upstream_port = upstream_port;
        iterator->connection = connection;
-       iterator->state = BT_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED;
+       iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED;
        BT_LOGD("Created notification iterator: "
                "upstream-comp-addr=%p, upstream-comp-name=\"%s\", "
                "upstream-port-addr=%p, upstream-port-name=\"%s\", "
@@ -672,24 +683,24 @@ end:
        return status;
 }
 
-void *bt_private_notification_iterator_get_user_data(
-               struct bt_private_notification_iterator *private_iterator)
+void *bt_private_connection_private_notification_iterator_get_user_data(
+               struct bt_private_connection_private_notification_iterator *private_iterator)
 {
-       struct bt_notification_iterator *iterator =
-               bt_notification_iterator_from_private(private_iterator);
+       struct bt_notification_iterator_private_connection *iterator =
+               bt_private_connection_notification_iterator_from_private(private_iterator);
 
        return iterator ? iterator->user_data : NULL;
 }
 
 enum bt_notification_iterator_status
-bt_private_notification_iterator_set_user_data(
-               struct bt_private_notification_iterator *private_iterator,
+bt_private_connection_private_notification_iterator_set_user_data(
+               struct bt_private_connection_private_notification_iterator *private_iterator,
                void *data)
 {
        enum bt_notification_iterator_status ret =
                        BT_NOTIFICATION_ITERATOR_STATUS_OK;
-       struct bt_notification_iterator *iterator =
-               bt_notification_iterator_from_private(private_iterator);
+       struct bt_notification_iterator_private_connection *iterator =
+               bt_private_connection_notification_iterator_from_private(private_iterator);
 
        if (!iterator) {
                BT_LOGW_STR("Invalid parameter: notification iterator is NULL.");
@@ -715,43 +726,56 @@ struct bt_notification *bt_notification_iterator_get_notification(
                goto end;
        }
 
-       notification = bt_get(iterator->current_notification);
+       switch (iterator->type) {
+       case BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION:
+       {
+               struct bt_notification_iterator_private_connection *priv_conn_iter =
+                       (void *) iterator;
+
+               notification = bt_get(priv_conn_iter->current_notification);
+               break;
+       }
+       default:
+               BT_LOGF("Unknown notification iterator type: addr=%p, type=%d",
+                       iterator, iterator->type);
+               abort();
+       }
 
 end:
        return notification;
 }
 
 static
-enum bt_notification_iterator_notif_type
+enum bt_private_connection_notification_iterator_notif_type
 bt_notification_iterator_notif_type_from_notif_type(
                enum bt_notification_type notif_type)
 {
-       enum bt_notification_iterator_notif_type iter_notif_type;
+       enum bt_private_connection_notification_iterator_notif_type iter_notif_type;
 
        switch (notif_type) {
        case BT_NOTIFICATION_TYPE_EVENT:
-               iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT;
+               iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT;
                break;
        case BT_NOTIFICATION_TYPE_INACTIVITY:
-               iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY;
+               iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY;
                break;
        case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
-               iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN;
+               iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN;
                break;
        case BT_NOTIFICATION_TYPE_STREAM_END:
-               iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END;
+               iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END;
                break;
        case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
-               iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN;
+               iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN;
                break;
        case BT_NOTIFICATION_TYPE_PACKET_END:
-               iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END;
+               iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END;
                break;
        case BT_NOTIFICATION_TYPE_DISCARDED_EVENTS:
-               iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS;
+               iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS;
                break;
        case BT_NOTIFICATION_TYPE_DISCARDED_PACKETS:
-               iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
+               iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
                break;
        default:
                abort();
@@ -761,7 +785,8 @@ bt_notification_iterator_notif_type_from_notif_type(
 }
 
 static
-bt_bool validate_notification(struct bt_notification_iterator *iterator,
+bt_bool validate_notification(
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *notif,
                struct bt_ctf_stream *notif_stream,
                struct bt_ctf_packet *notif_packet)
@@ -880,7 +905,8 @@ end:
 }
 
 static
-bt_bool is_subscribed_to_notification_type(struct bt_notification_iterator *iterator,
+bt_bool is_subscribed_to_notification_type(
+               struct bt_notification_iterator_private_connection *iterator,
                enum bt_notification_type notif_type)
 {
        uint32_t iter_notif_type =
@@ -891,7 +917,8 @@ bt_bool is_subscribed_to_notification_type(struct bt_notification_iterator *iter
 }
 
 static
-void add_action_push_notif(struct bt_notification_iterator *iterator,
+void add_action_push_notif(
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *notif)
 {
        struct action action = {
@@ -911,7 +938,7 @@ void add_action_push_notif(struct bt_notification_iterator *iterator,
 
 static
 int add_action_push_notif_stream_begin(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_ctf_stream *stream)
 {
        int ret = 0;
@@ -948,7 +975,7 @@ end:
 
 static
 int add_action_push_notif_stream_end(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_ctf_stream *stream)
 {
        int ret = 0;
@@ -985,7 +1012,7 @@ end:
 
 static
 int add_action_push_notif_packet_begin(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_ctf_packet *packet)
 {
        int ret = 0;
@@ -1021,7 +1048,7 @@ end:
 
 static
 int add_action_push_notif_packet_end(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_ctf_packet *packet)
 {
        int ret = 0;
@@ -1057,7 +1084,7 @@ end:
 
 static
 void add_action_set_stream_state_is_ended(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct stream_state *stream_state)
 {
        struct action action = {
@@ -1075,7 +1102,7 @@ void add_action_set_stream_state_is_ended(
 
 static
 void add_action_set_stream_state_cur_packet(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct stream_state *stream_state,
                struct bt_ctf_packet *packet)
 {
@@ -1096,7 +1123,7 @@ void add_action_set_stream_state_cur_packet(
 
 static
 void add_action_update_stream_state_discarded_elements(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                enum action_type type,
                struct stream_state *stream_state,
                struct bt_ctf_clock_value *cur_begin,
@@ -1127,7 +1154,8 @@ void add_action_update_stream_state_discarded_elements(
 }
 
 static
-int ensure_stream_state_exists(struct bt_notification_iterator *iterator,
+int ensure_stream_state_exists(
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *stream_begin_notif,
                struct bt_ctf_stream *notif_stream,
                struct stream_state **_stream_state)
@@ -1304,7 +1332,8 @@ end:
 }
 
 static
-int handle_discarded_packets(struct bt_notification_iterator *iterator,
+int handle_discarded_packets(
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_ctf_packet *packet,
                struct bt_ctf_clock_value *ts_begin,
                struct bt_ctf_clock_value *ts_end,
@@ -1378,7 +1407,8 @@ end:
 }
 
 static
-int handle_discarded_events(struct bt_notification_iterator *iterator,
+int handle_discarded_events(
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_ctf_packet *packet,
                struct bt_ctf_clock_value *ts_begin,
                struct bt_ctf_clock_value *ts_end,
@@ -1538,7 +1568,8 @@ end:
 }
 
 static
-int handle_discarded_elements(struct bt_notification_iterator *iterator,
+int handle_discarded_elements(
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_ctf_packet *packet, struct stream_state *stream_state)
 {
        struct bt_ctf_clock_value *ts_begin = NULL;
@@ -1578,7 +1609,8 @@ end:
 }
 
 static
-int handle_packet_switch(struct bt_notification_iterator *iterator,
+int handle_packet_switch(
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *packet_begin_notif,
                struct bt_ctf_packet *new_packet,
                struct stream_state *stream_state)
@@ -1638,7 +1670,7 @@ end:
 
 static
 int handle_notif_stream_begin(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *notif,
                struct bt_ctf_stream *notif_stream)
 {
@@ -1665,7 +1697,7 @@ end:
 
 static
 int handle_notif_stream_end(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *notif,
                struct bt_ctf_stream *notif_stream)
 {
@@ -1700,7 +1732,7 @@ end:
 
 static
 int handle_notif_discarded_elements(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *notif,
                struct bt_ctf_stream *notif_stream)
 {
@@ -1729,7 +1761,7 @@ end:
 
 static
 int handle_notif_packet_begin(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *notif,
                struct bt_ctf_stream *notif_stream,
                struct bt_ctf_packet *notif_packet)
@@ -1763,7 +1795,7 @@ end:
 
 static
 int handle_notif_packet_end(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *notif,
                struct bt_ctf_stream *notif_stream,
                struct bt_ctf_packet *notif_packet)
@@ -1800,7 +1832,7 @@ end:
 
 static
 int handle_notif_event(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *notif,
                struct bt_ctf_stream *notif_stream,
                struct bt_ctf_packet *notif_packet)
@@ -1835,7 +1867,7 @@ end:
 
 static
 int enqueue_notification_and_automatic(
-               struct bt_notification_iterator *iterator,
+               struct bt_notification_iterator_private_connection *iterator,
                struct bt_notification *notif)
 {
        int ret = 0;
@@ -1962,7 +1994,7 @@ end:
 }
 
 static
-int handle_end(struct bt_notification_iterator *iterator)
+int handle_end(struct bt_notification_iterator_private_connection *iterator)
 {
        GHashTableIter stream_state_iter;
        gpointer stream_gptr, stream_state_gptr;
@@ -2014,12 +2046,12 @@ end:
 
 static
 enum bt_notification_iterator_status ensure_queue_has_notifications(
-               struct bt_notification_iterator *iterator)
+               struct bt_notification_iterator_private_connection *iterator)
 {
-       struct bt_private_notification_iterator *priv_iterator =
-               bt_private_notification_iterator_from_notification_iterator(iterator);
+       struct bt_private_connection_private_notification_iterator *priv_iterator =
+               bt_private_connection_private_notification_iterator_from_notification_iterator(iterator);
        bt_component_class_notification_iterator_next_method next_method = NULL;
-       struct bt_notification_iterator_next_return next_return = {
+       struct bt_notification_iterator_next_method_return next_return = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
                .notification = NULL,
        };
@@ -2031,7 +2063,7 @@ enum bt_notification_iterator_status ensure_queue_has_notifications(
        BT_LOGD("Ensuring that notification iterator's queue has at least one notification: "
                "iter-addr=%p, queue-size=%u, iter-state=%s",
                iterator, iterator->queue->length,
-               bt_notification_iterator_state_string(iterator->state));
+               bt_private_connection_notification_iterator_state_string(iterator->state));
 
        if (iterator->queue->length > 0) {
                /*
@@ -2046,12 +2078,12 @@ enum bt_notification_iterator_status ensure_queue_has_notifications(
        }
 
        switch (iterator->state) {
-       case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
-       case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED:
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED:
                BT_LOGD_STR("Notification iterator's \"next\" called, but it is finalized.");
                status = BT_NOTIFICATION_ITERATOR_STATUS_CANCELED;
                goto end;
-       case BT_NOTIFICATION_ITERATOR_STATE_ENDED:
+       case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED:
                BT_LOGD_STR("Notification iterator is ended.");
                status = BT_NOTIFICATION_ITERATOR_STATUS_END;
                goto end;
@@ -2105,8 +2137,8 @@ enum bt_notification_iterator_status ensure_queue_has_notifications(
                        goto end;
                }
 
-               if (iterator->state == BT_NOTIFICATION_ITERATOR_STATE_FINALIZED ||
-                               iterator->state == BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED) {
+               if (iterator->state == BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED ||
+                               iterator->state == BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED) {
                        /*
                         * The user's "next" method, somehow, cancelled
                         * its own notification iterator. This can
@@ -2141,8 +2173,8 @@ enum bt_notification_iterator_status ensure_queue_has_notifications(
                        }
 
                        assert(iterator->state ==
-                               BT_NOTIFICATION_ITERATOR_STATE_ACTIVE);
-                       iterator->state = BT_NOTIFICATION_ITERATOR_STATE_ENDED;
+                               BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE);
+                       iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED;
 
                        if (iterator->queue->length == 0) {
                                status = BT_NOTIFICATION_ITERATOR_STATUS_END;
@@ -2215,40 +2247,70 @@ bt_notification_iterator_next(struct bt_notification_iterator *iterator)
 
        BT_LOGD("Notification iterator's \"next\": iter-addr=%p", iterator);
 
-       /*
-        * Make sure that the iterator's queue contains at least one
-        * notification.
-        */
-       status = ensure_queue_has_notifications(iterator);
-       if (status != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
-               /* Not an error */
-               goto end;
-       }
+       switch (iterator->type) {
+       case BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION:
+       {
+               struct bt_notification_iterator_private_connection *priv_conn_iter =
+                       (void *) iterator;
 
-       /*
-        * Move the notification at the tail of the queue to the
-        * iterator's current notification.
-        */
-       assert(iterator->queue->length > 0);
-       bt_put(iterator->current_notification);
-       iterator->current_notification = g_queue_pop_tail(iterator->queue);
-       assert(iterator->current_notification);
+               /*
+                * Make sure that the iterator's queue contains at least
+                * one notification.
+                */
+               status = ensure_queue_has_notifications(priv_conn_iter);
+               if (status != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
+                       goto end;
+               }
+
+               /*
+                * Move the notification at the tail of the queue to the
+                * iterator's current notification.
+                */
+               assert(priv_conn_iter->queue->length > 0);
+               bt_put(priv_conn_iter->current_notification);
+               priv_conn_iter->current_notification =
+                       g_queue_pop_tail(priv_conn_iter->queue);
+               assert(priv_conn_iter->current_notification);
+               break;
+       }
+       default:
+               BT_LOGF("Unknown notification iterator type: addr=%p, type=%d",
+                       iterator, iterator->type);
+               abort();
+       }
 
 end:
        return status;
 }
 
-struct bt_component *bt_notification_iterator_get_component(
+struct bt_component *bt_private_connection_notification_iterator_get_component(
                struct bt_notification_iterator *iterator)
 {
-       return bt_get(iterator->upstream_component);
+       struct bt_component *comp = NULL;
+       struct bt_notification_iterator_private_connection *iter_priv_conn;
+
+       if (!iterator) {
+               BT_LOGW_STR("Invalid parameter: notification iterator is NULL.");
+               goto end;
+       }
+
+       if (iterator->type != BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION) {
+               BT_LOGW_STR("Invalid parameter: notification iterator was not created from a private connection.");
+               goto end;
+       }
+
+       iter_priv_conn = (void *) iterator;
+       comp = bt_get(iter_priv_conn->upstream_component);
+
+end:
+       return comp;
 }
 
 struct bt_private_component *
-bt_private_notification_iterator_get_private_component(
-               struct bt_private_notification_iterator *private_iterator)
+bt_private_connection_private_notification_iterator_get_private_component(
+               struct bt_private_connection_private_notification_iterator *private_iterator)
 {
        return bt_private_component_from_component(
-               bt_notification_iterator_get_component(
-                       bt_notification_iterator_from_private(private_iterator)));
+               bt_private_connection_notification_iterator_get_component(
+                       (void *) bt_private_connection_notification_iterator_from_private(private_iterator)));
 }
index f1cd95b6c878095421bc46523ffe305496c7b67e..89ae9a11c39712f28fbdc194b41fe0ef0dff79ac 100644 (file)
@@ -65,7 +65,7 @@ enum bt_query_status bt_query_executor_query(
                const char *object, struct bt_value *params,
                struct bt_value **user_result)
 {
-       struct bt_component_class_query_return ret = {
+       struct bt_component_class_query_method_return ret = {
                .result = NULL,
                .status = BT_QUERY_STATUS_OK,
        };
index 1d0425ba7c20392fdda38a12316a4211715ca20e..d21a30c9846db8020b89d35be7d4e76d261c4ccf 100644 (file)
@@ -282,7 +282,7 @@ enum bt_plugin_status bt_plugin_so_init(
                bt_component_class_accept_port_connection_method accept_port_connection_method;
                bt_component_class_port_connected_method port_connected_method;
                bt_component_class_port_disconnected_method port_disconnected_method;
-               struct bt_component_class_iterator_methods iterator_methods;
+               struct bt_component_class_notification_iterator_methods iterator_methods;
        };
 
        enum bt_plugin_status status = BT_PLUGIN_STATUS_OK;
index 5dfdf8e03d4bc831855f4e98b49481edd9aaab1b..39c2530e82987307176658dc8ae67ef2c734de1e 100644 (file)
@@ -847,11 +847,11 @@ void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *ds_file)
 }
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return ctf_fs_ds_file_next(
+struct bt_notification_iterator_next_method_return ctf_fs_ds_file_next(
                struct ctf_fs_ds_file *ds_file)
 {
        enum bt_ctf_notif_iter_status notif_iter_status;
-       struct bt_notification_iterator_next_return ret = {
+       struct bt_notification_iterator_next_method_return ret = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR,
                .notification = NULL,
        };
index 1d3e51e68385e70a8c5b4afcdd0d0f3985a02941..8c859e77472312a9edfa102824fdfd03bbb8aae2 100644 (file)
@@ -136,7 +136,7 @@ BT_HIDDEN
 void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream);
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return ctf_fs_ds_file_next(
+struct bt_notification_iterator_next_method_return ctf_fs_ds_file_next(
                struct ctf_fs_ds_file *stream);
 
 BT_HIDDEN
index e36a70c4a7fe8fcfa9a543b6568d269d97d35962..c97013eae7b3eb76a4719c5e2c44c40700e73b1a 100644 (file)
@@ -33,7 +33,7 @@
 #include <babeltrace/graph/private-port.h>
 #include <babeltrace/graph/private-component.h>
 #include <babeltrace/graph/private-component-source.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/graph/component.h>
 #include <babeltrace/graph/notification-iterator.h>
 #include <babeltrace/graph/clock-class-priority-map.h>
@@ -96,12 +96,12 @@ void ctf_fs_notif_iter_data_destroy(
        g_free(notif_iter_data);
 }
 
-struct bt_notification_iterator_next_return ctf_fs_iterator_next(
-               struct bt_private_notification_iterator *iterator)
+struct bt_notification_iterator_next_method_return ctf_fs_iterator_next(
+               struct bt_private_connection_private_notification_iterator *iterator)
 {
-       struct bt_notification_iterator_next_return next_ret;
+       struct bt_notification_iterator_next_method_return next_ret;
        struct ctf_fs_notif_iter_data *notif_iter_data =
-               bt_private_notification_iterator_get_user_data(iterator);
+               bt_private_connection_private_notification_iterator_get_user_data(iterator);
        int ret;
 
        assert(notif_iter_data->ds_file);
@@ -146,16 +146,16 @@ end:
        return next_ret;
 }
 
-void ctf_fs_iterator_finalize(struct bt_private_notification_iterator *it)
+void ctf_fs_iterator_finalize(struct bt_private_connection_private_notification_iterator *it)
 {
        void *notif_iter_data =
-               bt_private_notification_iterator_get_user_data(it);
+               bt_private_connection_private_notification_iterator_get_user_data(it);
 
        ctf_fs_notif_iter_data_destroy(notif_iter_data);
 }
 
 enum bt_notification_iterator_status ctf_fs_iterator_init(
-               struct bt_private_notification_iterator *it,
+               struct bt_private_connection_private_notification_iterator *it,
                struct bt_private_port *port)
 {
        struct ctf_fs_port_data *port_data;
@@ -193,7 +193,7 @@ enum bt_notification_iterator_status ctf_fs_iterator_init(
                goto error;
        }
 
-       ret = bt_private_notification_iterator_set_user_data(it, notif_iter_data);
+       ret = bt_private_connection_private_notification_iterator_set_user_data(it, notif_iter_data);
        if (ret != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
                goto error;
        }
@@ -202,7 +202,7 @@ enum bt_notification_iterator_status ctf_fs_iterator_init(
        goto end;
 
 error:
-       (void) bt_private_notification_iterator_set_user_data(it, NULL);
+       (void) bt_private_connection_private_notification_iterator_set_user_data(it, NULL);
 
 end:
        ctf_fs_notif_iter_data_destroy(notif_iter_data);
@@ -1365,12 +1365,12 @@ enum bt_component_status ctf_fs_init(struct bt_private_component *priv_comp,
 }
 
 BT_HIDDEN
-struct bt_component_class_query_return ctf_fs_query(
+struct bt_component_class_query_method_return ctf_fs_query(
                struct bt_component_class *comp_class,
                struct bt_query_executor *query_exec,
                const char *object, struct bt_value *params)
 {
-       struct bt_component_class_query_return ret = {
+       struct bt_component_class_query_method_return ret = {
                .result = NULL,
                .status = BT_QUERY_STATUS_OK,
        };
index 46fa9d8c5c44c319489a7c3f821276ddb249b553..f5eaabb8f739cfc5d6912f42e90eb1ea8e7298cc 100644 (file)
@@ -142,7 +142,7 @@ BT_HIDDEN
 void ctf_fs_finalize(struct bt_private_component *component);
 
 BT_HIDDEN
-struct bt_component_class_query_return ctf_fs_query(
+struct bt_component_class_query_method_return ctf_fs_query(
                struct bt_component_class *comp_class,
                struct bt_query_executor *query_exec,
                const char *object, struct bt_value *params);
@@ -162,13 +162,13 @@ GList *ctf_fs_create_trace_names(GList *trace_paths, const char *base_path);
 
 BT_HIDDEN
 enum bt_notification_iterator_status ctf_fs_iterator_init(
-               struct bt_private_notification_iterator *it,
+               struct bt_private_connection_private_notification_iterator *it,
                struct bt_private_port *port);
 BT_HIDDEN
-void ctf_fs_iterator_finalize(struct bt_private_notification_iterator *it);
+void ctf_fs_iterator_finalize(struct bt_private_connection_private_notification_iterator *it);
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return ctf_fs_iterator_next(
-               struct bt_private_notification_iterator *iterator);
+struct bt_notification_iterator_next_method_return ctf_fs_iterator_next(
+               struct bt_private_connection_private_notification_iterator *iterator);
 
 #endif /* BABELTRACE_PLUGIN_CTF_FS_H */
index 696d3d43e297b4c2f6eeb31ff18577c103972760..2b5171af992953361d98d301e36648b161bb31d2 100644 (file)
@@ -46,11 +46,11 @@ struct range {
 };
 
 BT_HIDDEN
-struct bt_component_class_query_return metadata_info_query(
+struct bt_component_class_query_method_return metadata_info_query(
                struct bt_component_class *comp_class,
                struct bt_value *params)
 {
-       struct bt_component_class_query_return query_ret = {
+       struct bt_component_class_query_method_return query_ret = {
                .result = NULL,
                .status = BT_QUERY_STATUS_OK,
        };
@@ -458,11 +458,11 @@ end:
 }
 
 BT_HIDDEN
-struct bt_component_class_query_return trace_info_query(
+struct bt_component_class_query_method_return trace_info_query(
                struct bt_component_class *comp_class,
                struct bt_value *params)
 {
-       struct bt_component_class_query_return query_ret = {
+       struct bt_component_class_query_method_return query_ret = {
                .result = NULL,
                .status = BT_QUERY_STATUS_OK,
        };
index fff036c63403d1ada27ef6739f3b1191174a75ef..5db579dee1618074ff1786f935a50672e3fbc388 100644 (file)
 #include <babeltrace/graph/component-class.h>
 
 BT_HIDDEN
-struct bt_component_class_query_return metadata_info_query(
+struct bt_component_class_query_method_return metadata_info_query(
                struct bt_component_class *comp_class,
                struct bt_value *params);
 
 BT_HIDDEN
-struct bt_component_class_query_return trace_info_query(
+struct bt_component_class_query_method_return trace_info_query(
                struct bt_component_class *comp_class,
                struct bt_value *params);
 
index bf94314e6dfcd63be84d1d26e0c3f1286a56836d..dcbc9853f35206833e2214a05b59dc2986524a0b 100644 (file)
@@ -215,15 +215,15 @@ enum bt_ctf_lttng_live_iterator_status {
 enum bt_component_status lttng_live_component_init(struct bt_private_component *source,
                struct bt_value *params, void *init_method_data);
 
-struct bt_component_class_query_return lttng_live_query(
+struct bt_component_class_query_method_return lttng_live_query(
                struct bt_component_class *comp_class,
                struct bt_query_executor *query_exec,
                const char *object, struct bt_value *params);
 
 void lttng_live_component_finalize(struct bt_private_component *component);
 
-struct bt_notification_iterator_next_return lttng_live_iterator_next(
-        struct bt_private_notification_iterator *iterator);
+struct bt_notification_iterator_next_method_return lttng_live_iterator_next(
+        struct bt_private_connection_private_notification_iterator *iterator);
 
 enum bt_component_status lttng_live_accept_port_connection(
                struct bt_private_component *private_component,
@@ -231,10 +231,10 @@ enum bt_component_status lttng_live_accept_port_connection(
                struct bt_port *other_port);
 
 enum bt_notification_iterator_status lttng_live_iterator_init(
-               struct bt_private_notification_iterator *it,
+               struct bt_private_connection_private_notification_iterator *it,
                struct bt_private_port *port);
 
-void lttng_live_iterator_finalize(struct bt_private_notification_iterator *it);
+void lttng_live_iterator_finalize(struct bt_private_connection_private_notification_iterator *it);
 
 int lttng_live_create_viewer_session(struct lttng_live_component *lttng_live);
 int lttng_live_attach_session(struct lttng_live_session *session);
index c3e7b641c4a52311644e5d09738d91226607c9d4..c882ce9513344ec85177483d07afc93acec13aa0 100644 (file)
@@ -36,7 +36,7 @@
 #include <babeltrace/graph/port.h>
 #include <babeltrace/graph/private-component.h>
 #include <babeltrace/graph/private-component-source.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/graph/notification-stream.h>
 #include <babeltrace/graph/notification-packet.h>
 #include <babeltrace/graph/notification-event.h>
@@ -352,10 +352,10 @@ void lttng_live_destroy_session(struct lttng_live_session *session)
 }
 
 BT_HIDDEN
-void lttng_live_iterator_finalize(struct bt_private_notification_iterator *it)
+void lttng_live_iterator_finalize(struct bt_private_connection_private_notification_iterator *it)
 {
        struct lttng_live_stream_iterator_generic *s =
-                       bt_private_notification_iterator_get_user_data(it);
+                       bt_private_connection_private_notification_iterator_get_user_data(it);
 
        switch (s->type) {
        case LIVE_STREAM_TYPE_NO_STREAM:
@@ -768,12 +768,12 @@ enum bt_ctf_lttng_live_iterator_status lttng_live_iterator_next_handle_one_activ
  * When disconnected from relayd: try to re-connect endlessly.
  */
 static
-struct bt_notification_iterator_next_return lttng_live_iterator_next_stream(
-               struct bt_private_notification_iterator *iterator,
+struct bt_notification_iterator_next_method_return lttng_live_iterator_next_stream(
+               struct bt_private_connection_private_notification_iterator *iterator,
                struct lttng_live_stream_iterator *stream_iter)
 {
        enum bt_ctf_lttng_live_iterator_status status;
-       struct bt_notification_iterator_next_return next_return;
+       struct bt_notification_iterator_next_method_return next_return;
        struct lttng_live_component *lttng_live;
 
        lttng_live = stream_iter->trace->session->lttng_live;
@@ -839,12 +839,12 @@ end:
 }
 
 static
-struct bt_notification_iterator_next_return lttng_live_iterator_next_no_stream(
-               struct bt_private_notification_iterator *iterator,
+struct bt_notification_iterator_next_method_return lttng_live_iterator_next_no_stream(
+               struct bt_private_connection_private_notification_iterator *iterator,
                struct lttng_live_no_stream_iterator *no_stream_iter)
 {
        enum bt_ctf_lttng_live_iterator_status status;
-       struct bt_notification_iterator_next_return next_return;
+       struct bt_notification_iterator_next_method_return next_return;
        struct lttng_live_component *lttng_live;
 
        lttng_live = no_stream_iter->lttng_live;
@@ -888,12 +888,12 @@ end:
 }
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return lttng_live_iterator_next(
-               struct bt_private_notification_iterator *iterator)
+struct bt_notification_iterator_next_method_return lttng_live_iterator_next(
+               struct bt_private_connection_private_notification_iterator *iterator)
 {
        struct lttng_live_stream_iterator_generic *s =
-                       bt_private_notification_iterator_get_user_data(iterator);
-       struct bt_notification_iterator_next_return next_return;
+                       bt_private_connection_private_notification_iterator_get_user_data(iterator);
+       struct bt_notification_iterator_next_method_return next_return;
 
        switch (s->type) {
        case LIVE_STREAM_TYPE_NO_STREAM:
@@ -913,7 +913,7 @@ struct bt_notification_iterator_next_return lttng_live_iterator_next(
 
 BT_HIDDEN
 enum bt_notification_iterator_status lttng_live_iterator_init(
-               struct bt_private_notification_iterator *it,
+               struct bt_private_connection_private_notification_iterator *it,
                struct bt_private_port *port)
 {
        enum bt_notification_iterator_status ret =
@@ -929,7 +929,7 @@ enum bt_notification_iterator_status lttng_live_iterator_init(
        {
                struct lttng_live_no_stream_iterator *no_stream_iter =
                        container_of(s, struct lttng_live_no_stream_iterator, p);
-               ret = bt_private_notification_iterator_set_user_data(it, no_stream_iter);
+               ret = bt_private_connection_private_notification_iterator_set_user_data(it, no_stream_iter);
                if (ret) {
                        goto error;
                }
@@ -939,7 +939,7 @@ enum bt_notification_iterator_status lttng_live_iterator_init(
        {
                struct lttng_live_stream_iterator *stream_iter =
                        container_of(s, struct lttng_live_stream_iterator, p);
-               ret = bt_private_notification_iterator_set_user_data(it, stream_iter);
+               ret = bt_private_connection_private_notification_iterator_set_user_data(it, stream_iter);
                if (ret) {
                        goto error;
                }
@@ -953,7 +953,7 @@ enum bt_notification_iterator_status lttng_live_iterator_init(
 end:
        return ret;
 error:
-       if (bt_private_notification_iterator_set_user_data(it, NULL)
+       if (bt_private_connection_private_notification_iterator_set_user_data(it, NULL)
                        != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
                BT_LOGE("Error setting private data to NULL");
        }
@@ -961,12 +961,12 @@ error:
 }
 
 static
-struct bt_component_class_query_return lttng_live_query_list_sessions(
+struct bt_component_class_query_method_return lttng_live_query_list_sessions(
                struct bt_component_class *comp_class,
                struct bt_query_executor *query_exec,
                struct bt_value *params)
 {
-       struct bt_component_class_query_return query_ret = {
+       struct bt_component_class_query_method_return query_ret = {
                .result = NULL,
                .status = BT_QUERY_STATUS_OK,
        };
@@ -1017,12 +1017,12 @@ end:
 }
 
 BT_HIDDEN
-struct bt_component_class_query_return lttng_live_query(
+struct bt_component_class_query_method_return lttng_live_query(
                struct bt_component_class *comp_class,
                struct bt_query_executor *query_exec,
                const char *object, struct bt_value *params)
 {
-       struct bt_component_class_query_return ret = {
+       struct bt_component_class_query_method_return ret = {
                .result = NULL,
                .status = BT_QUERY_STATUS_OK,
        };
index 58956981c8ef6450ff8f29a3b35cc8ca3453ed3a..f7f42f430bca7f7bbdbf3b8848b39aa4900f69ea 100644 (file)
@@ -30,7 +30,7 @@
 #include "logging.h"
 
 #include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/graph/connection.h>
 #include <babeltrace/graph/notification.h>
 #include <babeltrace/graph/notification-event.h>
@@ -95,11 +95,11 @@ void unref_trace(struct debug_info_trace *di_trace)
 }
 
 static
-void debug_info_iterator_destroy(struct bt_private_notification_iterator *it)
+void debug_info_iterator_destroy(struct bt_private_connection_private_notification_iterator *it)
 {
        struct debug_info_iterator *it_data;
 
-       it_data = bt_private_notification_iterator_get_user_data(it);
+       it_data = bt_private_connection_private_notification_iterator_get_user_data(it);
        assert(it_data);
 
        if (it_data->input_iterator_group) {
@@ -232,23 +232,23 @@ end:
 }
 
 static
-struct bt_notification_iterator_next_return debug_info_iterator_next(
-               struct bt_private_notification_iterator *iterator)
+struct bt_notification_iterator_next_method_return debug_info_iterator_next(
+               struct bt_private_connection_private_notification_iterator *iterator)
 {
        struct debug_info_iterator *debug_it = NULL;
        struct bt_private_component *component = NULL;
        struct debug_info_component *debug_info = NULL;
        struct bt_notification_iterator *source_it = NULL;
        struct bt_notification *notification;
-       struct bt_notification_iterator_next_return ret = {
+       struct bt_notification_iterator_next_method_return ret = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
                .notification = NULL,
        };
 
-       debug_it = bt_private_notification_iterator_get_user_data(iterator);
+       debug_it = bt_private_connection_private_notification_iterator_get_user_data(iterator);
        assert(debug_it);
 
-       component = bt_private_notification_iterator_get_private_component(iterator);
+       component = bt_private_connection_private_notification_iterator_get_private_component(iterator);
        assert(component);
        debug_info = bt_private_component_get_user_data(component);
        assert(debug_info);
@@ -279,7 +279,7 @@ end:
 
 static
 enum bt_notification_iterator_status debug_info_iterator_init(
-               struct bt_private_notification_iterator *iterator,
+               struct bt_private_connection_private_notification_iterator *iterator,
                struct bt_private_port *port)
 {
        enum bt_notification_iterator_status ret =
@@ -288,7 +288,7 @@ enum bt_notification_iterator_status debug_info_iterator_init(
        enum bt_connection_status conn_status;
        struct bt_private_connection *connection = NULL;
        struct bt_private_component *component =
-               bt_private_notification_iterator_get_private_component(iterator);
+               bt_private_connection_private_notification_iterator_get_private_component(iterator);
        struct debug_info_iterator *it_data = g_new0(struct debug_info_iterator, 1);
        struct bt_private_port *input_port;
 
@@ -324,7 +324,7 @@ enum bt_notification_iterator_status debug_info_iterator_init(
        it_data->trace_map = g_hash_table_new_full(g_direct_hash,
                        g_direct_equal, NULL, (GDestroyNotify) unref_trace);
 
-       it_ret = bt_private_notification_iterator_set_user_data(iterator, it_data);
+       it_ret = bt_private_connection_private_notification_iterator_set_user_data(iterator, it_data);
        if (it_ret) {
                goto end;
        }
index f8f65541b8ce148c9eb572359924e9cde49566e7..a17f969e9999c59aa852978cbe4e4adcdf345b2a 100644 (file)
@@ -1039,7 +1039,7 @@ void destroy_dmesg_notif_iter(struct dmesg_notif_iter *dmesg_notif_iter)
 
 BT_HIDDEN
 enum bt_notification_iterator_status dmesg_notif_iter_init(
-               struct bt_private_notification_iterator *priv_notif_iter,
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter,
                struct bt_private_port *priv_port)
 {
        struct bt_private_component *priv_comp = NULL;
@@ -1054,7 +1054,7 @@ enum bt_notification_iterator_status dmesg_notif_iter_init(
                goto error;
        }
 
-       priv_comp = bt_private_notification_iterator_get_private_component(
+       priv_comp = bt_private_connection_private_notification_iterator_get_private_component(
                priv_notif_iter);
        assert(priv_comp);
        dmesg_comp = bt_private_component_get_user_data(priv_comp);
@@ -1072,13 +1072,13 @@ enum bt_notification_iterator_status dmesg_notif_iter_init(
                }
        }
 
-       (void) bt_private_notification_iterator_set_user_data(priv_notif_iter,
+       (void) bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
                dmesg_notif_iter);
        goto end;
 
 error:
        destroy_dmesg_notif_iter(dmesg_notif_iter);
-       (void) bt_private_notification_iterator_set_user_data(priv_notif_iter,
+       (void) bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
                NULL);
        if (status >= 0) {
                status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR;
@@ -1091,22 +1091,22 @@ end:
 
 BT_HIDDEN
 void dmesg_notif_iter_finalize(
-               struct bt_private_notification_iterator *priv_notif_iter)
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter)
 {
-       destroy_dmesg_notif_iter(bt_private_notification_iterator_get_user_data(
+       destroy_dmesg_notif_iter(bt_private_connection_private_notification_iterator_get_user_data(
                priv_notif_iter));
 }
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return dmesg_notif_iter_next(
-               struct bt_private_notification_iterator *priv_notif_iter)
+struct bt_notification_iterator_next_method_return dmesg_notif_iter_next(
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter)
 {
        ssize_t len;
        struct dmesg_notif_iter *dmesg_notif_iter =
-               bt_private_notification_iterator_get_user_data(
+               bt_private_connection_private_notification_iterator_get_user_data(
                        priv_notif_iter);
        struct dmesg_component *dmesg_comp;
-       struct bt_notification_iterator_next_return next_ret = {
+       struct bt_notification_iterator_next_method_return next_ret = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
                .notification = NULL
        };
index 963b20896033a20c01de7efbfbf25ce98fc9aa8e..07258d440452ec10dd6a2ad6c0cdf48f14da2886 100644 (file)
@@ -37,15 +37,15 @@ void dmesg_finalize(struct bt_private_component *priv_comp);
 
 BT_HIDDEN
 enum bt_notification_iterator_status dmesg_notif_iter_init(
-               struct bt_private_notification_iterator *priv_notif_iter,
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter,
                struct bt_private_port *priv_port);
 
 BT_HIDDEN
 void dmesg_notif_iter_finalize(
-               struct bt_private_notification_iterator *priv_notif_iter);
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter);
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return dmesg_notif_iter_next(
-               struct bt_private_notification_iterator *priv_notif_iter);
+struct bt_notification_iterator_next_method_return dmesg_notif_iter_next(
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter);
 
 #endif /* BABELTRACE_PLUGIN_TEXT_DMESG_DMESG_H */
index 431530bb08b0ad69098859c520f0af052e6f52b5..6546ab2fb04b92c7f27642bb9926440de5aab0d1 100644 (file)
@@ -41,7 +41,7 @@
 #include <babeltrace/graph/private-component.h>
 #include <babeltrace/graph/private-component.h>
 #include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/graph/private-port.h>
 #include <babeltrace/graph/connection.h>
 #include <babeltrace/graph/connection-internal.h>
 #define ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME       "assume-absolute-clock-classes"
 
 struct muxer_comp {
-       /* Array of struct bt_private_notification_iterator * (weak refs) */
+       /*
+        * Array of struct
+        * bt_private_connection_private_notification_iterator *
+        * (weak refs)
+        */
        GPtrArray *muxer_notif_iters;
 
        /* Weak ref */
@@ -117,7 +121,7 @@ struct muxer_notif_iter {
        GList *newly_connected_priv_ports;
 
        /* Next thing to return by the "next" method */
-       struct bt_notification_iterator_next_return next_next_return;
+       struct bt_notification_iterator_next_method_return next_next_return;
 
        /* Last time returned in a notification */
        int64_t last_returned_ts_ns;
@@ -1034,12 +1038,12 @@ end:
 }
 
 static
-struct bt_notification_iterator_next_return muxer_notif_iter_do_next(
+struct bt_notification_iterator_next_method_return muxer_notif_iter_do_next(
                struct muxer_comp *muxer_comp,
                struct muxer_notif_iter *muxer_notif_iter)
 {
        struct muxer_upstream_notif_iter *muxer_upstream_notif_iter = NULL;
-       struct bt_notification_iterator_next_return next_return = {
+       struct bt_notification_iterator_next_method_return next_return = {
                .notification = NULL,
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
        };
@@ -1233,7 +1237,7 @@ end:
 
 BT_HIDDEN
 enum bt_notification_iterator_status muxer_notif_iter_init(
-               struct bt_private_notification_iterator *priv_notif_iter,
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter,
                struct bt_private_port *output_priv_port)
 {
        struct muxer_comp *muxer_comp = NULL;
@@ -1243,7 +1247,7 @@ enum bt_notification_iterator_status muxer_notif_iter_init(
                BT_NOTIFICATION_ITERATOR_STATUS_OK;
        int ret;
 
-       priv_comp = bt_private_notification_iterator_get_private_component(
+       priv_comp = bt_private_connection_private_notification_iterator_get_private_component(
                priv_notif_iter);
        assert(priv_comp);
        muxer_comp = bt_private_component_get_user_data(priv_comp);
@@ -1300,7 +1304,7 @@ enum bt_notification_iterator_status muxer_notif_iter_init(
                goto error;
        }
 
-       ret = bt_private_notification_iterator_set_user_data(priv_notif_iter,
+       ret = bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
                muxer_notif_iter);
        assert(ret == 0);
        BT_LOGD("Initialized muxer component's notification iterator: "
@@ -1317,7 +1321,7 @@ error:
        }
 
        destroy_muxer_notif_iter(muxer_notif_iter);
-       ret = bt_private_notification_iterator_set_user_data(priv_notif_iter,
+       ret = bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
                NULL);
        assert(ret == 0);
        status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR;
@@ -1330,14 +1334,14 @@ end:
 
 BT_HIDDEN
 void muxer_notif_iter_finalize(
-               struct bt_private_notification_iterator *priv_notif_iter)
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter)
 {
        struct muxer_notif_iter *muxer_notif_iter =
-               bt_private_notification_iterator_get_user_data(priv_notif_iter);
+               bt_private_connection_private_notification_iterator_get_user_data(priv_notif_iter);
        struct bt_private_component *priv_comp = NULL;
        struct muxer_comp *muxer_comp = NULL;
 
-       priv_comp = bt_private_notification_iterator_get_private_component(
+       priv_comp = bt_private_connection_private_notification_iterator_get_private_component(
                priv_notif_iter);
        assert(priv_comp);
        muxer_comp = bt_private_component_get_user_data(priv_comp);
@@ -1356,17 +1360,17 @@ void muxer_notif_iter_finalize(
 }
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return muxer_notif_iter_next(
-               struct bt_private_notification_iterator *priv_notif_iter)
+struct bt_notification_iterator_next_method_return muxer_notif_iter_next(
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter)
 {
-       struct bt_notification_iterator_next_return next_ret;
+       struct bt_notification_iterator_next_method_return next_ret;
        struct muxer_notif_iter *muxer_notif_iter =
-               bt_private_notification_iterator_get_user_data(priv_notif_iter);
+               bt_private_connection_private_notification_iterator_get_user_data(priv_notif_iter);
        struct bt_private_component *priv_comp = NULL;
        struct muxer_comp *muxer_comp = NULL;
 
        assert(muxer_notif_iter);
-       priv_comp = bt_private_notification_iterator_get_private_component(
+       priv_comp = bt_private_connection_private_notification_iterator_get_private_component(
                priv_notif_iter);
        assert(priv_comp);
        muxer_comp = bt_private_component_get_user_data(priv_comp);
index be11ba4572511c012833672ef504396c4b545b8c..b7e05ba3a0af84081c887e434e55b3f06719988b 100644 (file)
@@ -37,16 +37,16 @@ void muxer_finalize(
 
 BT_HIDDEN
 enum bt_notification_iterator_status muxer_notif_iter_init(
-               struct bt_private_notification_iterator *priv_notif_iter,
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter,
                struct bt_private_port *priv_port);
 
 BT_HIDDEN
 void muxer_notif_iter_finalize(
-               struct bt_private_notification_iterator *priv_notif_iter);
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter);
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return muxer_notif_iter_next(
-               struct bt_private_notification_iterator *priv_notif_iter);
+struct bt_notification_iterator_next_method_return muxer_notif_iter_next(
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter);
 
 BT_HIDDEN
 void muxer_port_connected(
index d8d8b0c6c9166880baee82d03c737c18fad2556b..32a99c88e9df654e794cc5192cfcd36651d57c8d 100644 (file)
@@ -32,7 +32,7 @@
 #include <babeltrace/compat/time-internal.h>
 #include <babeltrace/compat/utc-internal.h>
 #include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/graph/notification.h>
 #include <babeltrace/graph/notification-event.h>
 #include <babeltrace/graph/notification-stream.h>
@@ -67,11 +67,11 @@ gboolean close_packets(gpointer key, gpointer value, gpointer user_data)
 }
 
 BT_HIDDEN
-void trimmer_iterator_finalize(struct bt_private_notification_iterator *it)
+void trimmer_iterator_finalize(struct bt_private_connection_private_notification_iterator *it)
 {
        struct trimmer_iterator *trim_it;
 
-       trim_it = bt_private_notification_iterator_get_user_data(it);
+       trim_it = bt_private_connection_private_notification_iterator_get_user_data(it);
        assert(trim_it);
 
        bt_put(trim_it->input_iterator);
@@ -83,7 +83,7 @@ void trimmer_iterator_finalize(struct bt_private_notification_iterator *it)
 
 BT_HIDDEN
 enum bt_notification_iterator_status trimmer_iterator_init(
-               struct bt_private_notification_iterator *iterator,
+               struct bt_private_connection_private_notification_iterator *iterator,
                struct bt_private_port *port)
 {
        enum bt_notification_iterator_status ret =
@@ -93,7 +93,7 @@ enum bt_notification_iterator_status trimmer_iterator_init(
        struct bt_private_port *input_port = NULL;
        struct bt_private_connection *connection = NULL;
        struct bt_private_component *component =
-               bt_private_notification_iterator_get_private_component(iterator);
+               bt_private_connection_private_notification_iterator_get_private_component(iterator);
        struct trimmer_iterator *it_data = g_new0(struct trimmer_iterator, 1);
        static const enum bt_notification_type notif_types[] = {
                BT_NOTIFICATION_TYPE_EVENT,
@@ -126,7 +126,7 @@ enum bt_notification_iterator_status trimmer_iterator_init(
        it_data->packet_map = g_hash_table_new_full(g_direct_hash,
                        g_direct_equal, NULL, NULL);
 
-       it_ret = bt_private_notification_iterator_set_user_data(iterator,
+       it_ret = bt_private_connection_private_notification_iterator_set_user_data(iterator,
                it_data);
        if (it_ret) {
                goto end;
@@ -582,23 +582,23 @@ enum bt_notification_iterator_status evaluate_notification(
 }
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return trimmer_iterator_next(
-               struct bt_private_notification_iterator *iterator)
+struct bt_notification_iterator_next_method_return trimmer_iterator_next(
+               struct bt_private_connection_private_notification_iterator *iterator)
 {
        struct trimmer_iterator *trim_it = NULL;
        struct bt_private_component *component = NULL;
        struct trimmer *trimmer = NULL;
        struct bt_notification_iterator *source_it = NULL;
-       struct bt_notification_iterator_next_return ret = {
+       struct bt_notification_iterator_next_method_return ret = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
                .notification = NULL,
        };
        bool notification_in_range = false;
 
-       trim_it = bt_private_notification_iterator_get_user_data(iterator);
+       trim_it = bt_private_connection_private_notification_iterator_get_user_data(iterator);
        assert(trim_it);
 
-       component = bt_private_notification_iterator_get_private_component(
+       component = bt_private_connection_private_notification_iterator_get_private_component(
                iterator);
        assert(component);
        trimmer = bt_private_component_get_user_data(component);
index dc0dcccbc33107da308fe301dc4328637d859791..1ba08825ea0e0419b0e01ee226fe46e7727d9a07 100644 (file)
@@ -44,14 +44,14 @@ struct trimmer_iterator {
 
 BT_HIDDEN
 enum bt_notification_iterator_status trimmer_iterator_init(
-               struct bt_private_notification_iterator *iterator,
+               struct bt_private_connection_private_notification_iterator *iterator,
                struct bt_private_port *port);
 
 BT_HIDDEN
-void trimmer_iterator_finalize(struct bt_private_notification_iterator *it);
+void trimmer_iterator_finalize(struct bt_private_connection_private_notification_iterator *it);
 
 BT_HIDDEN
-struct bt_notification_iterator_next_return trimmer_iterator_next(
-               struct bt_private_notification_iterator *iterator);
+struct bt_notification_iterator_next_method_return trimmer_iterator_next(
+               struct bt_private_connection_private_notification_iterator *iterator);
 
 #endif /* BABELTRACE_PLUGIN_TRIMMER_ITERATOR_H */
index 352b0cffa3405d2cdab76985548c00e249cb9f33..54a1667070dc0937d7dcb59ebdc71437f537a0f5 100644 (file)
@@ -36,7 +36,7 @@
 #include <babeltrace/graph/component-filter.h>
 #include <babeltrace/graph/notification.h>
 #include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/graph/private-component-filter.h>
 #include <babeltrace/graph/notification-event.h>
 #include <plugins-common.h>
index d70fbc92fcd3d31a96274236fb7647d90a877dd7..f3f4e1929bb01124fc6cdf606bc372f017963dd2 100644 (file)
@@ -28,21 +28,21 @@ static enum bt_component_status sink_consume(
 }
 
 static enum bt_notification_iterator_status dummy_iterator_init_method(
-               struct bt_private_notification_iterator *private_iterator,
+               struct bt_private_connection_private_notification_iterator *private_iterator,
                struct bt_private_port *private_port)
 {
        return BT_NOTIFICATION_ITERATOR_STATUS_OK;
 }
 
 static void dummy_iterator_finalize_method(
-               struct bt_private_notification_iterator *private_iterator)
+               struct bt_private_connection_private_notification_iterator *private_iterator)
 {
 }
 
-static struct bt_notification_iterator_next_return dummy_iterator_next_method(
-               struct bt_private_notification_iterator *private_iterator)
+static struct bt_notification_iterator_next_method_return dummy_iterator_next_method(
+               struct bt_private_connection_private_notification_iterator *private_iterator)
 {
-       struct bt_notification_iterator_next_return next_return = {
+       struct bt_notification_iterator_next_method_return next_return = {
                .notification = NULL,
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
        };
@@ -50,12 +50,12 @@ static struct bt_notification_iterator_next_return dummy_iterator_next_method(
        return next_return;
 }
 
-static struct bt_component_class_query_return query_method(
+static struct bt_component_class_query_method_return query_method(
                struct bt_component_class *component_class,
                struct bt_query_executor *query_exec,
                const char *object, struct bt_value *params)
 {
-       struct bt_component_class_query_return ret = {
+       struct bt_component_class_query_method_return ret = {
                .status = BT_QUERY_STATUS_OK,
                .result = bt_value_array_create(),
        };
index d6ca1973d58c4960539f3068a6f3d5fc891dd9d2..d4bb01da49973e7eb292b002f159313bfc744a68 100644 (file)
@@ -50,7 +50,7 @@
 #include <babeltrace/graph/private-component-sink.h>
 #include <babeltrace/graph/private-component.h>
 #include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/graph/private-port.h>
 #include <babeltrace/plugin/plugin.h>
 #include <babeltrace/ref.h>
@@ -483,10 +483,10 @@ void fini_static_data(void)
 
 static
 void src_iter_finalize(
-               struct bt_private_notification_iterator *private_notification_iterator)
+               struct bt_private_connection_private_notification_iterator *private_notification_iterator)
 {
        struct src_iter_user_data *user_data =
-               bt_private_notification_iterator_get_user_data(
+               bt_private_connection_private_notification_iterator_get_user_data(
                        private_notification_iterator);
 
        if (user_data) {
@@ -496,7 +496,7 @@ void src_iter_finalize(
 
 static
 enum bt_notification_iterator_status src_iter_init(
-               struct bt_private_notification_iterator *priv_notif_iter,
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter,
                struct bt_private_port *private_port)
 {
        struct src_iter_user_data *user_data =
@@ -504,7 +504,7 @@ enum bt_notification_iterator_status src_iter_init(
        int ret;
 
        assert(user_data);
-       ret = bt_private_notification_iterator_set_user_data(priv_notif_iter,
+       ret = bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
                user_data);
        assert(ret == 0);
 
@@ -565,10 +565,10 @@ struct bt_ctf_event *src_create_event(struct bt_ctf_packet *packet)
 }
 
 static
-struct bt_notification_iterator_next_return src_iter_next_seq(
+struct bt_notification_iterator_next_method_return src_iter_next_seq(
                struct src_iter_user_data *user_data)
 {
-       struct bt_notification_iterator_next_return next_return = {
+       struct bt_notification_iterator_next_method_return next_return = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
        };
        int64_t cur_ts_ns;
@@ -681,15 +681,15 @@ struct bt_notification_iterator_next_return src_iter_next_seq(
 }
 
 static
-struct bt_notification_iterator_next_return src_iter_next(
-               struct bt_private_notification_iterator *priv_iterator)
+struct bt_notification_iterator_next_method_return src_iter_next(
+               struct bt_private_connection_private_notification_iterator *priv_iterator)
 {
-       struct bt_notification_iterator_next_return next_return = {
+       struct bt_notification_iterator_next_method_return next_return = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
                .notification = NULL,
        };
        struct src_iter_user_data *user_data =
-               bt_private_notification_iterator_get_user_data(priv_iterator);
+               bt_private_connection_private_notification_iterator_get_user_data(priv_iterator);
 
        assert(user_data);
        next_return = src_iter_next_seq(user_data);
index 4066587e27b47d98ad01a9a0a8104fa496150a86..6f81bdb885e2220815ccbb5e4f3748308c9854f0 100644 (file)
@@ -284,10 +284,10 @@ size_t event_pos(struct event *event)
 }
 
 static
-struct bt_notification_iterator_next_return src_iter_next(
-               struct bt_private_notification_iterator *priv_iterator)
+struct bt_notification_iterator_next_method_return src_iter_next(
+               struct bt_private_connection_private_notification_iterator *priv_iterator)
 {
-       struct bt_notification_iterator_next_return ret = {
+       struct bt_notification_iterator_next_method_return ret = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR,
        };
 
index 85ed44a92cfef868612e7b4e91e73184a647b603..7e9c98e2d9b52d94ada1a35fbff09fd1dbea6b9c 100644 (file)
@@ -49,7 +49,7 @@
 #include <babeltrace/graph/private-component-sink.h>
 #include <babeltrace/graph/private-component.h>
 #include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
 #include <babeltrace/graph/private-port.h>
 #include <babeltrace/plugin/plugin.h>
 #include <babeltrace/ref.h>
@@ -416,10 +416,10 @@ void fini_static_data(void)
 
 static
 void src_iter_finalize(
-               struct bt_private_notification_iterator *private_notification_iterator)
+               struct bt_private_connection_private_notification_iterator *private_notification_iterator)
 {
        struct src_iter_user_data *user_data =
-               bt_private_notification_iterator_get_user_data(
+               bt_private_connection_private_notification_iterator_get_user_data(
                        private_notification_iterator);
 
        if (user_data) {
@@ -429,7 +429,7 @@ void src_iter_finalize(
 
 static
 enum bt_notification_iterator_status src_iter_init(
-               struct bt_private_notification_iterator *priv_notif_iter,
+               struct bt_private_connection_private_notification_iterator *priv_notif_iter,
                struct bt_private_port *private_port)
 {
        struct src_iter_user_data *user_data =
@@ -440,7 +440,7 @@ enum bt_notification_iterator_status src_iter_init(
 
        assert(user_data);
        assert(port);
-       ret = bt_private_notification_iterator_set_user_data(priv_notif_iter,
+       ret = bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
                user_data);
        assert(ret == 0);
        port_name = bt_port_get_name(port);
@@ -536,10 +536,10 @@ struct bt_ctf_event *src_create_event(struct bt_ctf_packet *packet,
 }
 
 static
-struct bt_notification_iterator_next_return src_iter_next_seq(
+struct bt_notification_iterator_next_method_return src_iter_next_seq(
                struct src_iter_user_data *user_data)
 {
-       struct bt_notification_iterator_next_return next_return = {
+       struct bt_notification_iterator_next_method_return next_return = {
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
        };
        int64_t cur_ts_ns;
@@ -588,17 +588,17 @@ struct bt_notification_iterator_next_return src_iter_next_seq(
 }
 
 static
-struct bt_notification_iterator_next_return src_iter_next(
-               struct bt_private_notification_iterator *priv_iterator)
+struct bt_notification_iterator_next_method_return src_iter_next(
+               struct bt_private_connection_private_notification_iterator *priv_iterator)
 {
-       struct bt_notification_iterator_next_return next_return = {
+       struct bt_notification_iterator_next_method_return next_return = {
                .notification = NULL,
                .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
        };
        struct src_iter_user_data *user_data =
-               bt_private_notification_iterator_get_user_data(priv_iterator);
+               bt_private_connection_private_notification_iterator_get_user_data(priv_iterator);
        struct bt_private_component *private_component =
-               bt_private_notification_iterator_get_private_component(priv_iterator);
+               bt_private_connection_private_notification_iterator_get_private_component(priv_iterator);
        int ret;
 
        assert(user_data);
This page took 0.082099 seconds and 4 git commands to generate.