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_port_output
*port
);
87 (*bt_message_iterator_class_finalize_method
)(
88 bt_self_message_iterator
*message_iterator
);
90 typedef bt_message_iterator_class_next_method_status
91 (*bt_message_iterator_class_next_method
)(
92 bt_self_message_iterator
*message_iterator
,
93 bt_message_array_const msgs
, uint64_t capacity
,
96 typedef bt_message_iterator_class_seek_ns_from_origin_method_status
97 (*bt_message_iterator_class_seek_ns_from_origin_method
)(
98 bt_self_message_iterator
*message_iterator
,
99 int64_t ns_from_origin
);
101 typedef bt_message_iterator_class_can_seek_ns_from_origin_method_status
102 (*bt_message_iterator_class_can_seek_ns_from_origin_method
)(
103 bt_self_message_iterator
*message_iterator
,
104 int64_t ns_from_origin
, bt_bool
*can_seek
);
106 typedef bt_message_iterator_class_seek_beginning_method_status
107 (*bt_message_iterator_class_seek_beginning_method
)(
108 bt_self_message_iterator
*message_iterator
);
110 typedef bt_message_iterator_class_can_seek_beginning_method_status
111 (*bt_message_iterator_class_can_seek_beginning_method
)(
112 bt_self_message_iterator
*message_iterator
, bt_bool
*can_seek
);
114 extern void bt_message_iterator_class_get_ref(
115 const bt_message_iterator_class
*message_iterator_class
);
117 extern void bt_message_iterator_class_put_ref(
118 const bt_message_iterator_class
*message_iterator_class
);
120 #define BT_MESSAGE_ITERATOR_CLASS_PUT_REF_AND_RESET(_var) \
122 bt_message_iterator_class_put_ref(_var); \
126 #define BT_MESSAGE_ITERATOR_CLASS_MOVE_MOVE_REF(_var_dst, _var_src) \
128 bt_message_iterator_class_put_ref(_var_dst); \
129 (_var_dst) = (_var_src); \
133 extern bt_message_iterator_class
*
134 bt_message_iterator_class_create(
135 bt_message_iterator_class_next_method next_method
);
137 extern bt_message_iterator_class_set_method_status
138 bt_message_iterator_class_set_initialize_method(
139 bt_message_iterator_class
*message_iterator_class
,
140 bt_message_iterator_class_initialize_method method
);
142 extern bt_message_iterator_class_set_method_status
143 bt_message_iterator_class_set_finalize_method(
144 bt_message_iterator_class
*message_iterator_class
,
145 bt_message_iterator_class_finalize_method method
);
147 extern bt_message_iterator_class_set_method_status
148 bt_message_iterator_class_set_seek_ns_from_origin_methods(
149 bt_message_iterator_class
*message_iterator_class
,
150 bt_message_iterator_class_seek_ns_from_origin_method seek_method
,
151 bt_message_iterator_class_can_seek_ns_from_origin_method can_seek_method
);
153 extern bt_message_iterator_class_set_method_status
154 bt_message_iterator_class_set_seek_beginning_methods(
155 bt_message_iterator_class
*message_iterator_class
,
156 bt_message_iterator_class_seek_beginning_method seek_method
,
157 bt_message_iterator_class_can_seek_beginning_method can_seek_method
);
163 #endif /* BABELTRACE2_GRAPH_MESSAGE_ITERATOR_CLASS_H */