Subscribe to notifications when creating a notif. iterator
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 2 May 2017 20:42:16 +0000 (16:42 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:42 +0000 (12:57 -0400)
commitfa054faf3a18fd8003510c32718c1fd4fbf3dd46
treee828b8c23c1628ed3a9f44cace4fdffeec8cde9c
parentdc77b5215ef41c67486cf32bce85bfde0b415952
Subscribe to notifications when creating a notif. iterator

bt_private_connection_create_notification_iterator() now accepts a new
parameter which is a BT_NOTIFICATION_TYPE_SENTINEL-terminated array of
notification types to subscribe to. It is guaranteed that, after any
bt_notification_iterator_next() called on the created iterator (if the
status is BT_NOTIFICATION_ITERATOR_STATUS_OK), the following call to
bt_notification_iterator_get_notification() returns a notification to
which the iterator is subscribed.

You can pass NULL to the notification types parameter of
bt_private_connection_create_notification_iterator() to subscribe to all
existing notifications (including the ones that will be added to the
following versions of the library).

The use case behind the subscription mechanism is for a notification
iterator to avoid the generation of automatic notifications when the
iterator's user does not expect them anyway. This should be the case of
some filters and sinks, text.pretty being a current example (only needs
event notifications).

Tests and existing plugins are updated accordingly.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
13 files changed:
include/babeltrace/graph/notification-iterator-internal.h
include/babeltrace/graph/notification.h
include/babeltrace/graph/private-connection.h
lib/graph/connection.c
lib/graph/iterator.c
plugins/debug-info/plugin.c
plugins/text/pretty/pretty.c
plugins/utils/dummy/dummy.c
plugins/utils/muxer/muxer.c
plugins/utils/trimmer/iterator.c
plugins/writer/writer.c
tests/lib/test_bt_notification_iterator.c
tests/plugins/test-utils-muxer.c
This page took 0.026051 seconds and 4 git commands to generate.