lib: force user to include `<babeltrace2/babeltrace.h>`
[babeltrace.git] / include / babeltrace2 / trace-ir / stream-class.h
CommitLineData
924dc299
PP
1#ifndef BABELTRACE2_TRACE_IR_STREAM_CLASS_H
2#define BABELTRACE2_TRACE_IR_STREAM_CLASS_H
56e18c4c
PP
3
4/*
e2f7325d 5 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
56e18c4c
PP
6 * Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 *
56e18c4c
PP
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * SOFTWARE.
25 *
26 * The Common Trace Format (CTF) Specification is available at
27 * http://www.efficios.com/ctf
28 */
29
4fa90f32
PP
30#ifndef __BT_IN_BABELTRACE_H
31# error "Please include <babeltrace2/babeltrace.h> instead."
32#endif
33
56e18c4c
PP
34#include <stdint.h>
35
b19ff26f
PP
36/*
37 * For bt_bool, bt_trace_class, bt_stream_class, bt_event_class,
38 * bt_clock_class
39 */
3fadfbc0 40#include <babeltrace2/types.h>
56e18c4c
PP
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
b19ff26f
PP
46extern bt_stream_class *bt_stream_class_create(
47 bt_trace_class *trace_class);
56e18c4c 48
b19ff26f
PP
49extern bt_stream_class *bt_stream_class_create_with_id(
50 bt_trace_class *trace_class, uint64_t id);
56e18c4c 51
b19ff26f
PP
52extern bt_trace_class *bt_stream_class_borrow_trace_class(
53 bt_stream_class *stream_class);
56e18c4c 54
d24d5663
PP
55typedef enum bt_stream_class_set_name_status {
56 BT_STREAM_CLASS_SET_NAME_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
57 BT_STREAM_CLASS_SET_NAME_STATUS_OK = __BT_FUNC_STATUS_OK,
58} bt_stream_class_set_name_status;
59
60extern bt_stream_class_set_name_status bt_stream_class_set_name(
a6ae8edc 61 bt_stream_class *stream_class, const char *name);
56e18c4c 62
40f4ba76 63extern void bt_stream_class_set_assigns_automatic_event_class_id(
b19ff26f 64 bt_stream_class *stream_class, bt_bool value);
56e18c4c 65
40f4ba76 66extern void bt_stream_class_set_assigns_automatic_stream_id(
b19ff26f 67 bt_stream_class *stream_class, bt_bool value);
56e18c4c 68
2e90378a
PP
69extern void bt_stream_class_set_supports_discarded_events(
70 bt_stream_class *stream_class,
71 bt_bool supports_discarded_events,
72 bt_bool with_default_clock_snapshots);
73
74extern void bt_stream_class_set_supports_discarded_packets(
75 bt_stream_class *stream_class,
76 bt_bool supports_discarded_packets,
77 bt_bool with_default_clock_snapshots);
78
d24d5663
PP
79typedef enum bt_stream_class_set_field_class_status {
80 BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
81 BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_OK = __BT_FUNC_STATUS_OK,
82} bt_stream_class_set_field_class_status;
83
26fc5aed
PP
84extern void bt_stream_class_set_supports_packets(
85 bt_stream_class *stream_class, bt_bool supports_packets,
86 bt_bool with_beginning_default_clock_snapshot,
87 bt_bool with_end_default_clock_snapshot);
88
d24d5663 89extern bt_stream_class_set_field_class_status
a6ae8edc 90bt_stream_class_set_packet_context_field_class(
b19ff26f
PP
91 bt_stream_class *stream_class,
92 bt_field_class *field_class);
56e18c4c 93
740faaf4
PP
94extern bt_field_class *
95bt_stream_class_borrow_packet_context_field_class(
96 bt_stream_class *stream_class);
97
d24d5663 98extern bt_stream_class_set_field_class_status
40f4ba76 99bt_stream_class_set_event_common_context_field_class(
b19ff26f
PP
100 bt_stream_class *stream_class,
101 bt_field_class *field_class);
56e18c4c 102
740faaf4
PP
103extern bt_field_class *
104bt_stream_class_borrow_event_common_context_field_class(
105 bt_stream_class *stream_class);
106
b19ff26f 107extern bt_event_class *
40f4ba76 108bt_stream_class_borrow_event_class_by_index(
b19ff26f 109 bt_stream_class *stream_class, uint64_t index);
56e18c4c 110
b19ff26f 111extern bt_event_class *
40f4ba76 112bt_stream_class_borrow_event_class_by_id(
b19ff26f 113 bt_stream_class *stream_class, uint64_t id);
56e18c4c 114
b19ff26f
PP
115extern bt_clock_class *bt_stream_class_borrow_default_clock_class(
116 bt_stream_class *stream_class);
56e18c4c 117
d24d5663
PP
118typedef enum bt_stream_class_set_default_clock_class_status {
119 BT_STREAM_CLASS_SET_DEFAULT_CLOCK_CLASS_STATUS_OK = __BT_FUNC_STATUS_OK,
120} bt_stream_class_set_default_clock_class_status;
121
122extern bt_stream_class_set_default_clock_class_status
123bt_stream_class_set_default_clock_class(
b19ff26f
PP
124 bt_stream_class *stream_class,
125 bt_clock_class *clock_class);
56e18c4c 126
56e18c4c
PP
127#ifdef __cplusplus
128}
129#endif
130
924dc299 131#endif /* BABELTRACE2_TRACE_IR_STREAM_CLASS_H */
This page took 0.043702 seconds and 4 git commands to generate.