lib: notification iterator: transfer a batch of notifications
[babeltrace.git] / include / babeltrace / graph / component-class.h
index cf031cfe1b43e9127fd948ca8230396fd834603c..f7d243649f02a690f9f544048f88c792c0ae1d37 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef BABELTRACE_COMPONENT_COMPONENT_CLASS_H
-#define BABELTRACE_COMPONENT_COMPONENT_CLASS_H
+#ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_H
+#define BABELTRACE_GRAPH_COMPONENT_CLASS_H
 
 /*
  * Babeltrace - Component Class Interface.
  * SOFTWARE.
  */
 
-#include <babeltrace/graph/component.h>
 #include <stdint.h>
 
+/* For enum bt_component_status */
+#include <babeltrace/graph/component-status.h>
+
+/* For enum bt_notification_iterator_status */
+#include <babeltrace/graph/notification-iterator.h>
+
+/* For enum bt_query_status */
+#include <babeltrace/graph/query-executor.h>
+
+/* For bt_bool */
+#include <babeltrace/types.h>
+
+/* For bt_notification_array */
+#include <babeltrace/graph/notification.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -38,7 +52,8 @@ struct bt_private_component;
 struct bt_private_port;
 struct bt_port;
 struct bt_value;
-struct bt_private_notification_iterator;
+struct bt_private_connection_private_notification_iterator;
+struct bt_query_executor;
 
 /**
  * Component class type.
@@ -56,6 +71,11 @@ enum bt_component_class_type {
        BT_COMPONENT_CLASS_TYPE_FILTER =        2,
 };
 
+struct bt_component_class_query_method_return {
+       struct bt_value *result;
+       enum bt_query_status status;
+};
+
 typedef enum bt_component_status (*bt_component_class_init_method)(
                struct bt_private_component *private_component,
                struct bt_value *params, void *init_method_data);
@@ -65,22 +85,21 @@ typedef void (*bt_component_class_finalize_method)(
 
 typedef enum bt_notification_iterator_status
                (*bt_component_class_notification_iterator_init_method)(
-               struct bt_private_notification_iterator *private_notification_iterator,
+               struct bt_private_connection_private_notification_iterator *notification_iterator,
                struct bt_private_port *private_port);
 
 typedef void (*bt_component_class_notification_iterator_finalize_method)(
-               struct bt_private_notification_iterator *private_notification_iterator);
-
-typedef struct bt_notification_iterator_next_return (*bt_component_class_notification_iterator_next_method)(
-               struct bt_private_notification_iterator *private_notification_iterator);
+               struct bt_private_connection_private_notification_iterator *notification_iterator);
 
 typedef enum bt_notification_iterator_status
-               (*bt_component_class_notification_iterator_seek_time_method)(
-               struct bt_private_notification_iterator *private_notification_iterator,
-               int64_t time);
+(*bt_component_class_notification_iterator_next_method)(
+               struct bt_private_connection_private_notification_iterator *notification_iterator,
+               bt_notification_array notifs, uint64_t capacity,
+               uint64_t *count);
 
-typedef struct bt_value *(*bt_component_class_query_method)(
+typedef struct bt_component_class_query_method_return (*bt_component_class_query_method)(
                struct bt_component_class *component_class,
+               struct bt_query_executor *query_executor,
                const char *object, struct bt_value *params);
 
 typedef enum bt_component_status (*bt_component_class_accept_port_connection_method)(
@@ -88,29 +107,38 @@ typedef enum bt_component_status (*bt_component_class_accept_port_connection_met
                struct bt_private_port *self_private_port,
                struct bt_port *other_port);
 
+typedef void (*bt_component_class_port_connected_method)(
+               struct bt_private_component *private_component,
+               struct bt_private_port *self_private_port,
+               struct bt_port *other_port);
+
 typedef void (*bt_component_class_port_disconnected_method)(
                struct bt_private_component *private_component,
                struct bt_private_port *private_port);
 
 extern int bt_component_class_set_init_method(
                struct bt_component_class *component_class,
-               bt_component_class_init_method init_method);
+               bt_component_class_init_method method);
 
 extern int bt_component_class_set_finalize_method(
                struct bt_component_class *component_class,
-               bt_component_class_finalize_method finalize_method);
+               bt_component_class_finalize_method method);
 
 extern int bt_component_class_set_accept_port_connection_method(
                struct bt_component_class *component_class,
-               bt_component_class_accept_port_connection_method accept_port_connection_method);
+               bt_component_class_accept_port_connection_method method);
+
+extern int bt_component_class_set_port_connected_method(
+               struct bt_component_class *component_class,
+               bt_component_class_port_connected_method method);
 
 extern int bt_component_class_set_port_disconnected_method(
                struct bt_component_class *component_class,
-               bt_component_class_port_disconnected_method port_disconnected_method);
+               bt_component_class_port_disconnected_method method);
 
 extern int bt_component_class_set_query_method(
                struct bt_component_class *component_class,
-               bt_component_class_query_method query_method);
+               bt_component_class_query_method method);
 
 extern int bt_component_class_set_description(
                struct bt_component_class *component_class,
@@ -147,10 +175,6 @@ extern const char *bt_component_class_get_description(
 extern const char *bt_component_class_get_help(
                struct bt_component_class *component_class);
 
-extern struct bt_value *bt_component_class_query(
-               struct bt_component_class *component_class,
-               const char *object, struct bt_value *params);
-
 /**
  * Get a component class' type.
  *
@@ -160,8 +184,29 @@ extern struct bt_value *bt_component_class_query(
 extern enum bt_component_class_type bt_component_class_get_type(
                struct bt_component_class *component_class);
 
+static inline
+bt_bool bt_component_class_is_source(struct bt_component_class *component_class)
+{
+       return bt_component_class_get_type(component_class) ==
+               BT_COMPONENT_CLASS_TYPE_SOURCE;
+}
+
+static inline
+bt_bool bt_component_class_is_filter(struct bt_component_class *component_class)
+{
+       return bt_component_class_get_type(component_class) ==
+               BT_COMPONENT_CLASS_TYPE_FILTER;
+}
+
+static inline
+bt_bool bt_component_class_is_sink(struct bt_component_class *component_class)
+{
+       return bt_component_class_get_type(component_class) ==
+               BT_COMPONENT_CLASS_TYPE_SINK;
+}
+
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* BABELTRACE_COMPONENT_COMPONENT_CLASS_H */
+#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_H */
This page took 0.027385 seconds and 4 git commands to generate.