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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:34 +0000 (18:19 -0400)
commit03e18d5d5e14a8d7aa16cdb1d4a19518dce5c9e8
treed7ea9eac484ea78ce56fdf9d2a9c428028465315
parent8fc063a27ce18a902d8d5d3255bc31c9f44c64c2
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.026175 seconds and 4 git commands to generate.