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>
Fri, 15 Sep 2017 18:48:43 +0000 (14:48 -0400)
commit8ed535b5ed7341916a1dd486b87bdc6e94ed1b81
tree07d440ec21bb039c56c43a533a29dd8f3eef6d94
parent90157d89276ed1a569a2d4ffcfeed0b415817c12
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.028096 seconds and 4 git commands to generate.