lib: add output port notification iterator
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 2 Sep 2017 01:38:26 +0000 (21:38 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 17 Sep 2017 18:10:50 +0000 (14:10 -0400)
commitc3ac0193edbb71341f159f121cadb23252395b70
tree7c94989233d76945eb82b9d5ec87119833705b11
parentfe7265b50927fe05576f8c5cedaea1d8433d8a02
lib: add output port notification iterator

As of this patch, you can create an output port notification iterator
with a component's output port with
bt_output_port_notification_iterator_create(). This function, on
success:

1. Creates a notification iterator object, which contains a
   notification pointer.

2. Adds (creates) a colander sink component, passing this notification
   pointer's address to its initialization method data, along with
   a list of notification types to subscribe to received as a
   parameter.

3. Connects the passed output port to the colander component's input
   port.

4. Makes the targeted graph nonconsumable. This means, at this point,
   only bt_notification_iterator_next() can consume the graph, not the
   user.

5. Returns the created notification iterator.

When you call bt_notification_iterator_next() with this new notification
iterator, it puts its current notification and consumes its specific
colander sink within the graph to make it store the next notification,
forwarding any exceptional graph status as a notification iterator
status.

More than one output port notification iterators on a single graph are
supported: multiple colander sinks are added to the graph and each one
makes its own colander sink consume.

To avoid immediate or eventual component name clashes,
bt_output_port_notification_iterator_create() accepts an optional
colander name parameter. If you use NULL, then `colander` is used.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/Makefile.am
include/babeltrace/babeltrace.h
include/babeltrace/graph/component-class-sink-colander-internal.h [new file with mode: 0644]
include/babeltrace/graph/component-class-sink-colander.h [deleted file]
include/babeltrace/graph/graph-internal.h
include/babeltrace/graph/notification-iterator-internal.h
include/babeltrace/graph/output-port-notification-iterator.h [new file with mode: 0644]
lib/graph/component-class-sink-colander.c
lib/graph/graph.c
lib/graph/iterator.c
This page took 0.025541 seconds and 4 git commands to generate.