1 #ifndef BABELTRACE2_GRAPH_MESSAGE_ITERATOR_CLASS_H
2 #define BABELTRACE2_GRAPH_MESSAGE_ITERATOR_CLASS_H
5 * Copyright (c) 2019 EfficiOS Inc.
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."
34 typedef enum bt_message_iterator_class_set_method_status
{
35 BT_MESSAGE_ITERATOR_CLASS_SET_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
36 } bt_message_iterator_class_set_method_status
;
38 typedef enum bt_message_iterator_class_initialize_method_status
{
39 BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
40 BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
41 BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
42 } bt_message_iterator_class_initialize_method_status
;
44 typedef enum bt_message_iterator_class_next_method_status
{
45 BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
46 BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
47 BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
48 BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
49 BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_END
= __BT_FUNC_STATUS_END
,
50 } bt_message_iterator_class_next_method_status
;
52 typedef enum bt_message_iterator_class_seek_ns_from_origin_method_status
{
53 BT_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
54 BT_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
55 BT_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
56 BT_MESSAGE_ITERATOR_CLASS_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
57 } bt_message_iterator_class_seek_ns_from_origin_method_status
;
59 typedef enum bt_message_iterator_class_can_seek_ns_from_origin_method_status
{
60 BT_MESSAGE_ITERATOR_CLASS_CAN_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
61 BT_MESSAGE_ITERATOR_CLASS_CAN_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
62 BT_MESSAGE_ITERATOR_CLASS_CAN_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
63 BT_MESSAGE_ITERATOR_CLASS_CAN_SEEK_NS_FROM_ORIGIN_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
64 } bt_message_iterator_class_can_seek_ns_from_origin_method_status
;
66 typedef enum bt_message_iterator_class_seek_beginning_method_status
{
67 BT_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
68 BT_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
69 BT_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
70 BT_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
71 } bt_message_iterator_class_seek_beginning_method_status
;
73 typedef enum bt_message_iterator_class_can_seek_beginning_method_status
{
74 BT_MESSAGE_ITERATOR_CLASS_CAN_SEEK_BEGINNING_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
75 BT_MESSAGE_ITERATOR_CLASS_CAN_SEEK_BEGINNING_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
76 BT_MESSAGE_ITERATOR_CLASS_CAN_SEEK_BEGINNING_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
77 BT_MESSAGE_ITERATOR_CLASS_CAN_SEEK_BEGINNING_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
78 } bt_message_iterator_class_can_seek_beginning_method_status
;
80 typedef bt_message_iterator_class_initialize_method_status
81 (*bt_message_iterator_class_initialize_method
)(
82 bt_self_message_iterator
*message_iterator
,
83 bt_self_message_iterator_configuration
*config
,
84 bt_self_component
*self_component
,
85 bt_self_component_port_output
*port
);
88 (*bt_message_iterator_class_finalize_method
)(
89 bt_self_message_iterator
*message_iterator
);
91 typedef bt_message_iterator_class_next_method_status
92 (*bt_message_iterator_class_next_method
)(
93 bt_self_message_iterator
*message_iterator
,
94 bt_message_array_const msgs
, uint64_t capacity
,
97 typedef bt_message_iterator_class_seek_ns_from_origin_method_status
98 (*bt_message_iterator_class_seek_ns_from_origin_method
)(
99 bt_self_message_iterator
*message_iterator
,
100 int64_t ns_from_origin
);
102 typedef bt_message_iterator_class_can_seek_ns_from_origin_method_status
103 (*bt_message_iterator_class_can_seek_ns_from_origin_method
)(
104 bt_self_message_iterator
*message_iterator
,
105 int64_t ns_from_origin
, bt_bool
*can_seek
);
107 typedef bt_message_iterator_class_seek_beginning_method_status
108 (*bt_message_iterator_class_seek_beginning_method
)(
109 bt_self_message_iterator
*message_iterator
);
111 typedef bt_message_iterator_class_can_seek_beginning_method_status
112 (*bt_message_iterator_class_can_seek_beginning_method
)(
113 bt_self_message_iterator
*message_iterator
, bt_bool
*can_seek
);
115 extern void bt_message_iterator_class_get_ref(
116 const bt_message_iterator_class
*message_iterator_class
);
118 extern void bt_message_iterator_class_put_ref(
119 const bt_message_iterator_class
*message_iterator_class
);
121 #define BT_MESSAGE_ITERATOR_CLASS_PUT_REF_AND_RESET(_var) \
123 bt_message_iterator_class_put_ref(_var); \
127 #define BT_MESSAGE_ITERATOR_CLASS_MOVE_MOVE_REF(_var_dst, _var_src) \
129 bt_message_iterator_class_put_ref(_var_dst); \
130 (_var_dst) = (_var_src); \
134 extern bt_message_iterator_class
*
135 bt_message_iterator_class_create(
136 bt_message_iterator_class_next_method next_method
);
138 extern bt_message_iterator_class_set_method_status
139 bt_message_iterator_class_set_initialize_method(
140 bt_message_iterator_class
*message_iterator_class
,
141 bt_message_iterator_class_initialize_method method
);
143 extern bt_message_iterator_class_set_method_status
144 bt_message_iterator_class_set_finalize_method(
145 bt_message_iterator_class
*message_iterator_class
,
146 bt_message_iterator_class_finalize_method method
);
148 extern bt_message_iterator_class_set_method_status
149 bt_message_iterator_class_set_seek_ns_from_origin_methods(
150 bt_message_iterator_class
*message_iterator_class
,
151 bt_message_iterator_class_seek_ns_from_origin_method seek_method
,
152 bt_message_iterator_class_can_seek_ns_from_origin_method can_seek_method
);
154 extern bt_message_iterator_class_set_method_status
155 bt_message_iterator_class_set_seek_beginning_methods(
156 bt_message_iterator_class
*message_iterator_class
,
157 bt_message_iterator_class_seek_beginning_method seek_method
,
158 bt_message_iterator_class_can_seek_beginning_method can_seek_method
);
164 #endif /* BABELTRACE2_GRAPH_MESSAGE_ITERATOR_CLASS_H */