More modifications
[babeltrace.git] / include / babeltrace / plugin / plugin-system.h
CommitLineData
43de0e13
JG
1#ifndef BABELTRACE_PLUGIN_SYSTEM_H
2#define BABELTRACE_PLUGIN_SYSTEM_H
3
4/*
5 * BabelTrace - Babeltrace Plug-in System Interface
6 *
7 * This interface is provided for plug-ins to use the Babeltrace
8 * plug-in system facilities.
9 *
10 * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 *
12 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining a copy
15 * of this software and associated documentation files (the "Software"), to deal
16 * in the Software without restriction, including without limitation the rights
17 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 * copies of the Software, and to permit persons to whom the Software is
19 * furnished to do so, subject to the following conditions:
20 *
21 * The above copyright notice and this permission notice shall be included in
22 * all copies or substantial portions of the Software.
23 *
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#include <babeltrace/objects.h>
2bd8a567 34#include <babeltrace/plugin/notification/iterator.h>
43de0e13
JG
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
2bd8a567
JG
40struct bt_notification;
41
43de0e13 42/**
633edee0 43 * Component private data deallocation function type.
43de0e13 44 *
633edee0 45 * @param component Component instance
43de0e13 46 */
633edee0 47typedef void (*bt_component_destroy_cb)(struct bt_component *component);
43de0e13 48
2bd8a567
JG
49/**
50 * Iterator creation function type.
51 *
633edee0 52 * @param component Component instance
2bd8a567
JG
53 */
54typedef struct bt_notification_iterator *(
633edee0
JG
55 *bt_component_source_iterator_create_cb)(
56 struct bt_component *component);
2bd8a567
JG
57
58/**
59 * Notification handling function type.
60 *
633edee0 61 * @param component Component instance
2bd8a567 62 * @param notificattion Notification to handle
633edee0 63 * @returns One of #bt_component_status values
2bd8a567 64 */
633edee0
JG
65typedef enum bt_component_status (*bt_component_sink_handle_notification_cb)(
66 struct bt_component *, struct bt_notification *);
2bd8a567
JG
67
68typedef struct bt_notification *(bt_notification_iterator_get_notification_cb)(
69 struct bt_notification_iterator *);
70
71typedef enum bt_notification_iterator_status (bt_notification_iterator_next_cb)(
72 struct bt_notification_iterator *);
73
43de0e13 74/**
633edee0 75 * Get a component's private (implementation) data.
43de0e13 76 *
633edee0 77 * @param component Component of which to get the private data
43de0e13 78 */
633edee0 79extern void *bt_component_get_private_data(struct bt_component *component);
43de0e13
JG
80
81/**
633edee0 82 * Set a component's private (implementation) data.
43de0e13 83 *
633edee0
JG
84 * @param component Component of which to set the private data
85 * @param data Component private data
43de0e13 86 */
633edee0
JG
87extern enum bt_component_status bt_component_set_private_data(struct bt_component *component,
88 void *data);
43de0e13 89
7a278c8e 90
0777b693 91/** Notification iterator functions */
43de0e13 92/**
bfd20a42 93 * Allocate a notification iterator.
43de0e13 94 *
633edee0 95 * @param component Component instance
43de0e13
JG
96 * @param next_cb Callback advancing to the next notification
97 * @param notification_cb Callback providing the current notification
98 * @returns A notification iterator instance
99 */
100extern struct bt_notification_iterator *bt_notification_iterator_create(
633edee0 101 struct bt_component *component,
43de0e13
JG
102 bt_notification_iterator_next_cb next_cb,
103 bt_notification_iterator_get_notification_cb notification_cb);
104
105#ifdef __cplusplus
106}
107#endif
108
109#endif /* BABELTRACE_PLUGIN_SYSTEM_H */
This page took 0.026895 seconds and 4 git commands to generate.