lib: add aliases for Babeltrace structure types
[babeltrace.git] / include / babeltrace / graph / self-component-port-input-notification-iterator.h
index 5bfb71049f911fb60ec12886e2da11da4f865d93..0f8712bcecd27e6237f1596a626fb14cb4864f19 100644 (file)
@@ -2,7 +2,7 @@
 #define BABELTRACE_GRAPH_SELF_COMPONENT_PORT_INPUT_NOTIFICATION_ITERATOR_H
 
 /*
- * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
 /* For enum bt_notification_iterator_status */
 #include <babeltrace/graph/notification-iterator.h>
 
-/* For bt_notification_array */
-#include <babeltrace/graph/notification.h>
+/*
+ * For bt_component, bt_notification_iterator,
+ * bt_self_component_port_input_notification_iterator,
+ * bt_self_component_port_input, bt_notification_array_const
+ */
+#include <babeltrace/types.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-struct bt_component;
-struct bt_notification_iterator;
-struct bt_self_component_port_input_notification_iterator;
-struct bt_self_component_port_input;
-
 static inline
-struct bt_notification_iterator *
-bt_self_component_port_input_notification_iterator_borrow_notification_iterator(
-               struct bt_self_component_port_input_notification_iterator *iterator)
+bt_notification_iterator *
+bt_self_component_port_input_notification_iterator_as_notification_iterator(
+               bt_self_component_port_input_notification_iterator *iterator)
 {
        return (void *) iterator;
 }
 
-extern struct bt_self_component_port_input_notification_iterator *
+extern bt_self_component_port_input_notification_iterator *
 bt_self_component_port_input_notification_iterator_create(
-               struct bt_self_component_port_input *input_port);
+               bt_self_component_port_input *input_port);
 
-extern struct bt_component *
+extern bt_component *
 bt_self_component_port_input_notification_iterator_borrow_component(
-               struct bt_self_component_port_input_notification_iterator *iterator);
+               bt_self_component_port_input_notification_iterator *iterator);
 
 extern enum bt_notification_iterator_status
 bt_self_component_port_input_notification_iterator_next(
-               struct bt_self_component_port_input_notification_iterator *iterator,
-               bt_notification_array *notifs, uint64_t *count);
+               bt_self_component_port_input_notification_iterator *iterator,
+               bt_notification_array_const *notifs, uint64_t *count);
+
+extern void bt_self_component_port_input_notification_iterator_get_ref(
+               const bt_self_component_port_input_notification_iterator *self_component_port_input_notification_iterator);
+
+extern void bt_self_component_port_input_notification_iterator_put_ref(
+               const bt_self_component_port_input_notification_iterator *self_component_port_input_notification_iterator);
+
+#define BT_SELF_COMPONENT_PORT_INPUT_NOTIFICATION_ITERATOR_PUT_REF_AND_RESET(_var) \
+       do {                                                            \
+               bt_self_component_port_input_notification_iterator_put_ref(_var); \
+               (_var) = NULL;                                          \
+       } while (0)
+
+#define BT_SELF_COMPONENT_PORT_INPUT_NOTIFICATION_ITERATOR_MOVE_REF(_var_dst, _var_src) \
+       do {                                                            \
+               bt_self_component_port_input_notification_iterator_put_ref(_var_dst); \
+               (_var_dst) = (_var_src);                                \
+               (_var_src) = NULL;                                      \
+       } while (0)
 
 #ifdef __cplusplus
 }
This page took 0.027013 seconds and 4 git commands to generate.