2 * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 #include <babeltrace/plugin/plugin-dev.h>
24 #include <babeltrace/component/component.h>
25 #include <babeltrace/component/component-sink.h>
26 #include <babeltrace/component/notification/iterator.h>
27 #include <babeltrace/component/notification/notification.h>
30 enum bt_component_status
dummy_consume(struct bt_component
*component
)
32 enum bt_component_status ret
;
33 struct bt_notification
*notif
= NULL
;
34 struct bt_notification_iterator
*it
= NULL
;
35 unsigned int it_count
;
39 ret
= bt_component_sink_get_input_count(component
, &it_count
);
42 for (i
= 0; i
< it_count
; i
++) {
43 enum bt_notification_iterator_status it_ret
;
45 ret
= bt_component_sink_get_input_iterator(component
, i
, &it
);
47 it_ret
= bt_notification_iterator_next(it
);
49 case BT_NOTIFICATION_ITERATOR_STATUS_ERROR
:
50 ret
= BT_COMPONENT_STATUS_ERROR
;
52 case BT_NOTIFICATION_ITERATOR_STATUS_END
:
53 ret
= BT_COMPONENT_STATUS_END
;
60 notif
= bt_notification_iterator_get_notification(it
);
62 ret
= BT_COMPONENT_STATUS_ERROR
;
67 * Dummy! I'm doing nothing with this notification,
76 ret
= BT_COMPONENT_STATUS_END
;