Add component class help property
[babeltrace.git] / include / babeltrace / component / component-class.h
index c3359fe2e2c0f8a2ad9a5906f3446ac2cacb32a9..aee2474085a8556aae13842ce121dd2573bc30f9 100644 (file)
 extern "C" {
 #endif
 
-struct bt_plugin;
 struct bt_component_class;
 
-extern struct bt_component_class *bt_component_class_create(
-               enum bt_component_type type, const char *name,
-               const char *description, bt_component_init_cb init);
+/**
+ * Component class type.
+ */
+enum bt_component_class_type {
+       BT_COMPONENT_CLASS_TYPE_UNKNOWN =       -1,
+
+       /** A source component is a notification generator. */
+       BT_COMPONENT_CLASS_TYPE_SOURCE =        0,
+
+       /** A sink component handles incoming notifications. */
+       BT_COMPONENT_CLASS_TYPE_SINK =          1,
+
+       /** A filter component implements both Source and Sink interfaces. */
+       BT_COMPONENT_CLASS_TYPE_FILTER =        2,
+};
+
+typedef enum bt_component_status (*bt_component_class_init_method)(
+               struct bt_component *component, struct bt_value *params,
+               void *init_method_data);
+
+typedef void (*bt_component_class_destroy_method)(struct bt_component *component);
+
+typedef enum bt_notification_iterator_status
+               (*bt_component_class_notification_iterator_init_method)(
+               struct bt_component *component,
+               struct bt_notification_iterator *iterator, void *init_method_data);
+
+typedef void (*bt_component_class_notification_iterator_destroy_method)(
+               struct bt_notification_iterator *iterator);
+
+typedef struct bt_notification *(*bt_component_class_notification_iterator_get_method)(
+               struct bt_notification_iterator *iterator);
+
+typedef enum bt_notification_iterator_status (*bt_component_class_notification_iterator_next_method)(
+               struct bt_notification_iterator *iterator);
+
+typedef enum bt_notification_iterator_status
+               (*bt_component_class_notification_iterator_seek_time_method)(
+               struct bt_notification_iterator *iterator, int64_t time);
+
+extern int bt_component_class_set_init_method(
+               struct bt_component_class *component_class,
+               bt_component_class_init_method init_method);
+
+extern int bt_component_class_set_destroy_method(
+               struct bt_component_class *component_class,
+               bt_component_class_destroy_method destroy_method);
+
+extern int bt_component_class_set_description(
+               struct bt_component_class *component_class,
+               const char *description);
+
+extern int bt_component_class_set_help(
+               struct bt_component_class *component_class,
+               const char *help);
+
+extern int bt_component_class_freeze(
+               struct bt_component_class *component_class);
 
 /**
  * Get a component class' name.
@@ -59,13 +113,20 @@ extern const char *bt_component_class_get_name(
 extern const char *bt_component_class_get_description(
                struct bt_component_class *component_class);
 
+extern const char *bt_component_class_get_help(
+               struct bt_component_class *component_class);
+
 /**
  * Get a component class' type.
  *
  * @param component_class      Component class of which to get the type
  * @returns                    One of #bt_component_type
  */
-extern enum bt_component_type bt_component_class_get_type(
+extern enum bt_component_class_type bt_component_class_get_type(
                struct bt_component_class *component_class);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_H */
This page took 0.02433 seconds and 4 git commands to generate.