Remove some unused includes in C++ files
[babeltrace.git] / src / plugins / ctf / fs-src / data-stream-file.hpp
CommitLineData
e98a2d6e 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
e98a2d6e 3 *
0235b0db 4 * Copyright (C) 2016 Philippe Proulx <pproulx@efficios.com>
e98a2d6e
PP
5 */
6
0235b0db
MJ
7#ifndef CTF_FS_DS_FILE_H
8#define CTF_FS_DS_FILE_H
9
e98a2d6e 10#include <glib.h>
c802cacb
SM
11#include <stdio.h>
12
3fadfbc0 13#include <babeltrace2/babeltrace.h>
e98a2d6e 14
087cd0f5 15#include "../common/msg-iter/msg-iter.hpp"
b6c3dcb2 16
4164020e
SM
17struct ctf_fs_ds_file_info
18{
19 /* Owned by this. */
20 GString *path;
97ade20b 21
4164020e
SM
22 /* Guaranteed to be set, as opposed to the index. */
23 int64_t begin_ns;
97ade20b
JG
24};
25
4164020e
SM
26struct ctf_fs_ds_file
27{
28 bt_logging_level log_level;
98903a3e 29
4164020e
SM
30 /* Weak */
31 bt_self_component *self_comp;
4c65a157 32
4164020e
SM
33 /* Weak */
34 struct ctf_fs_metadata *metadata;
5c563278 35
4164020e
SM
36 /* Owned by this */
37 struct ctf_fs_file *file;
97ade20b 38
4164020e
SM
39 /* Owned by this */
40 bt_stream *stream;
97ade20b 41
4164020e 42 void *mmap_addr;
97ade20b 43
4164020e
SM
44 /*
45 * Max length of chunk to mmap() when updating the current mapping.
46 * This value must be page-aligned.
47 */
48 size_t mmap_max_len;
97ade20b 49
4164020e
SM
50 /* Length of the current mapping. Never exceeds the file's length. */
51 size_t mmap_len;
97ade20b 52
4164020e
SM
53 /* Offset in the file where the current mapping starts. */
54 off_t mmap_offset_in_file;
97ade20b 55
4164020e
SM
56 /*
57 * Offset, in the current mapping, of the address to return on the next
58 * request.
59 */
60 off_t request_offset_in_mapping;
b6c3dcb2 61};
e98a2d6e 62
76edbcf1
SM
63struct ctf_fs_ds_file *ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace, bt_stream *stream,
64 const char *path, bt_logging_level log_level);
e98a2d6e 65
94cf822e 66void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file *stream);
e98a2d6e 67
4164020e
SM
68struct ctf_fs_ds_index *ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file,
69 struct ctf_fs_ds_file_info *ds_file_info,
70 struct ctf_msg_iter *msg_iter);
97ade20b 71
4c65a157 72struct ctf_fs_ds_index *ctf_fs_ds_index_create(bt_logging_level log_level,
4164020e 73 bt_self_component *self_comp);
7ed5243a 74
97ade20b
JG
75void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index *index);
76
f6e68e70
SM
77/*
78 * Medium operations to iterate on a single ctf_fs_ds_file.
79 *
80 * The data pointer when using this must be a pointer to the ctf_fs_ds_file.
81 */
18a1979b 82extern struct ctf_msg_iter_medium_ops ctf_fs_ds_file_medops;
6de92955 83
f6e68e70
SM
84/*
85 * Medium operations to iterate on the packet of a ctf_fs_ds_group.
86 *
87 * The iteration is done based on the index of the group.
88 *
89 * The data pointer when using these medops must be a pointer to a ctf_fs_ds
90 * group_medops_data structure.
91 */
92extern struct ctf_msg_iter_medium_ops ctf_fs_ds_group_medops;
93
f6e68e70 94enum ctf_msg_iter_medium_status ctf_fs_ds_group_medops_data_create(
4164020e
SM
95 struct ctf_fs_ds_file_group *ds_file_group, bt_self_message_iterator *self_msg_iter,
96 bt_logging_level log_level, struct ctf_fs_ds_group_medops_data **out);
f6e68e70 97
f6e68e70
SM
98void ctf_fs_ds_group_medops_data_reset(struct ctf_fs_ds_group_medops_data *data);
99
4164020e 100void ctf_fs_ds_group_medops_data_destroy(struct ctf_fs_ds_group_medops_data *data);
f6e68e70 101
94cf822e 102#endif /* CTF_FS_DS_FILE_H */
This page took 0.089493 seconds and 4 git commands to generate.