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
);
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
);
123 Sets the user data of the \bt_msg_iter \bt_p{self_message_iterator}
126 @param[in] self_message_iterator
127 Message iterator instance.
129 New user data of \bt_p{self_message_iterator}.
131 @bt_pre_not_null{self_message_iterator}
133 @sa bt_self_message_iterator_get_data() —
134 Returns the user data of a message iterator.
136 extern void bt_self_message_iterator_set_data(
137 bt_self_message_iterator
*self_message_iterator
,
142 Returns the user data of the \bt_msg_iter
143 \bt_p{self_message_iterator}.
145 @param[in] self_message_iterator
146 Message iterator instance.
149 User data of \bt_p{self_message_iterator}.
151 @bt_pre_not_null{self_message_iterator}
153 @sa bt_self_message_iterator_set_data() —
154 Sets the user data of a message iterator.
157 void *bt_self_message_iterator_get_data(
158 const bt_self_message_iterator
*self_message_iterator
);
163 @name Interruption query
169 Returns whether or not the \bt_msg_iter \bt_p{self_message_iterator}
170 is interrupted, that is, whether or not any of its \bt_p_intr
173 @param[in] self_message_iterator
174 Message iterator instance.
177 #BT_TRUE if \bt_p{self_message_iterator} is interrupted (any of its
178 interrupters is set).
180 @bt_pre_not_null{self_message_iterator}
182 @sa bt_graph_borrow_default_interrupter() —
183 Borrows a trace processing graph's default interrupter.
184 @sa bt_graph_add_interrupter() —
185 Adds an interrupter to a graph.
187 extern bt_bool
bt_self_message_iterator_is_interrupted(
188 const bt_self_message_iterator
*self_message_iterator
);
199 Sets whether or not the \bt_msg_iter of which the configuration
200 is \bt_p{configuration} can seek forward.
202 A message iterator can seek forward if all the \bt_p_msg of its
203 message sequence have some \bt_cs.
206 You can only call this function during the execution of a
208 \ref api-msg-iter-cls-meth-init "initialization method".
210 @param[in] configuration
211 Configuration of the message iterator of which to set whether or
212 not it can seek forward.
213 @param[in] can_seek_forward
214 #BT_TRUE to make the message iterator of which the configuration is
215 \bt_p{configuration} forward-seekable.
217 @bt_pre_not_null{configuration}
219 @sa bt_message_iterator_can_seek_forward() —
220 Returns whether or not a message iterator can seek forward.
222 extern void bt_self_message_iterator_configuration_set_can_seek_forward(
223 bt_self_message_iterator_configuration
*configuration
,
224 bt_bool can_seek_forward
);
234 #endif /* BABELTRACE2_GRAPH_SELF_MESSAGE_ITERATOR_H */