Commit | Line | Data |
---|---|---|
cbb9e0b1 PP |
1 | /* |
2 | * Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com> | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; under version 2 of the License. | |
7 | * | |
8 | * This program is distributed in the hope that it will be useful, | |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | * GNU General Public License for more details. | |
12 | * | |
13 | * You should have received a copy of the GNU General Public License along | |
14 | * with this program; if not, write to the Free Software Foundation, Inc., | |
15 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
16 | */ | |
17 | ||
18 | #include <babeltrace/plugin/plugin-dev.h> | |
19 | #include <babeltrace/component/component.h> | |
20 | ||
d3e4dcd8 | 21 | static enum bt_component_status sink_consume(struct bt_component *component) |
cbb9e0b1 | 22 | { |
cbb9e0b1 PP |
23 | return BT_COMPONENT_STATUS_OK; |
24 | } | |
25 | ||
d3eb6e8f PP |
26 | static enum bt_notification_iterator_status dummy_iterator_init_method( |
27 | struct bt_component *component, | |
28 | struct bt_notification_iterator *iterator) | |
cbb9e0b1 | 29 | { |
d3eb6e8f PP |
30 | return BT_NOTIFICATION_ITERATOR_STATUS_OK; |
31 | } | |
32 | ||
33 | static void dummy_iterator_destroy_method( | |
34 | struct bt_notification_iterator *iterator) | |
35 | { | |
36 | } | |
37 | ||
38 | static struct bt_notification *dummy_iterator_get_method( | |
39 | struct bt_notification_iterator *iterator) | |
40 | { | |
41 | return NULL; | |
42 | } | |
43 | ||
44 | static enum bt_notification_iterator_status dummy_iterator_next_method( | |
45 | struct bt_notification_iterator *iterator) | |
46 | { | |
47 | return BT_NOTIFICATION_ITERATOR_STATUS_OK; | |
48 | } | |
49 | ||
50 | static enum bt_notification_iterator_status dummy_iterator_seek_time_method( | |
51 | struct bt_notification_iterator *iterator, int64_t time) | |
52 | { | |
53 | return BT_NOTIFICATION_ITERATOR_STATUS_OK; | |
cbb9e0b1 PP |
54 | } |
55 | ||
6ba0b073 | 56 | BT_PLUGIN(test_sfs); |
cbb9e0b1 PP |
57 | BT_PLUGIN_DESCRIPTION("Babeltrace plugin with source, sink, and filter component classes"); |
58 | BT_PLUGIN_AUTHOR("Janine Sutto"); | |
59 | BT_PLUGIN_LICENSE("Beerware"); | |
458e8e1d | 60 | BT_PLUGIN_VERSION(1, 2, 3, "yes"); |
cbb9e0b1 | 61 | |
d3eb6e8f PP |
62 | BT_PLUGIN_SOURCE_COMPONENT_CLASS(source, dummy_iterator_get_method, |
63 | dummy_iterator_next_method); | |
d3e4dcd8 | 64 | BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(source, "A source."); |
d3eb6e8f PP |
65 | BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(source, |
66 | dummy_iterator_init_method); | |
67 | BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD(source, | |
68 | dummy_iterator_destroy_method); | |
69 | BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(source, | |
70 | dummy_iterator_seek_time_method); | |
6ba0b073 | 71 | |
d3e4dcd8 PP |
72 | BT_PLUGIN_SINK_COMPONENT_CLASS(sink, sink_consume); |
73 | BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(sink, "A sink."); | |
6ba0b073 | 74 | |
d3eb6e8f PP |
75 | BT_PLUGIN_FILTER_COMPONENT_CLASS(filter, dummy_iterator_get_method, |
76 | dummy_iterator_next_method); | |
d3e4dcd8 | 77 | BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION(filter, "A filter."); |
d3eb6e8f PP |
78 | BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(filter, |
79 | dummy_iterator_init_method); | |
80 | BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_DESTROY_METHOD(filter, | |
81 | dummy_iterator_destroy_method); | |
82 | BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(filter, | |
83 | dummy_iterator_seek_time_method); |