1 #ifndef BABELTRACE2_GRAPH_SELF_MESSAGE_ITERATOR_H
2 #define BABELTRACE2_GRAPH_SELF_MESSAGE_ITERATOR_H
5 * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 #ifndef __BT_IN_BABELTRACE_H
27 # error "Please include <babeltrace2/babeltrace.h> instead."
30 #include <babeltrace2/types.h>
37 @defgroup api-self-msg-iter Self message iterator
38 @ingroup api-msg-iter-cls
41 Private view of a \bt_msg_iter for methods.
43 The #bt_self_message_iterator type is a private view of a \bt_msg_iter
44 from within a \bt_msg_iter_cls method.
46 Borrow the \bt_comp which provides a message iterator with
47 bt_self_message_iterator_borrow_component().
49 Borrow the \bt_oport on which a message iterator operates with
50 bt_self_message_iterator_borrow_port().
52 Set and get user data attached to a message iterator with
53 bt_self_message_iterator_set_data() and
54 bt_self_message_iterator_get_data().
56 Check whether or not a message iterator is interrupted with
57 bt_self_message_iterator_is_interrupted().
59 Set whether or not a message iterator can seek forward with
60 bt_self_message_iterator_configuration_set_can_seek_forward().
69 @typedef struct bt_self_message_iterator bt_self_message_iterator;
74 @typedef struct bt_self_message_iterator_configuration bt_self_message_iterator_configuration;
77 Self \bt_msg_iter configuration.
83 @name Component access
89 Borrows the \bt_comp which provides the \bt_msg_iter
90 \bt_p{self_message_iterator}.
92 @param[in] self_message_iterator
93 Message iterator instance.
96 Component which provides \bt_p{self_message_iterator}.
98 @bt_pre_not_null{self_message_iterator}
100 extern bt_self_component
*
101 bt_self_message_iterator_borrow_component(
102 bt_self_message_iterator
*self_message_iterator
);
107 @name Output port access
113 Borrows the \bt_oport on which the \bt_msg_iter
114 \bt_p{self_message_iterator} operates.
116 @param[in] self_message_iterator
117 Message iterator instance.
120 Output port on which \bt_p{self_message_iterator} operates.
122 @bt_pre_not_null{self_message_iterator}
124 extern bt_self_component_port_output
*
125 bt_self_message_iterator_borrow_port(
126 bt_self_message_iterator
*self_message_iterator
);
137 Sets the user data of the \bt_msg_iter \bt_p{self_message_iterator}
140 @param[in] self_message_iterator
141 Message iterator instance.
143 New user data of \bt_p{self_message_iterator}.
145 @bt_pre_not_null{self_message_iterator}
147 @sa bt_self_message_iterator_get_data() —
148 Returns the user data of a message iterator.
150 extern void bt_self_message_iterator_set_data(
151 bt_self_message_iterator
*self_message_iterator
,
156 Returns the user data of the \bt_msg_iter
157 \bt_p{self_message_iterator}.
159 @param[in] self_message_iterator
160 Message iterator instance.
163 User data of \bt_p{self_message_iterator}.
165 @bt_pre_not_null{self_message_iterator}
167 @sa bt_self_message_iterator_set_data() —
168 Sets the user data of a message iterator.
171 void *bt_self_message_iterator_get_data(
172 const bt_self_message_iterator
*self_message_iterator
);
177 @name Interruption query
183 Returns whether or not the \bt_msg_iter \bt_p{self_message_iterator}
184 is interrupted, that is, whether or not any of its \bt_p_intr
187 @param[in] self_message_iterator
188 Message iterator instance.
191 #BT_TRUE if \bt_p{self_message_iterator} is interrupted (any of its
192 interrupters is set).
194 @bt_pre_not_null{self_message_iterator}
196 @sa bt_graph_borrow_default_interrupter() —
197 Borrows a trace processing graph's default interrupter.
198 @sa bt_graph_add_interrupter() —
199 Adds an interrupter to a graph.
201 extern bt_bool
bt_self_message_iterator_is_interrupted(
202 const bt_self_message_iterator
*self_message_iterator
);
213 Sets whether or not the \bt_msg_iter of which the configuration
214 is \bt_p{configuration} can seek forward.
216 A message iterator can seek forward if all the \bt_p_msg of its
217 message sequence have some \bt_cs.
220 You can only call this function during the execution of a
222 \ref api-msg-iter-cls-meth-init "initialization method".
224 @param[in] configuration
225 Configuration of the message iterator of which to set whether or
226 not it can seek forward.
227 @param[in] can_seek_forward
228 #BT_TRUE to make the message iterator of which the configuration is
229 \bt_p{configuration} forward-seekable.
231 @bt_pre_not_null{configuration}
233 @sa bt_message_iterator_can_seek_forward() —
234 Returns whether or not a message iterator can seek forward.
236 extern void bt_self_message_iterator_configuration_set_can_seek_forward(
237 bt_self_message_iterator_configuration
*configuration
,
238 bt_bool can_seek_forward
);
248 #endif /* BABELTRACE2_GRAPH_SELF_MESSAGE_ITERATOR_H */