lib: use priv connection priv notif iterator to create notif, not graph
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 1 Aug 2018 20:43:10 +0000 (16:43 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 04:07:36 +0000 (00:07 -0400)
commitf0010051db62783ef057e8a6b625d6b4444671c2
tree1ac1714e959be7390f5df939e01ae8fc6b004cb1
parente22b45d0f7d3ce1311bf96a930bc42326f555202
lib: use priv connection priv notif iterator to create notif, not graph

The only valid location to create a notification object is within the
"next" method of a user private connection notification iterator. To
enforce this, make the notification creation functions accept a
`bt_private_connection_private_notification_iterator` object instead of
a `bt_graph` object to find the appropriate notification object pool
(still located within the graph object).

As of this patch, you cannot create a notification object outside the
implementation of a user private connection notification iterator.

This should also help the adaptation of the Python bindings to create a
notification object using a method from `self` when implementing a user
notification iterator:

    class MyIter(bt2._UserNotificationIterator):
        # ...

        def __next__(self):
            # ...
            event_notif = self._create_event_notification(...)
            # ...

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
17 files changed:
include/babeltrace/graph/notification-event.h
include/babeltrace/graph/notification-inactivity.h
include/babeltrace/graph/notification-packet.h
include/babeltrace/graph/notification-stream.h
lib/graph/notification/event.c
lib/graph/notification/inactivity.c
lib/graph/notification/packet.c
lib/graph/notification/stream.c
plugins/ctf/common/notif-iter/notif-iter.c
plugins/ctf/common/notif-iter/notif-iter.h
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/text/dmesg/dmesg.c
tests/lib/test_bt_notification_iterator.c
tests/plugins/test-utils-muxer.c
This page took 0.025779 seconds and 4 git commands to generate.