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 #ifndef __BT_IN_BABELTRACE_H
11 # error "Please include <babeltrace2/babeltrace.h> instead."
14 #include <babeltrace2/types.h>
21 @defgroup api-self-msg-iter Self message iterator
22 @ingroup api-msg-iter-cls
25 Private view of a \bt_msg_iter for methods.
27 The #bt_self_message_iterator type is a private view of a \bt_msg_iter
28 from within a \bt_msg_iter_cls method.
30 Borrow the \bt_comp which provides a message iterator with
31 bt_self_message_iterator_borrow_component().
33 Borrow the \bt_oport on which a message iterator operates with
34 bt_self_message_iterator_borrow_port().
36 Set and get user data attached to a message iterator with
37 bt_self_message_iterator_set_data() and
38 bt_self_message_iterator_get_data().
40 Check whether or not a message iterator is interrupted with
41 bt_self_message_iterator_is_interrupted().
43 Set whether or not a message iterator can seek forward with
44 bt_self_message_iterator_configuration_set_can_seek_forward().
53 @typedef struct bt_self_message_iterator bt_self_message_iterator;
58 @typedef struct bt_self_message_iterator_configuration bt_self_message_iterator_configuration;
61 Self \bt_msg_iter configuration.
67 @name Component access
73 Borrows the \bt_comp which provides the \bt_msg_iter
74 \bt_p{self_message_iterator}.
76 @param[in] self_message_iterator
77 Message iterator instance.
80 Component which provides \bt_p{self_message_iterator}.
82 @bt_pre_not_null{self_message_iterator}
84 extern bt_self_component
*
85 bt_self_message_iterator_borrow_component(
86 bt_self_message_iterator
*self_message_iterator
);
91 @name Output port access
97 Borrows the \bt_oport on which the \bt_msg_iter
98 \bt_p{self_message_iterator} operates.
100 @param[in] self_message_iterator
101 Message iterator instance.
104 Output port on which \bt_p{self_message_iterator} operates.
106 @bt_pre_not_null{self_message_iterator}
108 extern bt_self_component_port_output
*
109 bt_self_message_iterator_borrow_port(
110 bt_self_message_iterator
*self_message_iterator
);
121 Sets the user data of the \bt_msg_iter \bt_p{self_message_iterator}
124 @param[in] self_message_iterator
125 Message iterator instance.
127 New user data of \bt_p{self_message_iterator}.
129 @bt_pre_not_null{self_message_iterator}
131 @sa bt_self_message_iterator_get_data() —
132 Returns the user data of a message iterator.
134 extern void bt_self_message_iterator_set_data(
135 bt_self_message_iterator
*self_message_iterator
,
140 Returns the user data of the \bt_msg_iter
141 \bt_p{self_message_iterator}.
143 @param[in] self_message_iterator
144 Message iterator instance.
147 User data of \bt_p{self_message_iterator}.
149 @bt_pre_not_null{self_message_iterator}
151 @sa bt_self_message_iterator_set_data() —
152 Sets the user data of a message iterator.
155 void *bt_self_message_iterator_get_data(
156 const bt_self_message_iterator
*self_message_iterator
);
161 @name Interruption query
167 Returns whether or not the \bt_msg_iter \bt_p{self_message_iterator}
168 is interrupted, that is, whether or not any of its \bt_p_intr
171 @param[in] self_message_iterator
172 Message iterator instance.
175 #BT_TRUE if \bt_p{self_message_iterator} is interrupted (any of its
176 interrupters is set).
178 @bt_pre_not_null{self_message_iterator}
180 @sa bt_graph_borrow_default_interrupter() —
181 Borrows a trace processing graph's default interrupter.
182 @sa bt_graph_add_interrupter() —
183 Adds an interrupter to a graph.
185 extern bt_bool
bt_self_message_iterator_is_interrupted(
186 const bt_self_message_iterator
*self_message_iterator
);
197 Sets whether or not the \bt_msg_iter of which the configuration
198 is \bt_p{configuration} can seek forward.
200 A message iterator can seek forward if all the \bt_p_msg of its
201 message sequence have some \bt_cs.
204 You can only call this function during the execution of a
206 \ref api-msg-iter-cls-meth-init "initialization method".
208 @param[in] configuration
209 Configuration of the message iterator of which to set whether or
210 not it can seek forward.
211 @param[in] can_seek_forward
212 #BT_TRUE to make the message iterator of which the configuration is
213 \bt_p{configuration} forward-seekable.
215 @bt_pre_not_null{configuration}
217 @sa bt_message_iterator_can_seek_forward() —
218 Returns whether or not a message iterator can seek forward.
220 extern void bt_self_message_iterator_configuration_set_can_seek_forward(
221 bt_self_message_iterator_configuration
*configuration
,
222 bt_bool can_seek_forward
);
232 #endif /* BABELTRACE2_GRAPH_SELF_MESSAGE_ITERATOR_H */