bt2: rename native_bt_notifier.i to native_bt_message_iterator.i
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 25 Jun 2019 17:51:29 +0000 (13:51 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 27 Jun 2019 03:09:07 +0000 (23:09 -0400)
We don't use the term notifier anymore, message iterator is more
contemporary.

Change-Id: Iadda98ac83a2dfddcb207d3beb99ddaa65181ad3
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1536
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/Makefile.am
src/bindings/python/bt2/bt2/native_bt.i
src/bindings/python/bt2/bt2/native_bt_message_iterator.i [new file with mode: 0644]
src/bindings/python/bt2/bt2/native_bt_notifier.i [deleted file]

index 70da6698508b1d4078a444a3eade00d08d0c8f93..123ee2cfe20f38fb91e8e297ba80038e5ed39b5e 100644 (file)
@@ -22,7 +22,7 @@ STATIC_BINDINGS_DEPS =                                        \
        bt2/native_bt.i                                 \
        bt2/native_bt_logging.i                         \
        bt2/native_bt_message.i                         \
-       bt2/native_bt_notifier.i                        \
+       bt2/native_bt_message_iterator.i                \
        bt2/native_bt_packet.i                          \
        bt2/native_bt_plugin.i                          \
        bt2/native_bt_port.i                            \
index 9101020c534a26d9dfe14bc83ee45a228634f9d4..c062f34ab8c46ddc00a40c79b32a9c6e24729936 100644 (file)
@@ -187,7 +187,7 @@ typedef int bt_bool;
 %include "native_bt_graph.i"
 %include "native_bt_logging.i"
 %include "native_bt_message.i"
-%include "native_bt_notifier.i"
+%include "native_bt_message_iterator.i"
 %include "native_bt_packet.i"
 %include "native_bt_plugin.i"
 %include "native_bt_port.i"
diff --git a/src/bindings/python/bt2/bt2/native_bt_message_iterator.i b/src/bindings/python/bt2/bt2/native_bt_message_iterator.i
new file mode 100644 (file)
index 0000000..47bd3a9
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2017 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
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+%include <babeltrace2/graph/message-iterator-const.h>
+%include <babeltrace2/graph/port-output-message-iterator.h>
+%include <babeltrace2/graph/self-component-port-input-message-iterator.h>
+%include <babeltrace2/graph/self-message-iterator.h>
+
+/* Helper functions for Python */
+%{
+static PyObject *bt_py3_get_user_component_from_user_msg_iter(
+               bt_self_message_iterator *self_message_iterator)
+{
+       bt_self_component *self_component = bt_self_message_iterator_borrow_component(self_message_iterator);
+       PyObject *py_comp;
+
+       BT_ASSERT(self_component);
+       py_comp = bt_self_component_get_data(self_component);
+       BT_ASSERT(py_comp);
+
+       /* Return new reference */
+       Py_INCREF(py_comp);
+       return py_comp;
+}
+
+static inline
+PyObject *create_pylist_from_messages(bt_message_array_const messages,
+               uint64_t message_count)
+{
+       uint64_t i;
+       PyObject *py_msg_list = PyList_New(message_count);
+       BT_ASSERT(py_msg_list);
+       for (i = 0; i < message_count; i++) {
+               PyList_SET_ITEM(py_msg_list, i,
+                               SWIG_NewPointerObj(SWIG_as_voidptr(messages[i]),
+                                       SWIGTYPE_p_bt_message, 0));
+       }
+
+       return py_msg_list;
+}
+
+static
+PyObject *bt_py3_get_msg_range_common(bt_message_iterator_status status,
+               bt_message_array_const messages, uint64_t message_count)
+{
+       PyObject *py_status;
+       PyObject *py_return_tuple;
+       PyObject *py_msg_list = Py_None;
+       
+       py_status = SWIG_From_long_SS_long(status);
+       if (status != BT_MESSAGE_ITERATOR_STATUS_OK) {
+               goto end;
+       }
+
+       py_msg_list = create_pylist_from_messages(messages, message_count);
+
+end:
+       py_return_tuple = PyTuple_New(2);
+       BT_ASSERT(py_return_tuple);
+       PyTuple_SET_ITEM(py_return_tuple, 0, py_status);
+       PyTuple_SET_ITEM(py_return_tuple, 1, py_msg_list);
+
+       return py_return_tuple;
+}
+
+static PyObject
+*bt_py3_self_component_port_input_get_msg_range(
+               bt_self_component_port_input_message_iterator *iter)
+{
+       bt_message_array_const messages;
+       uint64_t message_count = 0;
+       bt_message_iterator_status status;
+
+       status = bt_self_component_port_input_message_iterator_next(iter, &messages,
+                               &message_count);
+       
+       return bt_py3_get_msg_range_common(status, messages, message_count);
+}
+
+static PyObject
+*bt_py3_port_output_get_msg_range(
+               bt_port_output_message_iterator *iter)
+{
+       bt_message_array_const messages;
+       uint64_t message_count = 0;
+       bt_message_iterator_status status;
+
+       status =
+               bt_port_output_message_iterator_next(iter, &messages,
+                               &message_count);
+       
+       return bt_py3_get_msg_range_common(status, messages, message_count);
+}
+%}
+
+PyObject *bt_py3_get_user_component_from_user_msg_iter(
+    bt_self_message_iterator *self_message_iterator);
+PyObject *bt_py3_self_component_port_input_get_msg_range(
+               bt_self_component_port_input_message_iterator *iter);
+PyObject *bt_py3_port_output_get_msg_range(
+               bt_port_output_message_iterator *iter);
diff --git a/src/bindings/python/bt2/bt2/native_bt_notifier.i b/src/bindings/python/bt2/bt2/native_bt_notifier.i
deleted file mode 100644 (file)
index 47bd3a9..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2017 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
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-%include <babeltrace2/graph/message-iterator-const.h>
-%include <babeltrace2/graph/port-output-message-iterator.h>
-%include <babeltrace2/graph/self-component-port-input-message-iterator.h>
-%include <babeltrace2/graph/self-message-iterator.h>
-
-/* Helper functions for Python */
-%{
-static PyObject *bt_py3_get_user_component_from_user_msg_iter(
-               bt_self_message_iterator *self_message_iterator)
-{
-       bt_self_component *self_component = bt_self_message_iterator_borrow_component(self_message_iterator);
-       PyObject *py_comp;
-
-       BT_ASSERT(self_component);
-       py_comp = bt_self_component_get_data(self_component);
-       BT_ASSERT(py_comp);
-
-       /* Return new reference */
-       Py_INCREF(py_comp);
-       return py_comp;
-}
-
-static inline
-PyObject *create_pylist_from_messages(bt_message_array_const messages,
-               uint64_t message_count)
-{
-       uint64_t i;
-       PyObject *py_msg_list = PyList_New(message_count);
-       BT_ASSERT(py_msg_list);
-       for (i = 0; i < message_count; i++) {
-               PyList_SET_ITEM(py_msg_list, i,
-                               SWIG_NewPointerObj(SWIG_as_voidptr(messages[i]),
-                                       SWIGTYPE_p_bt_message, 0));
-       }
-
-       return py_msg_list;
-}
-
-static
-PyObject *bt_py3_get_msg_range_common(bt_message_iterator_status status,
-               bt_message_array_const messages, uint64_t message_count)
-{
-       PyObject *py_status;
-       PyObject *py_return_tuple;
-       PyObject *py_msg_list = Py_None;
-       
-       py_status = SWIG_From_long_SS_long(status);
-       if (status != BT_MESSAGE_ITERATOR_STATUS_OK) {
-               goto end;
-       }
-
-       py_msg_list = create_pylist_from_messages(messages, message_count);
-
-end:
-       py_return_tuple = PyTuple_New(2);
-       BT_ASSERT(py_return_tuple);
-       PyTuple_SET_ITEM(py_return_tuple, 0, py_status);
-       PyTuple_SET_ITEM(py_return_tuple, 1, py_msg_list);
-
-       return py_return_tuple;
-}
-
-static PyObject
-*bt_py3_self_component_port_input_get_msg_range(
-               bt_self_component_port_input_message_iterator *iter)
-{
-       bt_message_array_const messages;
-       uint64_t message_count = 0;
-       bt_message_iterator_status status;
-
-       status = bt_self_component_port_input_message_iterator_next(iter, &messages,
-                               &message_count);
-       
-       return bt_py3_get_msg_range_common(status, messages, message_count);
-}
-
-static PyObject
-*bt_py3_port_output_get_msg_range(
-               bt_port_output_message_iterator *iter)
-{
-       bt_message_array_const messages;
-       uint64_t message_count = 0;
-       bt_message_iterator_status status;
-
-       status =
-               bt_port_output_message_iterator_next(iter, &messages,
-                               &message_count);
-       
-       return bt_py3_get_msg_range_common(status, messages, message_count);
-}
-%}
-
-PyObject *bt_py3_get_user_component_from_user_msg_iter(
-    bt_self_message_iterator *self_message_iterator);
-PyObject *bt_py3_self_component_port_input_get_msg_range(
-               bt_self_component_port_input_message_iterator *iter);
-PyObject *bt_py3_port_output_get_msg_range(
-               bt_port_output_message_iterator *iter);
This page took 0.029278 seconds and 4 git commands to generate.