notif_types)
_handle_status(status, 'cannot create notification iterator object')
assert(notif_iter_ptr)
- return bt2.notification_iterator._GenericNotificationIterator._create_from_ptr(notif_iter_ptr)
+ return bt2.notification_iterator._PrivateConnectionNotificationIterator._create_from_ptr(notif_iter_ptr)
@property
def is_ended(self):
Py_XDECREF(py_method_result);
}
-static struct bt_component_class_query_return bt_py3_cc_query(
+static struct bt_component_class_query_method_return bt_py3_cc_query(
struct bt_component_class *comp_cls,
struct bt_query_executor *query_exec,
const char *object, struct bt_value *params)
PyObject *py_query_func = NULL;
PyObject *py_object = NULL;
PyObject *py_results_addr = NULL;
- struct bt_component_class_query_return ret = {
+ struct bt_component_class_query_method_return ret = {
.status = BT_QUERY_STATUS_OK,
.result = NULL,
};
}
static enum bt_notification_iterator_status bt_py3_cc_notification_iterator_init(
- struct bt_private_notification_iterator *priv_notif_iter,
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter,
struct bt_private_port *priv_port)
{
enum bt_notification_iterator_status status =
PyObject *py_init_method_result = NULL;
PyObject *py_iter = NULL;
struct bt_private_component *priv_comp =
- bt_private_notification_iterator_get_private_component(
+ bt_private_connection_private_notification_iterator_get_private_component(
priv_notif_iter);
PyObject *py_comp;
}
py_iter_ptr = SWIG_NewPointerObj(SWIG_as_voidptr(priv_notif_iter),
- SWIGTYPE_p_bt_private_notification_iterator, 0);
+ SWIGTYPE_p_bt_private_connection_private_notification_iterator, 0);
if (!py_iter_ptr) {
BT_LOGE_STR("Failed to create a SWIG pointer object.");
goto error;
* owns a native bt_notification_iterator object (iter)
* owns a _UserNotificationIterator instance (py_iter)
* self._ptr is a borrowed reference to the
- * native bt_private_notification_iterator
+ * native bt_private_connection_private_notification_iterator
* object (iter)
*/
- bt_private_notification_iterator_set_user_data(priv_notif_iter,
+ bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
py_iter);
py_iter = NULL;
goto end;
}
static void bt_py3_cc_notification_iterator_finalize(
- struct bt_private_notification_iterator *priv_notif_iter)
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter)
{
PyObject *py_notif_iter =
- bt_private_notification_iterator_get_user_data(priv_notif_iter);
+ bt_private_connection_private_notification_iterator_get_user_data(priv_notif_iter);
PyObject *py_method_result = NULL;
assert(py_notif_iter);
Py_DECREF(py_notif_iter);
}
-static struct bt_notification_iterator_next_return
+static struct bt_notification_iterator_next_method_return
bt_py3_cc_notification_iterator_next(
- struct bt_private_notification_iterator *priv_notif_iter)
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter)
{
- struct bt_notification_iterator_next_return next_ret = {
+ struct bt_notification_iterator_next_method_return next_ret = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
.notification = NULL,
};
PyObject *py_notif_iter =
- bt_private_notification_iterator_get_user_data(priv_notif_iter);
+ bt_private_connection_private_notification_iterator_get_user_data(priv_notif_iter);
PyObject *py_method_result = NULL;
assert(py_notif_iter);
BT_NOTIFICATION_ITERATOR_STATUS_UNSUPPORTED = -2,
};
-/* Functions */
+/* Functions (base) */
struct bt_notification *bt_notification_iterator_get_notification(
struct bt_notification_iterator *iterator);
enum bt_notification_iterator_status bt_notification_iterator_next(
struct bt_notification_iterator *iterator);
-struct bt_component *bt_notification_iterator_get_component(
+
+/* Functions (private connection) */
+struct bt_component *bt_private_connection_notification_iterator_get_component(
struct bt_notification_iterator *iterator);
/* Helper functions for Python */
%{
static PyObject *bt_py3_get_user_component_from_user_notif_iter(
- struct bt_private_notification_iterator *priv_notif_iter)
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter)
{
struct bt_private_component *priv_comp =
- bt_private_notification_iterator_get_private_component(
+ bt_private_connection_private_notification_iterator_get_private_component(
priv_notif_iter);
PyObject *py_comp;
%}
PyObject *bt_py3_get_user_component_from_user_notif_iter(
- struct bt_private_notification_iterator *priv_notif_iter);
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter);
class _GenericNotificationIterator(object._Object, _NotificationIterator):
- @property
- def component(self):
- comp_ptr = native_bt.notification_iterator_get_component(self._ptr)
- assert(comp_ptr)
- return bt2.component._create_generic_component_from_ptr(comp_ptr)
-
def _get_notif(self):
notif_ptr = native_bt.notification_iterator_get_notification(self._ptr)
utils._handle_ptr(notif_ptr, "cannot get notification iterator object's current notification object")
return self._get_notif()
+class _PrivateConnectionNotificationIterator(_GenericNotificationIterator):
+ @property
+ def component(self):
+ comp_ptr = native_bt.private_connection_notification_iterator_get_component(self._ptr)
+ assert(comp_ptr)
+ return bt2.component._create_generic_component_from_ptr(comp_ptr)
+
+
class _UserNotificationIterator(_NotificationIterator):
def __new__(cls, ptr):
# User iterator objects are always created by the native side,
babeltrace/graph/notification-packet.h \
babeltrace/graph/notification-stream.h \
babeltrace/graph/port.h \
- babeltrace/graph/query-executor.h \
babeltrace/graph/private-component-filter.h \
babeltrace/graph/private-component-sink.h \
babeltrace/graph/private-component-source.h \
babeltrace/graph/private-component.h \
+ babeltrace/graph/private-connection-notification-iterator.h \
+ babeltrace/graph/private-connection-private-notification-iterator.h \
babeltrace/graph/private-connection.h \
- babeltrace/graph/private-notification-iterator.h \
- babeltrace/graph/private-port.h
+ babeltrace/graph/private-port.h \
+ babeltrace/graph/query-executor.h
noinst_HEADERS = \
babeltrace/align-internal.h \
#include <babeltrace/graph/private-component-sink.h>
#include <babeltrace/graph/private-component-source.h>
#include <babeltrace/graph/private-component.h>
+#include <babeltrace/graph/private-connection-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/private-notification-iterator.h>
#include <babeltrace/graph/private-port.h>
#include <babeltrace/graph/query-executor.h>
extern
struct bt_component_class *bt_component_class_filter_create(const char *name,
- bt_component_class_notification_iterator_next_method notification_iterator_next_method);
+ bt_component_class_notification_iterator_next_method method);
extern
int bt_component_class_filter_set_notification_iterator_init_method(
struct bt_component_class *component_class,
- bt_component_class_notification_iterator_init_method notification_iterator_init_method);
+ bt_component_class_notification_iterator_init_method method);
extern
int bt_component_class_filter_set_notification_iterator_finalize_method(
struct bt_component_class *component_class,
- bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method);
+ bt_component_class_notification_iterator_finalize_method method);
#ifdef __cplusplus
}
#endif
-#endif /* BABELTRACEGRAPHCOMPONENT_COMPONENT_CLASS_FILTER_H */
+#endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_H */
struct bt_plugin_so_shared_lib_handle *so_handle;
};
-struct bt_component_class_iterator_methods {
+struct bt_component_class_notification_iterator_methods {
bt_component_class_notification_iterator_init_method init;
bt_component_class_notification_iterator_finalize_method finalize;
bt_component_class_notification_iterator_next_method next;
struct bt_component_class_source {
struct bt_component_class parent;
struct {
- struct bt_component_class_iterator_methods iterator;
+ struct bt_component_class_notification_iterator_methods iterator;
} methods;
};
struct bt_component_class_filter {
struct bt_component_class parent;
struct {
- struct bt_component_class_iterator_methods iterator;
+ struct bt_component_class_notification_iterator_methods iterator;
} methods;
};
extern
struct bt_component_class *bt_component_class_source_create(const char *name,
- bt_component_class_notification_iterator_next_method notification_iterator_next_method);
+ bt_component_class_notification_iterator_next_method method);
extern
int bt_component_class_source_set_notification_iterator_init_method(
struct bt_component_class *component_class,
- bt_component_class_notification_iterator_init_method notification_iterator_init_method);
+ bt_component_class_notification_iterator_init_method method);
extern
int bt_component_class_source_set_notification_iterator_finalize_method(
struct bt_component_class *component_class,
- bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method);
+ bt_component_class_notification_iterator_finalize_method method);
#ifdef __cplusplus
}
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;
/**
BT_COMPONENT_CLASS_TYPE_FILTER = 2,
};
-struct bt_notification_iterator_next_return {
+struct bt_notification_iterator_next_method_return {
struct bt_notification *notification;
enum bt_notification_iterator_status status;
};
-struct bt_component_class_query_return {
+struct bt_component_class_query_method_return {
struct bt_value *result;
enum bt_query_status status;
};
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);
+ struct bt_private_connection_private_notification_iterator *notification_iterator);
-typedef struct bt_notification_iterator_next_return (*bt_component_class_notification_iterator_next_method)(
- struct bt_private_notification_iterator *private_notification_iterator);
+typedef struct bt_notification_iterator_next_method_return
+(*bt_component_class_notification_iterator_next_method)(
+ struct bt_private_connection_private_notification_iterator *notification_iterator);
-typedef struct bt_component_class_query_return (*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);
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 port_connected_method);
+ 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,
#include <babeltrace/graph/connection.h>
#include <babeltrace/graph/notification-iterator.h>
+#include <babeltrace/graph/notification-iterator-internal.h>
#include <babeltrace/graph/private-connection.h>
#include <babeltrace/object-internal.h>
#include <stdbool.h>
BT_HIDDEN
void bt_connection_remove_iterator(struct bt_connection *conn,
- struct bt_notification_iterator *iterator);
+ struct bt_notification_iterator_private_connection *iterator);
static inline
struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn)
#include <babeltrace/graph/connection.h>
#include <babeltrace/graph/notification.h>
#include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/types.h>
#include <stdbool.h>
struct bt_port;
-enum bt_notification_iterator_notif_type {
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT = (1U << 0),
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY = (1U << 1),
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN = (1U << 2),
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END = (1U << 3),
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN = (1U << 4),
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END = (1U << 5),
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS = (1U << 6),
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS = (1U << 7),
+enum bt_notification_iterator_type {
+ BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION,
};
-enum bt_notification_iterator_state {
+enum bt_private_connection_notification_iterator_notif_type {
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT = (1U << 0),
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY = (1U << 1),
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN = (1U << 2),
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END = (1U << 3),
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN = (1U << 4),
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END = (1U << 5),
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS = (1U << 6),
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS = (1U << 7),
+};
+
+enum bt_private_connection_notification_iterator_state {
/* Iterator is not initialized. */
- BT_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED,
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED,
/* Iterator is active, not at the end yet, and not finalized. */
- BT_NOTIFICATION_ITERATOR_STATE_ACTIVE,
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE,
/*
* Iterator is ended, not finalized yet: the "next" method
* returns BT_NOTIFICATION_ITERATOR_STATUS_END.
*/
- BT_NOTIFICATION_ITERATOR_STATE_ENDED,
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED,
/*
* Iterator is finalized, but not at the end yet. This means
* before returning the BT_NOTIFICATION_ITERATOR_STATUS_CANCELED
* status.
*/
- BT_NOTIFICATION_ITERATOR_STATE_FINALIZED,
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED,
/*
* Iterator is finalized and ended: the "next" method always
* returns BT_NOTIFICATION_ITERATOR_STATUS_CANCELED.
*/
- BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED,
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED,
};
struct bt_notification_iterator {
struct bt_object base;
+ enum bt_notification_iterator_type type;
+};
+
+struct bt_notification_iterator_private_connection {
+ struct bt_notification_iterator base;
struct bt_component *upstream_component; /* Weak */
struct bt_port *upstream_port; /* Weak */
struct bt_connection *connection; /* Weak */
/*
* This is a mask of notifications to which the user of this
* iterator is subscribed
- * (see enum bt_notification_iterator_notif_type above).
+ * (see enum bt_private_connection_notification_iterator_notif_type
+ * above).
*/
uint32_t subscription_mask;
- enum bt_notification_iterator_state state;
+ enum bt_private_connection_notification_iterator_state state;
void *user_data;
};
static inline
-struct bt_notification_iterator *bt_notification_iterator_from_private(
- struct bt_private_notification_iterator *private_notification_iterator)
+struct bt_notification_iterator_private_connection *
+bt_private_connection_notification_iterator_from_private(
+ struct bt_private_connection_private_notification_iterator *private_notification_iterator)
{
return (void *) private_notification_iterator;
}
static inline
-struct bt_private_notification_iterator *
-bt_private_notification_iterator_from_notification_iterator(
- struct bt_notification_iterator *notification_iterator)
+struct bt_private_connection_private_notification_iterator *
+bt_private_connection_private_notification_iterator_from_notification_iterator(
+ struct bt_notification_iterator_private_connection *iterator)
{
- return (void *) notification_iterator;
+ return (void *) iterator;
}
BT_HIDDEN
-enum bt_connection_status bt_notification_iterator_create(
+enum bt_connection_status bt_private_connection_notification_iterator_create(
struct bt_component *upstream_comp,
struct bt_port *upstream_port,
const enum bt_notification_type *notification_types,
struct bt_connection *connection,
- struct bt_notification_iterator **iterator);
+ struct bt_notification_iterator_private_connection **iterator);
BT_HIDDEN
-void bt_notification_iterator_finalize(
- struct bt_notification_iterator *iterator);
+void bt_private_connection_notification_iterator_finalize(
+ struct bt_notification_iterator_private_connection *iterator);
BT_HIDDEN
-void bt_notification_iterator_set_connection(
- struct bt_notification_iterator *iterator,
+void bt_private_connection_notification_iterator_set_connection(
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_connection *connection);
static inline
};
static inline
-const char *bt_notification_iterator_state_string(
- enum bt_notification_iterator_state state)
+const char *bt_private_connection_notification_iterator_state_string(
+ enum bt_private_connection_notification_iterator_state state)
{
switch (state) {
- case BT_NOTIFICATION_ITERATOR_STATE_ACTIVE:
- return "BT_NOTIFICATION_ITERATOR_STATE_ACTIVE";
- case BT_NOTIFICATION_ITERATOR_STATE_ENDED:
- return "BT_NOTIFICATION_ITERATOR_STATE_ENDED";
- case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED:
- return "BT_NOTIFICATION_ITERATOR_STATE_FINALIZED";
- case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
- return "BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED";
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE:
+ return "BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE";
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED:
+ return "BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED";
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED:
+ return "BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED";
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
+ return "BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED";
default:
return "(unknown)";
}
extern enum bt_notification_iterator_status
bt_notification_iterator_next(struct bt_notification_iterator *iterator);
-extern struct bt_component *bt_notification_iterator_get_component(
- struct bt_notification_iterator *iterator);
-
#ifdef __cplusplus
}
#endif
--- /dev/null
+#ifndef BABELTRACE_GRAPH_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_H
+#define BABELTRACE_GRAPH_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_H
+
+/*
+ * Copyright 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_component;
+struct bt_notification_iterator;
+
+extern struct bt_component *bt_private_connection_notification_iterator_get_component(
+ struct bt_notification_iterator *iterator);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_H */
--- /dev/null
+#ifndef BABELTRACE_GRAPH_PRIVATE_CONNECTION_PRIVATE_NOTIFICATION_ITERATOR_H
+#define BABELTRACE_GRAPH_PRIVATE_CONNECTION_PRIVATE_NOTIFICATION_ITERATOR_H
+
+/*
+ * Copyright 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:
+ * 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bt_connection;
+struct bt_private_port;
+struct bt_private_connection;
+struct bt_private_connection_private_notification_iterator;
+
+struct bt_notification_iterator *
+bt_private_connection_notification_iterator_from_private_notification_iterator(
+ struct bt_private_connection_private_notification_iterator *private_notification_iterator);
+
+extern struct bt_private_component *
+bt_private_connection_private_notification_iterator_get_private_component(
+ struct bt_private_connection_private_notification_iterator *private_notification_iterator);
+
+extern enum bt_notification_iterator_status
+bt_private_connection_private_notification_iterator_set_user_data(
+ struct bt_private_connection_private_notification_iterator *private_notification_iterator,
+ void *user_data);
+
+extern void *bt_private_connection_private_notification_iterator_get_user_data(
+ struct bt_private_connection_private_notification_iterator *private_notification_iterator);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BABELTRACE_GRAPH_PRIVATE_CONNECTION_PRIVATE_NOTIFICATION_ITERATOR_H */
+++ /dev/null
-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H
-
-/*
- * Copyright 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:
- * 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.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct bt_connection;
-struct bt_private_port;
-struct bt_private_connection;
-struct bt_private_notification_iterator;
-
-struct bt_notification_iterator *
-bt_notification_iterator_from_private_notification_iterator(
- struct bt_private_notification_iterator *private_notification_iterator);
-
-extern struct bt_private_component *
-bt_private_notification_iterator_get_private_component(
- struct bt_private_notification_iterator *private_notification_iterator);
-
-extern enum bt_notification_iterator_status
-bt_private_notification_iterator_set_user_data(
- struct bt_private_notification_iterator *private_notification_iterator,
- void *user_data);
-
-extern void *bt_private_notification_iterator_get_user_data(
- struct bt_private_notification_iterator *private_notification_iterator);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PRIVATE_ITERATOR_H */
}
struct bt_component_class *bt_component_class_source_create(const char *name,
- bt_component_class_notification_iterator_next_method notification_iterator_next_method)
+ bt_component_class_notification_iterator_next_method method)
{
struct bt_component_class_source *source_class = NULL;
int ret;
goto end;
}
- if (!notification_iterator_next_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
goto end;
}
BT_LOGD("Creating source component class: "
"name=\"%s\", notif-iter-next-method-addr=%p",
- name, notification_iterator_next_method);
+ name, method);
source_class = g_new0(struct bt_component_class_source, 1);
if (!source_class) {
BT_LOGE_STR("Failed to allocate one source component class.");
goto end;
}
- source_class->methods.iterator.next = notification_iterator_next_method;
+ source_class->methods.iterator.next = method;
BT_LOGD("Created source component class: "
"name=\"%s\", notif-iter-next-method-addr=%p, addr=%p",
- name, notification_iterator_next_method, &source_class->parent);
+ name, method, &source_class->parent);
end:
return &source_class->parent;
}
struct bt_component_class *bt_component_class_filter_create(const char *name,
- bt_component_class_notification_iterator_next_method notification_iterator_next_method)
+ bt_component_class_notification_iterator_next_method method)
{
struct bt_component_class_filter *filter_class = NULL;
int ret;
goto end;
}
- if (!notification_iterator_next_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
goto end;
}
BT_LOGD("Creating filter component class: "
"name=\"%s\", notif-iter-next-method-addr=%p",
- name, notification_iterator_next_method);
+ name, method);
filter_class = g_new0(struct bt_component_class_filter, 1);
if (!filter_class) {
BT_LOGE_STR("Failed to allocate one filter component class.");
goto end;
}
- filter_class->methods.iterator.next = notification_iterator_next_method;
+ filter_class->methods.iterator.next = method;
BT_LOGD("Created filter component class: "
"name=\"%s\", notif-iter-next-method-addr=%p, addr=%p",
- name, notification_iterator_next_method, &filter_class->parent);
+ name, method, &filter_class->parent);
end:
return &filter_class->parent;
}
struct bt_component_class *bt_component_class_sink_create(const char *name,
- bt_component_class_sink_consume_method consume_method)
+ bt_component_class_sink_consume_method method)
{
struct bt_component_class_sink *sink_class = NULL;
int ret;
goto end;
}
- if (!consume_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
goto end;
}
BT_LOGD("Creating sink component class: "
"name=\"%s\", consume-method-addr=%p",
- name, consume_method);
+ name, method);
sink_class = g_new0(struct bt_component_class_sink, 1);
if (!sink_class) {
BT_LOGE_STR("Failed to allocate one sink component class.");
goto end;
}
- sink_class->methods.consume = consume_method;
+ sink_class->methods.consume = method;
BT_LOGD("Created sink component class: "
"name=\"%s\", consume-method-addr=%p, addr=%p",
- name, consume_method, &sink_class->parent);
+ name, method, &sink_class->parent);
end:
return &sink_class->parent;
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)
{
int ret = 0;
goto end;
}
- if (!init_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
ret = -1;
goto end;
goto end;
}
- component_class->methods.init = init_method;
+ component_class->methods.init = method;
BT_LOGV("Set component class's initialization method: "
"addr=%p, name=\"%s\", type=%s, method-addr=%p",
component_class,
bt_component_class_get_name(component_class),
bt_component_class_type_string(component_class->type),
- init_method);
+ method);
end:
return ret;
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)
{
int ret = 0;
goto end;
}
- if (!query_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
ret = -1;
goto end;
goto end;
}
- component_class->methods.query = query_method;
+ component_class->methods.query = method;
BT_LOGV("Set component class's query method: "
"addr=%p, name=\"%s\", type=%s, method-addr=%p",
component_class,
bt_component_class_get_name(component_class),
bt_component_class_type_string(component_class->type),
- query_method);
+ method);
end:
return ret;
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)
{
int ret = 0;
goto end;
}
- if (!finalize_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
ret = -1;
goto end;
goto end;
}
- component_class->methods.finalize = finalize_method;
+ component_class->methods.finalize = method;
BT_LOGV("Set component class's finalization method: "
"addr=%p, name=\"%s\", type=%s, method-addr=%p",
component_class,
bt_component_class_get_name(component_class),
bt_component_class_type_string(component_class->type),
- finalize_method);
+ method);
end:
return ret;
int bt_component_class_source_set_notification_iterator_init_method(
struct bt_component_class *component_class,
- bt_component_class_notification_iterator_init_method notification_iterator_init_method)
+ bt_component_class_notification_iterator_init_method method)
{
struct bt_component_class_source *source_class;
int ret = 0;
goto end;
}
- if (!notification_iterator_init_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
ret = -1;
goto end;
source_class = container_of(component_class,
struct bt_component_class_source, parent);
- source_class->methods.iterator.init = notification_iterator_init_method;
+ source_class->methods.iterator.init = method;
BT_LOGV("Set filter component class's notification iterator initialization method: "
"addr=%p, name=\"%s\", method-addr=%p",
component_class,
bt_component_class_get_name(component_class),
- notification_iterator_init_method);
+ method);
end:
return ret;
int bt_component_class_source_set_notification_iterator_finalize_method(
struct bt_component_class *component_class,
- bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method)
+ bt_component_class_notification_iterator_finalize_method method)
{
struct bt_component_class_source *source_class;
int ret = 0;
goto end;
}
- if (!notification_iterator_finalize_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
ret = -1;
goto end;
source_class = container_of(component_class,
struct bt_component_class_source, parent);
source_class->methods.iterator.finalize =
- notification_iterator_finalize_method;
+ method;
BT_LOGV("Set filter component class's notification iterator finalization method: "
"addr=%p, name=\"%s\", method-addr=%p",
component_class,
bt_component_class_get_name(component_class),
- notification_iterator_finalize_method);
+ method);
end:
return ret;
int bt_component_class_filter_set_notification_iterator_init_method(
struct bt_component_class *component_class,
- bt_component_class_notification_iterator_init_method notification_iterator_init_method)
+ bt_component_class_notification_iterator_init_method method)
{
struct bt_component_class_filter *filter_class;
int ret = 0;
goto end;
}
- if (!notification_iterator_init_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
ret = -1;
goto end;
filter_class = container_of(component_class,
struct bt_component_class_filter, parent);
- filter_class->methods.iterator.init = notification_iterator_init_method;
+ filter_class->methods.iterator.init = method;
BT_LOGV("Set filter component class's notification iterator initialization method: "
"addr=%p, name=\"%s\", method-addr=%p",
component_class,
bt_component_class_get_name(component_class),
- notification_iterator_init_method);
+ method);
end:
return ret;
int bt_component_class_filter_set_notification_iterator_finalize_method(
struct bt_component_class *component_class,
- bt_component_class_notification_iterator_finalize_method notification_iterator_finalize_method)
+ bt_component_class_notification_iterator_finalize_method method)
{
struct bt_component_class_filter *filter_class;
int ret = 0;
goto end;
}
- if (!notification_iterator_finalize_method) {
+ if (!method) {
BT_LOGW_STR("Invalid parameter: method is NULL.");
ret = -1;
goto end;
filter_class = container_of(component_class,
struct bt_component_class_filter, parent);
filter_class->methods.iterator.finalize =
- notification_iterator_finalize_method;
+ method;
BT_LOGV("Set filter component class's notification iterator finalization method: "
"addr=%p, name=\"%s\", method-addr=%p",
component_class,
bt_component_class_get_name(component_class),
- notification_iterator_finalize_method);
+ method);
end:
return ret;
#include <babeltrace/graph/connection-internal.h>
#include <babeltrace/graph/graph-internal.h>
#include <babeltrace/graph/notification-iterator-internal.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/babeltrace-internal.h>
#include <babeltrace/compiler-internal.h>
#include <babeltrace/ref.h>
* notification iterator created from it.
*/
for (i = 0; i < conn->iterators->len; i++) {
- struct bt_notification_iterator *iterator =
+ struct bt_notification_iterator_private_connection *iterator =
g_ptr_array_index(conn->iterators, i);
BT_LOGD("Finalizing notification iterator created by this ended connection: "
"conn-addr=%p, iter-addr=%p", conn, iterator);
- bt_notification_iterator_finalize(iterator);
+ bt_private_connection_notification_iterator_finalize(iterator);
/*
* Make sure this iterator does not try to remove itself
* from this connection's iterators on destruction
* because this connection won't exist anymore.
*/
- bt_notification_iterator_set_connection(iterator,
- NULL);
+ bt_private_connection_notification_iterator_set_connection(
+ iterator, NULL);
}
g_ptr_array_set_size(conn->iterators, 0);
struct bt_notification_iterator **user_iterator)
{
enum bt_component_class_type upstream_comp_class_type;
- struct bt_notification_iterator *iterator = NULL;
+ struct bt_notification_iterator_private_connection *iterator = NULL;
struct bt_port *upstream_port = NULL;
struct bt_component *upstream_component = NULL;
struct bt_component_class *upstream_comp_class = NULL;
bt_component_get_class_type(upstream_component);
assert(upstream_comp_class_type == BT_COMPONENT_CLASS_TYPE_SOURCE ||
upstream_comp_class_type == BT_COMPONENT_CLASS_TYPE_FILTER);
- status = bt_notification_iterator_create(upstream_component,
+ status = bt_private_connection_notification_iterator_create(upstream_component,
upstream_port, notification_types, connection, &iterator);
if (status != BT_CONNECTION_STATUS_OK) {
BT_LOGW("Cannot create notification iterator from connection.");
BT_LOGD("Calling user's initialization method: iter-addr=%p",
iterator);
iter_status = init_method(
- bt_private_notification_iterator_from_notification_iterator(iterator),
+ bt_private_connection_private_notification_iterator_from_notification_iterator((void *) iterator),
bt_private_port_from_port(upstream_port));
BT_LOGD("User method returned: status=%s",
bt_notification_iterator_status_string(iter_status));
}
}
- iterator->state = BT_NOTIFICATION_ITERATOR_STATE_ACTIVE;
+ iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE;
g_ptr_array_add(connection->iterators, iterator);
BT_LOGD("Created notification iterator from connection: "
"conn-addr=%p, upstream-port-addr=%p, "
iterator);
/* Move reference to user */
- *user_iterator = iterator;
+ *user_iterator = (void *) iterator;
iterator = NULL;
end:
BT_HIDDEN
void bt_connection_remove_iterator(struct bt_connection *conn,
- struct bt_notification_iterator *iterator)
+ struct bt_notification_iterator_private_connection *iterator)
{
g_ptr_array_remove(conn->iterators, iterator);
BT_LOGV("Removed notification iterator from connection: "
static
void stream_destroy_listener(struct bt_ctf_stream *stream, void *data)
{
- struct bt_notification_iterator *iterator = data;
+ struct bt_notification_iterator_private_connection *iterator = data;
/* Remove associated stream state */
g_hash_table_remove(iterator->stream_states, stream);
}
static
-void add_action(struct bt_notification_iterator *iterator,
+void add_action(struct bt_notification_iterator_private_connection *iterator,
struct action *action)
{
g_array_append_val(iterator->actions, *action);
}
static
-void clear_actions(struct bt_notification_iterator *iterator)
+void clear_actions(struct bt_notification_iterator_private_connection *iterator)
{
size_t i;
}
static
-void apply_actions(struct bt_notification_iterator *iterator)
+void apply_actions(struct bt_notification_iterator_private_connection *iterator)
{
size_t i;
}
static
-void bt_notification_iterator_destroy(struct bt_object *obj)
+void bt_private_connection_notification_iterator_destroy(struct bt_object *obj)
{
- struct bt_notification_iterator *iterator;
+ struct bt_notification_iterator_private_connection *iterator;
assert(obj);
* would be called again.
*/
obj->ref_count.count++;
- iterator = container_of(obj, struct bt_notification_iterator, base);
+ iterator = (void *) container_of(obj, struct bt_notification_iterator, base);
BT_LOGD("Destroying notification iterator object: addr=%p",
iterator);
- bt_notification_iterator_finalize(iterator);
+ bt_private_connection_notification_iterator_finalize(iterator);
if (iterator->queue) {
struct bt_notification *notif;
}
BT_HIDDEN
-void bt_notification_iterator_finalize(
- struct bt_notification_iterator *iterator)
+void bt_private_connection_notification_iterator_finalize(
+ struct bt_notification_iterator_private_connection *iterator)
{
struct bt_component_class *comp_class = NULL;
bt_component_class_notification_iterator_finalize_method
assert(iterator);
switch (iterator->state) {
- case BT_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED:
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED:
/* Skip user finalization if user initialization failed */
BT_LOGD("Not finalizing non-initialized notification iterator: "
"addr=%p", iterator);
return;
- case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED:
- case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED:
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
/* Already finalized */
BT_LOGD("Not finalizing notification iterator: already finalized: "
"addr=%p", iterator);
BT_LOGD("Finalizing notification iterator: addr=%p", iterator);
- if (iterator->state == BT_NOTIFICATION_ITERATOR_STATE_ENDED) {
+ if (iterator->state == BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED) {
BT_LOGD("Updating notification iterator's state: "
- "new-state=BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED");
- iterator->state = BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED;
+ "new-state=BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED");
+ iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED;
} else {
BT_LOGD("Updating notification iterator's state: "
- "new-state=BT_NOTIFICATION_ITERATOR_STATE_FINALIZED");
- iterator->state = BT_NOTIFICATION_ITERATOR_STATE_FINALIZED;
+ "new-state=BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED");
+ iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED;
}
assert(iterator->upstream_component);
BT_LOGD("Calling user's finalization method: addr=%p",
iterator);
finalize_method(
- bt_private_notification_iterator_from_notification_iterator(iterator));
+ bt_private_connection_private_notification_iterator_from_notification_iterator(iterator));
}
iterator->upstream_component = NULL;
}
BT_HIDDEN
-void bt_notification_iterator_set_connection(
- struct bt_notification_iterator *iterator,
+void bt_private_connection_notification_iterator_set_connection(
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_connection *connection)
{
assert(iterator);
static
int create_subscription_mask_from_notification_types(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
const enum bt_notification_type *notif_types)
{
const enum bt_notification_type *notif_type;
switch (*notif_type) {
case BT_NOTIFICATION_TYPE_ALL:
iterator->subscription_mask |=
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT |
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY |
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN |
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END |
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN |
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END |
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS |
- BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT |
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY |
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN |
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END |
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN |
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END |
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS |
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
break;
case BT_NOTIFICATION_TYPE_EVENT:
- iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT;
+ iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT;
break;
case BT_NOTIFICATION_TYPE_INACTIVITY:
- iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY;
+ iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY;
break;
case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
- iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN;
+ iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN;
break;
case BT_NOTIFICATION_TYPE_STREAM_END:
- iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END;
+ iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END;
break;
case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
- iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN;
+ iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN;
break;
case BT_NOTIFICATION_TYPE_PACKET_END:
- iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END;
+ iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END;
break;
case BT_NOTIFICATION_TYPE_DISCARDED_EVENTS:
- iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS;
+ iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS;
break;
case BT_NOTIFICATION_TYPE_DISCARDED_PACKETS:
- iterator->subscription_mask |= BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
+ iterator->subscription_mask |= BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
break;
default:
ret = -1;
return ret;
}
+static
+void init_notification_iterator(struct bt_notification_iterator *iterator,
+ enum bt_notification_iterator_type type,
+ bt_object_release_func destroy)
+{
+ bt_object_init(iterator, destroy);
+ iterator->type = type;
+}
+
BT_HIDDEN
-enum bt_connection_status bt_notification_iterator_create(
+enum bt_connection_status bt_private_connection_notification_iterator_create(
struct bt_component *upstream_comp,
struct bt_port *upstream_port,
const enum bt_notification_type *notification_types,
struct bt_connection *connection,
- struct bt_notification_iterator **user_iterator)
+ struct bt_notification_iterator_private_connection **user_iterator)
{
enum bt_connection_status status = BT_CONNECTION_STATUS_OK;
enum bt_component_class_type type;
- struct bt_notification_iterator *iterator = NULL;
+ struct bt_notification_iterator_private_connection *iterator = NULL;
assert(upstream_comp);
assert(upstream_port);
type = bt_component_get_class_type(upstream_comp);
assert(type == BT_COMPONENT_CLASS_TYPE_SOURCE ||
type == BT_COMPONENT_CLASS_TYPE_FILTER);
- iterator = g_new0(struct bt_notification_iterator, 1);
+ iterator = g_new0(struct bt_notification_iterator_private_connection, 1);
if (!iterator) {
BT_LOGE_STR("Failed to allocate one notification iterator.");
status = BT_CONNECTION_STATUS_NOMEM;
goto end;
}
- bt_object_init(iterator, bt_notification_iterator_destroy);
+ init_notification_iterator((void *) iterator,
+ BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION,
+ bt_private_connection_notification_iterator_destroy);
if (create_subscription_mask_from_notification_types(iterator,
notification_types)) {
iterator->upstream_component = upstream_comp;
iterator->upstream_port = upstream_port;
iterator->connection = connection;
- iterator->state = BT_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED;
+ iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_NON_INITIALIZED;
BT_LOGD("Created notification iterator: "
"upstream-comp-addr=%p, upstream-comp-name=\"%s\", "
"upstream-port-addr=%p, upstream-port-name=\"%s\", "
return status;
}
-void *bt_private_notification_iterator_get_user_data(
- struct bt_private_notification_iterator *private_iterator)
+void *bt_private_connection_private_notification_iterator_get_user_data(
+ struct bt_private_connection_private_notification_iterator *private_iterator)
{
- struct bt_notification_iterator *iterator =
- bt_notification_iterator_from_private(private_iterator);
+ struct bt_notification_iterator_private_connection *iterator =
+ bt_private_connection_notification_iterator_from_private(private_iterator);
return iterator ? iterator->user_data : NULL;
}
enum bt_notification_iterator_status
-bt_private_notification_iterator_set_user_data(
- struct bt_private_notification_iterator *private_iterator,
+bt_private_connection_private_notification_iterator_set_user_data(
+ struct bt_private_connection_private_notification_iterator *private_iterator,
void *data)
{
enum bt_notification_iterator_status ret =
BT_NOTIFICATION_ITERATOR_STATUS_OK;
- struct bt_notification_iterator *iterator =
- bt_notification_iterator_from_private(private_iterator);
+ struct bt_notification_iterator_private_connection *iterator =
+ bt_private_connection_notification_iterator_from_private(private_iterator);
if (!iterator) {
BT_LOGW_STR("Invalid parameter: notification iterator is NULL.");
goto end;
}
- notification = bt_get(iterator->current_notification);
+ switch (iterator->type) {
+ case BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION:
+ {
+ struct bt_notification_iterator_private_connection *priv_conn_iter =
+ (void *) iterator;
+
+ notification = bt_get(priv_conn_iter->current_notification);
+ break;
+ }
+ default:
+ BT_LOGF("Unknown notification iterator type: addr=%p, type=%d",
+ iterator, iterator->type);
+ abort();
+ }
end:
return notification;
}
static
-enum bt_notification_iterator_notif_type
+enum bt_private_connection_notification_iterator_notif_type
bt_notification_iterator_notif_type_from_notif_type(
enum bt_notification_type notif_type)
{
- enum bt_notification_iterator_notif_type iter_notif_type;
+ enum bt_private_connection_notification_iterator_notif_type iter_notif_type;
switch (notif_type) {
case BT_NOTIFICATION_TYPE_EVENT:
- iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT;
+ iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_EVENT;
break;
case BT_NOTIFICATION_TYPE_INACTIVITY:
- iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY;
+ iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_INACTIVITY;
break;
case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
- iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN;
+ iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_BEGIN;
break;
case BT_NOTIFICATION_TYPE_STREAM_END:
- iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END;
+ iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_STREAM_END;
break;
case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
- iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN;
+ iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_BEGIN;
break;
case BT_NOTIFICATION_TYPE_PACKET_END:
- iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END;
+ iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_PACKET_END;
break;
case BT_NOTIFICATION_TYPE_DISCARDED_EVENTS:
- iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS;
+ iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_EVENTS;
break;
case BT_NOTIFICATION_TYPE_DISCARDED_PACKETS:
- iter_notif_type = BT_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
+ iter_notif_type = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_NOTIF_TYPE_DISCARDED_PACKETS;
break;
default:
abort();
}
static
-bt_bool validate_notification(struct bt_notification_iterator *iterator,
+bt_bool validate_notification(
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *notif,
struct bt_ctf_stream *notif_stream,
struct bt_ctf_packet *notif_packet)
}
static
-bt_bool is_subscribed_to_notification_type(struct bt_notification_iterator *iterator,
+bt_bool is_subscribed_to_notification_type(
+ struct bt_notification_iterator_private_connection *iterator,
enum bt_notification_type notif_type)
{
uint32_t iter_notif_type =
}
static
-void add_action_push_notif(struct bt_notification_iterator *iterator,
+void add_action_push_notif(
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *notif)
{
struct action action = {
static
int add_action_push_notif_stream_begin(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_ctf_stream *stream)
{
int ret = 0;
static
int add_action_push_notif_stream_end(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_ctf_stream *stream)
{
int ret = 0;
static
int add_action_push_notif_packet_begin(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_ctf_packet *packet)
{
int ret = 0;
static
int add_action_push_notif_packet_end(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_ctf_packet *packet)
{
int ret = 0;
static
void add_action_set_stream_state_is_ended(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct stream_state *stream_state)
{
struct action action = {
static
void add_action_set_stream_state_cur_packet(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct stream_state *stream_state,
struct bt_ctf_packet *packet)
{
static
void add_action_update_stream_state_discarded_elements(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
enum action_type type,
struct stream_state *stream_state,
struct bt_ctf_clock_value *cur_begin,
}
static
-int ensure_stream_state_exists(struct bt_notification_iterator *iterator,
+int ensure_stream_state_exists(
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *stream_begin_notif,
struct bt_ctf_stream *notif_stream,
struct stream_state **_stream_state)
}
static
-int handle_discarded_packets(struct bt_notification_iterator *iterator,
+int handle_discarded_packets(
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_ctf_packet *packet,
struct bt_ctf_clock_value *ts_begin,
struct bt_ctf_clock_value *ts_end,
}
static
-int handle_discarded_events(struct bt_notification_iterator *iterator,
+int handle_discarded_events(
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_ctf_packet *packet,
struct bt_ctf_clock_value *ts_begin,
struct bt_ctf_clock_value *ts_end,
}
static
-int handle_discarded_elements(struct bt_notification_iterator *iterator,
+int handle_discarded_elements(
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_ctf_packet *packet, struct stream_state *stream_state)
{
struct bt_ctf_clock_value *ts_begin = NULL;
}
static
-int handle_packet_switch(struct bt_notification_iterator *iterator,
+int handle_packet_switch(
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *packet_begin_notif,
struct bt_ctf_packet *new_packet,
struct stream_state *stream_state)
static
int handle_notif_stream_begin(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *notif,
struct bt_ctf_stream *notif_stream)
{
static
int handle_notif_stream_end(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *notif,
struct bt_ctf_stream *notif_stream)
{
static
int handle_notif_discarded_elements(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *notif,
struct bt_ctf_stream *notif_stream)
{
static
int handle_notif_packet_begin(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *notif,
struct bt_ctf_stream *notif_stream,
struct bt_ctf_packet *notif_packet)
static
int handle_notif_packet_end(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *notif,
struct bt_ctf_stream *notif_stream,
struct bt_ctf_packet *notif_packet)
static
int handle_notif_event(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *notif,
struct bt_ctf_stream *notif_stream,
struct bt_ctf_packet *notif_packet)
static
int enqueue_notification_and_automatic(
- struct bt_notification_iterator *iterator,
+ struct bt_notification_iterator_private_connection *iterator,
struct bt_notification *notif)
{
int ret = 0;
}
static
-int handle_end(struct bt_notification_iterator *iterator)
+int handle_end(struct bt_notification_iterator_private_connection *iterator)
{
GHashTableIter stream_state_iter;
gpointer stream_gptr, stream_state_gptr;
static
enum bt_notification_iterator_status ensure_queue_has_notifications(
- struct bt_notification_iterator *iterator)
+ struct bt_notification_iterator_private_connection *iterator)
{
- struct bt_private_notification_iterator *priv_iterator =
- bt_private_notification_iterator_from_notification_iterator(iterator);
+ struct bt_private_connection_private_notification_iterator *priv_iterator =
+ bt_private_connection_private_notification_iterator_from_notification_iterator(iterator);
bt_component_class_notification_iterator_next_method next_method = NULL;
- struct bt_notification_iterator_next_return next_return = {
+ struct bt_notification_iterator_next_method_return next_return = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
.notification = NULL,
};
BT_LOGD("Ensuring that notification iterator's queue has at least one notification: "
"iter-addr=%p, queue-size=%u, iter-state=%s",
iterator, iterator->queue->length,
- bt_notification_iterator_state_string(iterator->state));
+ bt_private_connection_notification_iterator_state_string(iterator->state));
if (iterator->queue->length > 0) {
/*
}
switch (iterator->state) {
- case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
- case BT_NOTIFICATION_ITERATOR_STATE_FINALIZED:
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED:
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED:
BT_LOGD_STR("Notification iterator's \"next\" called, but it is finalized.");
status = BT_NOTIFICATION_ITERATOR_STATUS_CANCELED;
goto end;
- case BT_NOTIFICATION_ITERATOR_STATE_ENDED:
+ case BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED:
BT_LOGD_STR("Notification iterator is ended.");
status = BT_NOTIFICATION_ITERATOR_STATUS_END;
goto end;
goto end;
}
- if (iterator->state == BT_NOTIFICATION_ITERATOR_STATE_FINALIZED ||
- iterator->state == BT_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED) {
+ if (iterator->state == BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED ||
+ iterator->state == BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_FINALIZED_AND_ENDED) {
/*
* The user's "next" method, somehow, cancelled
* its own notification iterator. This can
}
assert(iterator->state ==
- BT_NOTIFICATION_ITERATOR_STATE_ACTIVE);
- iterator->state = BT_NOTIFICATION_ITERATOR_STATE_ENDED;
+ BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ACTIVE);
+ iterator->state = BT_PRIVATE_CONNECTION_NOTIFICATION_ITERATOR_STATE_ENDED;
if (iterator->queue->length == 0) {
status = BT_NOTIFICATION_ITERATOR_STATUS_END;
BT_LOGD("Notification iterator's \"next\": iter-addr=%p", iterator);
- /*
- * Make sure that the iterator's queue contains at least one
- * notification.
- */
- status = ensure_queue_has_notifications(iterator);
- if (status != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
- /* Not an error */
- goto end;
- }
+ switch (iterator->type) {
+ case BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION:
+ {
+ struct bt_notification_iterator_private_connection *priv_conn_iter =
+ (void *) iterator;
- /*
- * Move the notification at the tail of the queue to the
- * iterator's current notification.
- */
- assert(iterator->queue->length > 0);
- bt_put(iterator->current_notification);
- iterator->current_notification = g_queue_pop_tail(iterator->queue);
- assert(iterator->current_notification);
+ /*
+ * Make sure that the iterator's queue contains at least
+ * one notification.
+ */
+ status = ensure_queue_has_notifications(priv_conn_iter);
+ if (status != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
+ goto end;
+ }
+
+ /*
+ * Move the notification at the tail of the queue to the
+ * iterator's current notification.
+ */
+ assert(priv_conn_iter->queue->length > 0);
+ bt_put(priv_conn_iter->current_notification);
+ priv_conn_iter->current_notification =
+ g_queue_pop_tail(priv_conn_iter->queue);
+ assert(priv_conn_iter->current_notification);
+ break;
+ }
+ default:
+ BT_LOGF("Unknown notification iterator type: addr=%p, type=%d",
+ iterator, iterator->type);
+ abort();
+ }
end:
return status;
}
-struct bt_component *bt_notification_iterator_get_component(
+struct bt_component *bt_private_connection_notification_iterator_get_component(
struct bt_notification_iterator *iterator)
{
- return bt_get(iterator->upstream_component);
+ struct bt_component *comp = NULL;
+ struct bt_notification_iterator_private_connection *iter_priv_conn;
+
+ if (!iterator) {
+ BT_LOGW_STR("Invalid parameter: notification iterator is NULL.");
+ goto end;
+ }
+
+ if (iterator->type != BT_NOTIFICATION_ITERATOR_TYPE_PRIVATE_CONNECTION) {
+ BT_LOGW_STR("Invalid parameter: notification iterator was not created from a private connection.");
+ goto end;
+ }
+
+ iter_priv_conn = (void *) iterator;
+ comp = bt_get(iter_priv_conn->upstream_component);
+
+end:
+ return comp;
}
struct bt_private_component *
-bt_private_notification_iterator_get_private_component(
- struct bt_private_notification_iterator *private_iterator)
+bt_private_connection_private_notification_iterator_get_private_component(
+ struct bt_private_connection_private_notification_iterator *private_iterator)
{
return bt_private_component_from_component(
- bt_notification_iterator_get_component(
- bt_notification_iterator_from_private(private_iterator)));
+ bt_private_connection_notification_iterator_get_component(
+ (void *) bt_private_connection_notification_iterator_from_private(private_iterator)));
}
const char *object, struct bt_value *params,
struct bt_value **user_result)
{
- struct bt_component_class_query_return ret = {
+ struct bt_component_class_query_method_return ret = {
.result = NULL,
.status = BT_QUERY_STATUS_OK,
};
bt_component_class_accept_port_connection_method accept_port_connection_method;
bt_component_class_port_connected_method port_connected_method;
bt_component_class_port_disconnected_method port_disconnected_method;
- struct bt_component_class_iterator_methods iterator_methods;
+ struct bt_component_class_notification_iterator_methods iterator_methods;
};
enum bt_plugin_status status = BT_PLUGIN_STATUS_OK;
}
BT_HIDDEN
-struct bt_notification_iterator_next_return ctf_fs_ds_file_next(
+struct bt_notification_iterator_next_method_return ctf_fs_ds_file_next(
struct ctf_fs_ds_file *ds_file)
{
enum bt_ctf_notif_iter_status notif_iter_status;
- struct bt_notification_iterator_next_return ret = {
+ struct bt_notification_iterator_next_method_return ret = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR,
.notification = NULL,
};
void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream);
BT_HIDDEN
-struct bt_notification_iterator_next_return ctf_fs_ds_file_next(
+struct bt_notification_iterator_next_method_return ctf_fs_ds_file_next(
struct ctf_fs_ds_file *stream);
BT_HIDDEN
#include <babeltrace/graph/private-port.h>
#include <babeltrace/graph/private-component.h>
#include <babeltrace/graph/private-component-source.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/component.h>
#include <babeltrace/graph/notification-iterator.h>
#include <babeltrace/graph/clock-class-priority-map.h>
g_free(notif_iter_data);
}
-struct bt_notification_iterator_next_return ctf_fs_iterator_next(
- struct bt_private_notification_iterator *iterator)
+struct bt_notification_iterator_next_method_return ctf_fs_iterator_next(
+ struct bt_private_connection_private_notification_iterator *iterator)
{
- struct bt_notification_iterator_next_return next_ret;
+ struct bt_notification_iterator_next_method_return next_ret;
struct ctf_fs_notif_iter_data *notif_iter_data =
- bt_private_notification_iterator_get_user_data(iterator);
+ bt_private_connection_private_notification_iterator_get_user_data(iterator);
int ret;
assert(notif_iter_data->ds_file);
return next_ret;
}
-void ctf_fs_iterator_finalize(struct bt_private_notification_iterator *it)
+void ctf_fs_iterator_finalize(struct bt_private_connection_private_notification_iterator *it)
{
void *notif_iter_data =
- bt_private_notification_iterator_get_user_data(it);
+ bt_private_connection_private_notification_iterator_get_user_data(it);
ctf_fs_notif_iter_data_destroy(notif_iter_data);
}
enum bt_notification_iterator_status ctf_fs_iterator_init(
- struct bt_private_notification_iterator *it,
+ struct bt_private_connection_private_notification_iterator *it,
struct bt_private_port *port)
{
struct ctf_fs_port_data *port_data;
goto error;
}
- ret = bt_private_notification_iterator_set_user_data(it, notif_iter_data);
+ ret = bt_private_connection_private_notification_iterator_set_user_data(it, notif_iter_data);
if (ret != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
goto error;
}
goto end;
error:
- (void) bt_private_notification_iterator_set_user_data(it, NULL);
+ (void) bt_private_connection_private_notification_iterator_set_user_data(it, NULL);
end:
ctf_fs_notif_iter_data_destroy(notif_iter_data);
}
BT_HIDDEN
-struct bt_component_class_query_return ctf_fs_query(
+struct bt_component_class_query_method_return ctf_fs_query(
struct bt_component_class *comp_class,
struct bt_query_executor *query_exec,
const char *object, struct bt_value *params)
{
- struct bt_component_class_query_return ret = {
+ struct bt_component_class_query_method_return ret = {
.result = NULL,
.status = BT_QUERY_STATUS_OK,
};
void ctf_fs_finalize(struct bt_private_component *component);
BT_HIDDEN
-struct bt_component_class_query_return ctf_fs_query(
+struct bt_component_class_query_method_return ctf_fs_query(
struct bt_component_class *comp_class,
struct bt_query_executor *query_exec,
const char *object, struct bt_value *params);
BT_HIDDEN
enum bt_notification_iterator_status ctf_fs_iterator_init(
- struct bt_private_notification_iterator *it,
+ struct bt_private_connection_private_notification_iterator *it,
struct bt_private_port *port);
BT_HIDDEN
-void ctf_fs_iterator_finalize(struct bt_private_notification_iterator *it);
+void ctf_fs_iterator_finalize(struct bt_private_connection_private_notification_iterator *it);
BT_HIDDEN
-struct bt_notification_iterator_next_return ctf_fs_iterator_next(
- struct bt_private_notification_iterator *iterator);
+struct bt_notification_iterator_next_method_return ctf_fs_iterator_next(
+ struct bt_private_connection_private_notification_iterator *iterator);
#endif /* BABELTRACE_PLUGIN_CTF_FS_H */
};
BT_HIDDEN
-struct bt_component_class_query_return metadata_info_query(
+struct bt_component_class_query_method_return metadata_info_query(
struct bt_component_class *comp_class,
struct bt_value *params)
{
- struct bt_component_class_query_return query_ret = {
+ struct bt_component_class_query_method_return query_ret = {
.result = NULL,
.status = BT_QUERY_STATUS_OK,
};
}
BT_HIDDEN
-struct bt_component_class_query_return trace_info_query(
+struct bt_component_class_query_method_return trace_info_query(
struct bt_component_class *comp_class,
struct bt_value *params)
{
- struct bt_component_class_query_return query_ret = {
+ struct bt_component_class_query_method_return query_ret = {
.result = NULL,
.status = BT_QUERY_STATUS_OK,
};
#include <babeltrace/graph/component-class.h>
BT_HIDDEN
-struct bt_component_class_query_return metadata_info_query(
+struct bt_component_class_query_method_return metadata_info_query(
struct bt_component_class *comp_class,
struct bt_value *params);
BT_HIDDEN
-struct bt_component_class_query_return trace_info_query(
+struct bt_component_class_query_method_return trace_info_query(
struct bt_component_class *comp_class,
struct bt_value *params);
enum bt_component_status lttng_live_component_init(struct bt_private_component *source,
struct bt_value *params, void *init_method_data);
-struct bt_component_class_query_return lttng_live_query(
+struct bt_component_class_query_method_return lttng_live_query(
struct bt_component_class *comp_class,
struct bt_query_executor *query_exec,
const char *object, struct bt_value *params);
void lttng_live_component_finalize(struct bt_private_component *component);
-struct bt_notification_iterator_next_return lttng_live_iterator_next(
- struct bt_private_notification_iterator *iterator);
+struct bt_notification_iterator_next_method_return lttng_live_iterator_next(
+ struct bt_private_connection_private_notification_iterator *iterator);
enum bt_component_status lttng_live_accept_port_connection(
struct bt_private_component *private_component,
struct bt_port *other_port);
enum bt_notification_iterator_status lttng_live_iterator_init(
- struct bt_private_notification_iterator *it,
+ struct bt_private_connection_private_notification_iterator *it,
struct bt_private_port *port);
-void lttng_live_iterator_finalize(struct bt_private_notification_iterator *it);
+void lttng_live_iterator_finalize(struct bt_private_connection_private_notification_iterator *it);
int lttng_live_create_viewer_session(struct lttng_live_component *lttng_live);
int lttng_live_attach_session(struct lttng_live_session *session);
#include <babeltrace/graph/port.h>
#include <babeltrace/graph/private-component.h>
#include <babeltrace/graph/private-component-source.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/notification-stream.h>
#include <babeltrace/graph/notification-packet.h>
#include <babeltrace/graph/notification-event.h>
}
BT_HIDDEN
-void lttng_live_iterator_finalize(struct bt_private_notification_iterator *it)
+void lttng_live_iterator_finalize(struct bt_private_connection_private_notification_iterator *it)
{
struct lttng_live_stream_iterator_generic *s =
- bt_private_notification_iterator_get_user_data(it);
+ bt_private_connection_private_notification_iterator_get_user_data(it);
switch (s->type) {
case LIVE_STREAM_TYPE_NO_STREAM:
* When disconnected from relayd: try to re-connect endlessly.
*/
static
-struct bt_notification_iterator_next_return lttng_live_iterator_next_stream(
- struct bt_private_notification_iterator *iterator,
+struct bt_notification_iterator_next_method_return lttng_live_iterator_next_stream(
+ struct bt_private_connection_private_notification_iterator *iterator,
struct lttng_live_stream_iterator *stream_iter)
{
enum bt_ctf_lttng_live_iterator_status status;
- struct bt_notification_iterator_next_return next_return;
+ struct bt_notification_iterator_next_method_return next_return;
struct lttng_live_component *lttng_live;
lttng_live = stream_iter->trace->session->lttng_live;
}
static
-struct bt_notification_iterator_next_return lttng_live_iterator_next_no_stream(
- struct bt_private_notification_iterator *iterator,
+struct bt_notification_iterator_next_method_return lttng_live_iterator_next_no_stream(
+ struct bt_private_connection_private_notification_iterator *iterator,
struct lttng_live_no_stream_iterator *no_stream_iter)
{
enum bt_ctf_lttng_live_iterator_status status;
- struct bt_notification_iterator_next_return next_return;
+ struct bt_notification_iterator_next_method_return next_return;
struct lttng_live_component *lttng_live;
lttng_live = no_stream_iter->lttng_live;
}
BT_HIDDEN
-struct bt_notification_iterator_next_return lttng_live_iterator_next(
- struct bt_private_notification_iterator *iterator)
+struct bt_notification_iterator_next_method_return lttng_live_iterator_next(
+ struct bt_private_connection_private_notification_iterator *iterator)
{
struct lttng_live_stream_iterator_generic *s =
- bt_private_notification_iterator_get_user_data(iterator);
- struct bt_notification_iterator_next_return next_return;
+ bt_private_connection_private_notification_iterator_get_user_data(iterator);
+ struct bt_notification_iterator_next_method_return next_return;
switch (s->type) {
case LIVE_STREAM_TYPE_NO_STREAM:
BT_HIDDEN
enum bt_notification_iterator_status lttng_live_iterator_init(
- struct bt_private_notification_iterator *it,
+ struct bt_private_connection_private_notification_iterator *it,
struct bt_private_port *port)
{
enum bt_notification_iterator_status ret =
{
struct lttng_live_no_stream_iterator *no_stream_iter =
container_of(s, struct lttng_live_no_stream_iterator, p);
- ret = bt_private_notification_iterator_set_user_data(it, no_stream_iter);
+ ret = bt_private_connection_private_notification_iterator_set_user_data(it, no_stream_iter);
if (ret) {
goto error;
}
{
struct lttng_live_stream_iterator *stream_iter =
container_of(s, struct lttng_live_stream_iterator, p);
- ret = bt_private_notification_iterator_set_user_data(it, stream_iter);
+ ret = bt_private_connection_private_notification_iterator_set_user_data(it, stream_iter);
if (ret) {
goto error;
}
end:
return ret;
error:
- if (bt_private_notification_iterator_set_user_data(it, NULL)
+ if (bt_private_connection_private_notification_iterator_set_user_data(it, NULL)
!= BT_NOTIFICATION_ITERATOR_STATUS_OK) {
BT_LOGE("Error setting private data to NULL");
}
}
static
-struct bt_component_class_query_return lttng_live_query_list_sessions(
+struct bt_component_class_query_method_return lttng_live_query_list_sessions(
struct bt_component_class *comp_class,
struct bt_query_executor *query_exec,
struct bt_value *params)
{
- struct bt_component_class_query_return query_ret = {
+ struct bt_component_class_query_method_return query_ret = {
.result = NULL,
.status = BT_QUERY_STATUS_OK,
};
}
BT_HIDDEN
-struct bt_component_class_query_return lttng_live_query(
+struct bt_component_class_query_method_return lttng_live_query(
struct bt_component_class *comp_class,
struct bt_query_executor *query_exec,
const char *object, struct bt_value *params)
{
- struct bt_component_class_query_return ret = {
+ struct bt_component_class_query_method_return ret = {
.result = NULL,
.status = BT_QUERY_STATUS_OK,
};
#include "logging.h"
#include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/connection.h>
#include <babeltrace/graph/notification.h>
#include <babeltrace/graph/notification-event.h>
}
static
-void debug_info_iterator_destroy(struct bt_private_notification_iterator *it)
+void debug_info_iterator_destroy(struct bt_private_connection_private_notification_iterator *it)
{
struct debug_info_iterator *it_data;
- it_data = bt_private_notification_iterator_get_user_data(it);
+ it_data = bt_private_connection_private_notification_iterator_get_user_data(it);
assert(it_data);
if (it_data->input_iterator_group) {
}
static
-struct bt_notification_iterator_next_return debug_info_iterator_next(
- struct bt_private_notification_iterator *iterator)
+struct bt_notification_iterator_next_method_return debug_info_iterator_next(
+ struct bt_private_connection_private_notification_iterator *iterator)
{
struct debug_info_iterator *debug_it = NULL;
struct bt_private_component *component = NULL;
struct debug_info_component *debug_info = NULL;
struct bt_notification_iterator *source_it = NULL;
struct bt_notification *notification;
- struct bt_notification_iterator_next_return ret = {
+ struct bt_notification_iterator_next_method_return ret = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
.notification = NULL,
};
- debug_it = bt_private_notification_iterator_get_user_data(iterator);
+ debug_it = bt_private_connection_private_notification_iterator_get_user_data(iterator);
assert(debug_it);
- component = bt_private_notification_iterator_get_private_component(iterator);
+ component = bt_private_connection_private_notification_iterator_get_private_component(iterator);
assert(component);
debug_info = bt_private_component_get_user_data(component);
assert(debug_info);
static
enum bt_notification_iterator_status debug_info_iterator_init(
- struct bt_private_notification_iterator *iterator,
+ struct bt_private_connection_private_notification_iterator *iterator,
struct bt_private_port *port)
{
enum bt_notification_iterator_status ret =
enum bt_connection_status conn_status;
struct bt_private_connection *connection = NULL;
struct bt_private_component *component =
- bt_private_notification_iterator_get_private_component(iterator);
+ bt_private_connection_private_notification_iterator_get_private_component(iterator);
struct debug_info_iterator *it_data = g_new0(struct debug_info_iterator, 1);
struct bt_private_port *input_port;
it_data->trace_map = g_hash_table_new_full(g_direct_hash,
g_direct_equal, NULL, (GDestroyNotify) unref_trace);
- it_ret = bt_private_notification_iterator_set_user_data(iterator, it_data);
+ it_ret = bt_private_connection_private_notification_iterator_set_user_data(iterator, it_data);
if (it_ret) {
goto end;
}
BT_HIDDEN
enum bt_notification_iterator_status dmesg_notif_iter_init(
- struct bt_private_notification_iterator *priv_notif_iter,
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter,
struct bt_private_port *priv_port)
{
struct bt_private_component *priv_comp = NULL;
goto error;
}
- priv_comp = bt_private_notification_iterator_get_private_component(
+ priv_comp = bt_private_connection_private_notification_iterator_get_private_component(
priv_notif_iter);
assert(priv_comp);
dmesg_comp = bt_private_component_get_user_data(priv_comp);
}
}
- (void) bt_private_notification_iterator_set_user_data(priv_notif_iter,
+ (void) bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
dmesg_notif_iter);
goto end;
error:
destroy_dmesg_notif_iter(dmesg_notif_iter);
- (void) bt_private_notification_iterator_set_user_data(priv_notif_iter,
+ (void) bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
NULL);
if (status >= 0) {
status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR;
BT_HIDDEN
void dmesg_notif_iter_finalize(
- struct bt_private_notification_iterator *priv_notif_iter)
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter)
{
- destroy_dmesg_notif_iter(bt_private_notification_iterator_get_user_data(
+ destroy_dmesg_notif_iter(bt_private_connection_private_notification_iterator_get_user_data(
priv_notif_iter));
}
BT_HIDDEN
-struct bt_notification_iterator_next_return dmesg_notif_iter_next(
- struct bt_private_notification_iterator *priv_notif_iter)
+struct bt_notification_iterator_next_method_return dmesg_notif_iter_next(
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter)
{
ssize_t len;
struct dmesg_notif_iter *dmesg_notif_iter =
- bt_private_notification_iterator_get_user_data(
+ bt_private_connection_private_notification_iterator_get_user_data(
priv_notif_iter);
struct dmesg_component *dmesg_comp;
- struct bt_notification_iterator_next_return next_ret = {
+ struct bt_notification_iterator_next_method_return next_ret = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
.notification = NULL
};
BT_HIDDEN
enum bt_notification_iterator_status dmesg_notif_iter_init(
- struct bt_private_notification_iterator *priv_notif_iter,
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter,
struct bt_private_port *priv_port);
BT_HIDDEN
void dmesg_notif_iter_finalize(
- struct bt_private_notification_iterator *priv_notif_iter);
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter);
BT_HIDDEN
-struct bt_notification_iterator_next_return dmesg_notif_iter_next(
- struct bt_private_notification_iterator *priv_notif_iter);
+struct bt_notification_iterator_next_method_return dmesg_notif_iter_next(
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter);
#endif /* BABELTRACE_PLUGIN_TEXT_DMESG_DMESG_H */
#include <babeltrace/graph/private-component.h>
#include <babeltrace/graph/private-component.h>
#include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/private-port.h>
#include <babeltrace/graph/connection.h>
#include <babeltrace/graph/connection-internal.h>
#define ASSUME_ABSOLUTE_CLOCK_CLASSES_PARAM_NAME "assume-absolute-clock-classes"
struct muxer_comp {
- /* Array of struct bt_private_notification_iterator * (weak refs) */
+ /*
+ * Array of struct
+ * bt_private_connection_private_notification_iterator *
+ * (weak refs)
+ */
GPtrArray *muxer_notif_iters;
/* Weak ref */
GList *newly_connected_priv_ports;
/* Next thing to return by the "next" method */
- struct bt_notification_iterator_next_return next_next_return;
+ struct bt_notification_iterator_next_method_return next_next_return;
/* Last time returned in a notification */
int64_t last_returned_ts_ns;
}
static
-struct bt_notification_iterator_next_return muxer_notif_iter_do_next(
+struct bt_notification_iterator_next_method_return muxer_notif_iter_do_next(
struct muxer_comp *muxer_comp,
struct muxer_notif_iter *muxer_notif_iter)
{
struct muxer_upstream_notif_iter *muxer_upstream_notif_iter = NULL;
- struct bt_notification_iterator_next_return next_return = {
+ struct bt_notification_iterator_next_method_return next_return = {
.notification = NULL,
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
};
BT_HIDDEN
enum bt_notification_iterator_status muxer_notif_iter_init(
- struct bt_private_notification_iterator *priv_notif_iter,
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter,
struct bt_private_port *output_priv_port)
{
struct muxer_comp *muxer_comp = NULL;
BT_NOTIFICATION_ITERATOR_STATUS_OK;
int ret;
- priv_comp = bt_private_notification_iterator_get_private_component(
+ priv_comp = bt_private_connection_private_notification_iterator_get_private_component(
priv_notif_iter);
assert(priv_comp);
muxer_comp = bt_private_component_get_user_data(priv_comp);
goto error;
}
- ret = bt_private_notification_iterator_set_user_data(priv_notif_iter,
+ ret = bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
muxer_notif_iter);
assert(ret == 0);
BT_LOGD("Initialized muxer component's notification iterator: "
}
destroy_muxer_notif_iter(muxer_notif_iter);
- ret = bt_private_notification_iterator_set_user_data(priv_notif_iter,
+ ret = bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
NULL);
assert(ret == 0);
status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR;
BT_HIDDEN
void muxer_notif_iter_finalize(
- struct bt_private_notification_iterator *priv_notif_iter)
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter)
{
struct muxer_notif_iter *muxer_notif_iter =
- bt_private_notification_iterator_get_user_data(priv_notif_iter);
+ bt_private_connection_private_notification_iterator_get_user_data(priv_notif_iter);
struct bt_private_component *priv_comp = NULL;
struct muxer_comp *muxer_comp = NULL;
- priv_comp = bt_private_notification_iterator_get_private_component(
+ priv_comp = bt_private_connection_private_notification_iterator_get_private_component(
priv_notif_iter);
assert(priv_comp);
muxer_comp = bt_private_component_get_user_data(priv_comp);
}
BT_HIDDEN
-struct bt_notification_iterator_next_return muxer_notif_iter_next(
- struct bt_private_notification_iterator *priv_notif_iter)
+struct bt_notification_iterator_next_method_return muxer_notif_iter_next(
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter)
{
- struct bt_notification_iterator_next_return next_ret;
+ struct bt_notification_iterator_next_method_return next_ret;
struct muxer_notif_iter *muxer_notif_iter =
- bt_private_notification_iterator_get_user_data(priv_notif_iter);
+ bt_private_connection_private_notification_iterator_get_user_data(priv_notif_iter);
struct bt_private_component *priv_comp = NULL;
struct muxer_comp *muxer_comp = NULL;
assert(muxer_notif_iter);
- priv_comp = bt_private_notification_iterator_get_private_component(
+ priv_comp = bt_private_connection_private_notification_iterator_get_private_component(
priv_notif_iter);
assert(priv_comp);
muxer_comp = bt_private_component_get_user_data(priv_comp);
BT_HIDDEN
enum bt_notification_iterator_status muxer_notif_iter_init(
- struct bt_private_notification_iterator *priv_notif_iter,
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter,
struct bt_private_port *priv_port);
BT_HIDDEN
void muxer_notif_iter_finalize(
- struct bt_private_notification_iterator *priv_notif_iter);
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter);
BT_HIDDEN
-struct bt_notification_iterator_next_return muxer_notif_iter_next(
- struct bt_private_notification_iterator *priv_notif_iter);
+struct bt_notification_iterator_next_method_return muxer_notif_iter_next(
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter);
BT_HIDDEN
void muxer_port_connected(
#include <babeltrace/compat/time-internal.h>
#include <babeltrace/compat/utc-internal.h>
#include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/notification.h>
#include <babeltrace/graph/notification-event.h>
#include <babeltrace/graph/notification-stream.h>
}
BT_HIDDEN
-void trimmer_iterator_finalize(struct bt_private_notification_iterator *it)
+void trimmer_iterator_finalize(struct bt_private_connection_private_notification_iterator *it)
{
struct trimmer_iterator *trim_it;
- trim_it = bt_private_notification_iterator_get_user_data(it);
+ trim_it = bt_private_connection_private_notification_iterator_get_user_data(it);
assert(trim_it);
bt_put(trim_it->input_iterator);
BT_HIDDEN
enum bt_notification_iterator_status trimmer_iterator_init(
- struct bt_private_notification_iterator *iterator,
+ struct bt_private_connection_private_notification_iterator *iterator,
struct bt_private_port *port)
{
enum bt_notification_iterator_status ret =
struct bt_private_port *input_port = NULL;
struct bt_private_connection *connection = NULL;
struct bt_private_component *component =
- bt_private_notification_iterator_get_private_component(iterator);
+ bt_private_connection_private_notification_iterator_get_private_component(iterator);
struct trimmer_iterator *it_data = g_new0(struct trimmer_iterator, 1);
static const enum bt_notification_type notif_types[] = {
BT_NOTIFICATION_TYPE_EVENT,
it_data->packet_map = g_hash_table_new_full(g_direct_hash,
g_direct_equal, NULL, NULL);
- it_ret = bt_private_notification_iterator_set_user_data(iterator,
+ it_ret = bt_private_connection_private_notification_iterator_set_user_data(iterator,
it_data);
if (it_ret) {
goto end;
}
BT_HIDDEN
-struct bt_notification_iterator_next_return trimmer_iterator_next(
- struct bt_private_notification_iterator *iterator)
+struct bt_notification_iterator_next_method_return trimmer_iterator_next(
+ struct bt_private_connection_private_notification_iterator *iterator)
{
struct trimmer_iterator *trim_it = NULL;
struct bt_private_component *component = NULL;
struct trimmer *trimmer = NULL;
struct bt_notification_iterator *source_it = NULL;
- struct bt_notification_iterator_next_return ret = {
+ struct bt_notification_iterator_next_method_return ret = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
.notification = NULL,
};
bool notification_in_range = false;
- trim_it = bt_private_notification_iterator_get_user_data(iterator);
+ trim_it = bt_private_connection_private_notification_iterator_get_user_data(iterator);
assert(trim_it);
- component = bt_private_notification_iterator_get_private_component(
+ component = bt_private_connection_private_notification_iterator_get_private_component(
iterator);
assert(component);
trimmer = bt_private_component_get_user_data(component);
BT_HIDDEN
enum bt_notification_iterator_status trimmer_iterator_init(
- struct bt_private_notification_iterator *iterator,
+ struct bt_private_connection_private_notification_iterator *iterator,
struct bt_private_port *port);
BT_HIDDEN
-void trimmer_iterator_finalize(struct bt_private_notification_iterator *it);
+void trimmer_iterator_finalize(struct bt_private_connection_private_notification_iterator *it);
BT_HIDDEN
-struct bt_notification_iterator_next_return trimmer_iterator_next(
- struct bt_private_notification_iterator *iterator);
+struct bt_notification_iterator_next_method_return trimmer_iterator_next(
+ struct bt_private_connection_private_notification_iterator *iterator);
#endif /* BABELTRACE_PLUGIN_TRIMMER_ITERATOR_H */
#include <babeltrace/graph/component-filter.h>
#include <babeltrace/graph/notification.h>
#include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/private-component-filter.h>
#include <babeltrace/graph/notification-event.h>
#include <plugins-common.h>
}
static enum bt_notification_iterator_status dummy_iterator_init_method(
- struct bt_private_notification_iterator *private_iterator,
+ struct bt_private_connection_private_notification_iterator *private_iterator,
struct bt_private_port *private_port)
{
return BT_NOTIFICATION_ITERATOR_STATUS_OK;
}
static void dummy_iterator_finalize_method(
- struct bt_private_notification_iterator *private_iterator)
+ struct bt_private_connection_private_notification_iterator *private_iterator)
{
}
-static struct bt_notification_iterator_next_return dummy_iterator_next_method(
- struct bt_private_notification_iterator *private_iterator)
+static struct bt_notification_iterator_next_method_return dummy_iterator_next_method(
+ struct bt_private_connection_private_notification_iterator *private_iterator)
{
- struct bt_notification_iterator_next_return next_return = {
+ struct bt_notification_iterator_next_method_return next_return = {
.notification = NULL,
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
};
return next_return;
}
-static struct bt_component_class_query_return query_method(
+static struct bt_component_class_query_method_return query_method(
struct bt_component_class *component_class,
struct bt_query_executor *query_exec,
const char *object, struct bt_value *params)
{
- struct bt_component_class_query_return ret = {
+ struct bt_component_class_query_method_return ret = {
.status = BT_QUERY_STATUS_OK,
.result = bt_value_array_create(),
};
#include <babeltrace/graph/private-component-sink.h>
#include <babeltrace/graph/private-component.h>
#include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/private-port.h>
#include <babeltrace/plugin/plugin.h>
#include <babeltrace/ref.h>
static
void src_iter_finalize(
- struct bt_private_notification_iterator *private_notification_iterator)
+ struct bt_private_connection_private_notification_iterator *private_notification_iterator)
{
struct src_iter_user_data *user_data =
- bt_private_notification_iterator_get_user_data(
+ bt_private_connection_private_notification_iterator_get_user_data(
private_notification_iterator);
if (user_data) {
static
enum bt_notification_iterator_status src_iter_init(
- struct bt_private_notification_iterator *priv_notif_iter,
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter,
struct bt_private_port *private_port)
{
struct src_iter_user_data *user_data =
int ret;
assert(user_data);
- ret = bt_private_notification_iterator_set_user_data(priv_notif_iter,
+ ret = bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
user_data);
assert(ret == 0);
}
static
-struct bt_notification_iterator_next_return src_iter_next_seq(
+struct bt_notification_iterator_next_method_return src_iter_next_seq(
struct src_iter_user_data *user_data)
{
- struct bt_notification_iterator_next_return next_return = {
+ struct bt_notification_iterator_next_method_return next_return = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
};
int64_t cur_ts_ns;
}
static
-struct bt_notification_iterator_next_return src_iter_next(
- struct bt_private_notification_iterator *priv_iterator)
+struct bt_notification_iterator_next_method_return src_iter_next(
+ struct bt_private_connection_private_notification_iterator *priv_iterator)
{
- struct bt_notification_iterator_next_return next_return = {
+ struct bt_notification_iterator_next_method_return next_return = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
.notification = NULL,
};
struct src_iter_user_data *user_data =
- bt_private_notification_iterator_get_user_data(priv_iterator);
+ bt_private_connection_private_notification_iterator_get_user_data(priv_iterator);
assert(user_data);
next_return = src_iter_next_seq(user_data);
}
static
-struct bt_notification_iterator_next_return src_iter_next(
- struct bt_private_notification_iterator *priv_iterator)
+struct bt_notification_iterator_next_method_return src_iter_next(
+ struct bt_private_connection_private_notification_iterator *priv_iterator)
{
- struct bt_notification_iterator_next_return ret = {
+ struct bt_notification_iterator_next_method_return ret = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_ERROR,
};
#include <babeltrace/graph/private-component-sink.h>
#include <babeltrace/graph/private-component.h>
#include <babeltrace/graph/private-connection.h>
-#include <babeltrace/graph/private-notification-iterator.h>
+#include <babeltrace/graph/private-connection-private-notification-iterator.h>
#include <babeltrace/graph/private-port.h>
#include <babeltrace/plugin/plugin.h>
#include <babeltrace/ref.h>
static
void src_iter_finalize(
- struct bt_private_notification_iterator *private_notification_iterator)
+ struct bt_private_connection_private_notification_iterator *private_notification_iterator)
{
struct src_iter_user_data *user_data =
- bt_private_notification_iterator_get_user_data(
+ bt_private_connection_private_notification_iterator_get_user_data(
private_notification_iterator);
if (user_data) {
static
enum bt_notification_iterator_status src_iter_init(
- struct bt_private_notification_iterator *priv_notif_iter,
+ struct bt_private_connection_private_notification_iterator *priv_notif_iter,
struct bt_private_port *private_port)
{
struct src_iter_user_data *user_data =
assert(user_data);
assert(port);
- ret = bt_private_notification_iterator_set_user_data(priv_notif_iter,
+ ret = bt_private_connection_private_notification_iterator_set_user_data(priv_notif_iter,
user_data);
assert(ret == 0);
port_name = bt_port_get_name(port);
}
static
-struct bt_notification_iterator_next_return src_iter_next_seq(
+struct bt_notification_iterator_next_method_return src_iter_next_seq(
struct src_iter_user_data *user_data)
{
- struct bt_notification_iterator_next_return next_return = {
+ struct bt_notification_iterator_next_method_return next_return = {
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
};
int64_t cur_ts_ns;
}
static
-struct bt_notification_iterator_next_return src_iter_next(
- struct bt_private_notification_iterator *priv_iterator)
+struct bt_notification_iterator_next_method_return src_iter_next(
+ struct bt_private_connection_private_notification_iterator *priv_iterator)
{
- struct bt_notification_iterator_next_return next_return = {
+ struct bt_notification_iterator_next_method_return next_return = {
.notification = NULL,
.status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
};
struct src_iter_user_data *user_data =
- bt_private_notification_iterator_get_user_data(priv_iterator);
+ bt_private_connection_private_notification_iterator_get_user_data(priv_iterator);
struct bt_private_component *private_component =
- bt_private_notification_iterator_get_private_component(priv_iterator);
+ bt_private_connection_private_notification_iterator_get_private_component(priv_iterator);
int ret;
assert(user_data);