Commit | Line | Data |
---|---|---|
6f3077a2 JD |
1 | #ifndef _BABELTRACE_ITERATOR_INTERNAL_H |
2 | #define _BABELTRACE_ITERATOR_INTERNAL_H | |
3 | ||
4 | /* | |
5 | * BabelTrace | |
6 | * | |
7 | * Internal iterator header | |
8 | * | |
9 | * Copyright 2010-2011 EfficiOS Inc. and Linux Foundation | |
10 | * | |
11 | * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
12 | * | |
13 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
14 | * of this software and associated documentation files (the "Software"), to deal | |
15 | * in the Software without restriction, including without limitation the rights | |
16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
17 | * copies of the Software, and to permit persons to whom the Software is | |
18 | * furnished to do so, subject to the following conditions: | |
19 | * | |
20 | * The above copyright notice and this permission notice shall be included in | |
21 | * all copies or substantial portions of the Software. | |
c462e188 MD |
22 | * |
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
29 | * SOFTWARE. | |
6f3077a2 JD |
30 | */ |
31 | ||
9843982d JD |
32 | #include <babeltrace/ctf/events.h> |
33 | ||
6f3077a2 | 34 | /* |
e8c92a62 | 35 | * struct bt_iter: data structure representing an iterator on a trace |
6f3077a2 JD |
36 | * collection. |
37 | */ | |
e8c92a62 | 38 | struct bt_iter { |
6f3077a2 | 39 | struct ptr_heap *stream_heap; |
95d36295 | 40 | struct bt_context *ctx; |
04ae3991 | 41 | const struct bt_iter_pos *end_pos; |
6f3077a2 JD |
42 | }; |
43 | ||
9347cbab MD |
44 | /* |
45 | * bt_iter_create - Allocate a trace collection iterator. | |
46 | * | |
47 | * begin_pos and end_pos are optional parameters to specify the position | |
48 | * at which the trace collection should be seeked upon iterator | |
49 | * creation, and the position at which iteration will start returning | |
50 | * "EOF". | |
51 | * | |
52 | * By default, if begin_pos is NULL, a BT_SEEK_CUR is performed at | |
53 | * creation. By default, if end_pos is NULL, a BT_SEEK_END (end of | |
54 | * trace) is the EOF criterion. | |
55 | */ | |
56 | struct bt_iter *bt_iter_create(struct bt_context *ctx, | |
04ae3991 MD |
57 | const struct bt_iter_pos *begin_pos, |
58 | const struct bt_iter_pos *end_pos); | |
9347cbab MD |
59 | |
60 | /* | |
61 | * bt_iter_destroy - Free a trace collection iterator. | |
62 | */ | |
63 | void bt_iter_destroy(struct bt_iter *iter); | |
64 | ||
e4195791 MD |
65 | int bt_iter_init(struct bt_iter *iter, |
66 | struct bt_context *ctx, | |
04ae3991 MD |
67 | const struct bt_iter_pos *begin_pos, |
68 | const struct bt_iter_pos *end_pos); | |
e4195791 | 69 | void bt_iter_fini(struct bt_iter *iter); |
b587c608 JD |
70 | int bt_iter_add_trace(struct bt_iter *iter, |
71 | struct bt_trace_descriptor *td_read); | |
e4195791 | 72 | |
6f3077a2 | 73 | #endif /* _BABELTRACE_ITERATOR_INTERNAL_H */ |