71f935a0fe581c557ea8e3585b19c9fcde763de9
[babeltrace.git] / include / babeltrace / ctf / iterator.h
1 #ifndef _BABELTRACE_CTF_ITERATOR_H
2 #define _BABELTRACE_CTF_ITERATOR_H
3
4 /*
5 * BabelTrace
6 *
7 * CTF iterator API
8 *
9 * Copyright 2011-2012 EfficiOS Inc. and Linux Foundation
10 *
11 * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 * Julien Desfossez <julien.desfossez@efficios.com>
13 *
14 * Permission is hereby granted, free of charge, to any person obtaining
15 * a copy of this software and associated documentation files (the
16 * "Software"), to deal in the Software without restriction, including
17 * without limitation the rights to use, copy, modify, merge, publish,
18 * distribute, sublicense, and/or sell copies of the Software, and to
19 * permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be
23 * included in all copies or substantial portions of the Software.
24 */
25
26 #include <babeltrace/iterator.h>
27
28 struct bt_ctf_iter;
29 struct bt_ctf_event;
30
31 /*
32 * bt_ctf_iter_create - Allocate a CTF trace collection iterator.
33 *
34 * begin_pos and end_pos are optional parameters to specify the position
35 * at which the trace collection should be seeked upon iterator
36 * creation, and the position at which iteration will start returning
37 * "EOF".
38 *
39 * By default, if begin_pos is NULL, a BT_SEEK_CUR is performed at
40 * creation. By default, if end_pos is NULL, a BT_SEEK_END (end of
41 * trace) is the EOF criterion.
42 */
43 struct bt_ctf_iter *bt_ctf_iter_create(struct bt_context *ctx,
44 const struct bt_iter_pos *begin_pos,
45 const struct bt_iter_pos *end_pos);
46
47 /*
48 * bt_ctf_get_iter - get iterator from ctf iterator.
49 */
50 struct bt_iter *bt_ctf_get_iter(struct bt_ctf_iter *iter);
51
52 /*
53 * bt_ctf_iter_destroy - Free a CTF trace collection iterator.
54 */
55 void bt_ctf_iter_destroy(struct bt_ctf_iter *iter);
56
57 /*
58 * bt_ctf_iter_read_event: Read the iterator's current event data.
59 *
60 * @iter: trace collection iterator (input)
61 *
62 * Return current event on success, NULL on end of trace.
63 */
64 struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_ctf_iter *iter);
65
66 #endif /* _BABELTRACE_CTF_ITERATOR_H */
This page took 0.030022 seconds and 4 git commands to generate.