2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
7 #ifndef BABELTRACE2_GRAPH_SELF_MESSAGE_ITERATOR_H
8 #define BABELTRACE2_GRAPH_SELF_MESSAGE_ITERATOR_H
10 /* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
12 #ifndef __BT_IN_BABELTRACE_H
13 # error "Please include <babeltrace2/babeltrace.h> instead."
16 #include <babeltrace2/types.h>
23 @defgroup api-self-msg-iter Self message iterator
24 @ingroup api-msg-iter-cls
27 Private view of a \bt_msg_iter for methods.
29 The #bt_self_message_iterator type is a private view of a \bt_msg_iter
30 from within a \bt_msg_iter_cls method.
32 Borrow the \bt_comp which provides a message iterator with
33 bt_self_message_iterator_borrow_component().
35 Borrow the \bt_oport on which a message iterator operates with
36 bt_self_message_iterator_borrow_port().
38 Set and get user data attached to a message iterator with
39 bt_self_message_iterator_set_data() and
40 bt_self_message_iterator_get_data().
42 Check whether or not a message iterator is interrupted with
43 bt_self_message_iterator_is_interrupted().
45 Set whether or not a message iterator can seek forward with
46 bt_self_message_iterator_configuration_set_can_seek_forward().
55 @typedef struct bt_self_message_iterator bt_self_message_iterator;
60 @typedef struct bt_self_message_iterator_configuration bt_self_message_iterator_configuration;
63 Self \bt_msg_iter configuration.
69 @name Component access
75 Borrows the \bt_comp which provides the \bt_msg_iter
76 \bt_p{self_message_iterator}.
78 @param[in] self_message_iterator
79 Message iterator instance.
82 Component which provides \bt_p{self_message_iterator}.
84 @bt_pre_not_null{self_message_iterator}
86 extern bt_self_component
*
87 bt_self_message_iterator_borrow_component(
88 bt_self_message_iterator
*self_message_iterator
) __BT_NOEXCEPT
;
93 @name Output port access
99 Borrows the \bt_oport on which the \bt_msg_iter
100 \bt_p{self_message_iterator} operates.
102 @param[in] self_message_iterator
103 Message iterator instance.
106 Output port on which \bt_p{self_message_iterator} operates.
108 @bt_pre_not_null{self_message_iterator}
110 extern bt_self_component_port_output
*
111 bt_self_message_iterator_borrow_port(
112 bt_self_message_iterator
*self_message_iterator
)
124 Sets the user data of the \bt_msg_iter \bt_p{self_message_iterator}
127 @param[in] self_message_iterator
128 Message iterator instance.
130 New user data of \bt_p{self_message_iterator}.
132 @bt_pre_not_null{self_message_iterator}
134 @sa bt_self_message_iterator_get_data() —
135 Returns the user data of a message iterator.
137 extern void bt_self_message_iterator_set_data(
138 bt_self_message_iterator
*self_message_iterator
,
139 void *user_data
) __BT_NOEXCEPT
;
143 Returns the user data of the \bt_msg_iter
144 \bt_p{self_message_iterator}.
146 @param[in] self_message_iterator
147 Message iterator instance.
150 User data of \bt_p{self_message_iterator}.
152 @bt_pre_not_null{self_message_iterator}
154 @sa bt_self_message_iterator_set_data() —
155 Sets the user data of a message iterator.
158 void *bt_self_message_iterator_get_data(
159 const bt_self_message_iterator
*self_message_iterator
)
165 @name Interruption query
171 Returns whether or not the \bt_msg_iter \bt_p{self_message_iterator}
172 is interrupted, that is, whether or not any of its \bt_p_intr
175 @param[in] self_message_iterator
176 Message iterator instance.
179 #BT_TRUE if \bt_p{self_message_iterator} is interrupted (any of its
180 interrupters is set).
182 @bt_pre_not_null{self_message_iterator}
184 @sa bt_graph_borrow_default_interrupter() —
185 Borrows a trace processing graph's default interrupter.
186 @sa bt_graph_add_interrupter() —
187 Adds an interrupter to a graph.
189 extern bt_bool
bt_self_message_iterator_is_interrupted(
190 const bt_self_message_iterator
*self_message_iterator
)
202 Sets whether or not the \bt_msg_iter of which the configuration
203 is \bt_p{configuration} can seek forward.
205 A message iterator can seek forward if all the \bt_p_msg of its
206 message sequence have some \bt_cs.
209 You can only call this function during the execution of a
211 \ref api-msg-iter-cls-meth-init "initialization method".
213 @param[in] configuration
214 Configuration of the message iterator of which to set whether or
215 not it can seek forward.
216 @param[in] can_seek_forward
217 #BT_TRUE to make the message iterator of which the configuration is
218 \bt_p{configuration} forward-seekable.
220 @bt_pre_not_null{configuration}
222 @sa bt_message_iterator_can_seek_forward() —
223 Returns whether or not a message iterator can seek forward.
225 extern void bt_self_message_iterator_configuration_set_can_seek_forward(
226 bt_self_message_iterator_configuration
*configuration
,
227 bt_bool can_seek_forward
) __BT_NOEXCEPT
;
237 #endif /* BABELTRACE2_GRAPH_SELF_MESSAGE_ITERATOR_H */