| 1 | #ifndef BABELTRACE2_CTF_WRITER_STREAM_CLASS_H |
| 2 | #define BABELTRACE2_CTF_WRITER_STREAM_CLASS_H |
| 3 | |
| 4 | /* |
| 5 | * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation |
| 6 | * |
| 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: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be included in |
| 15 | * all copies or substantial portions of the Software. |
| 16 | * |
| 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 |
| 23 | * SOFTWARE. |
| 24 | */ |
| 25 | |
| 26 | #include <babeltrace2-ctf-writer/object.h> |
| 27 | |
| 28 | #ifdef __cplusplus |
| 29 | extern "C" { |
| 30 | #endif |
| 31 | |
| 32 | struct bt_ctf_stream_class; |
| 33 | struct bt_ctf_trace; |
| 34 | struct bt_ctf_event_class; |
| 35 | struct bt_ctf_field_type; |
| 36 | struct bt_ctf_clock; |
| 37 | |
| 38 | extern struct bt_ctf_stream_class *bt_ctf_stream_class_create( |
| 39 | const char *name); |
| 40 | |
| 41 | extern struct bt_ctf_trace *bt_ctf_stream_class_get_trace( |
| 42 | struct bt_ctf_stream_class *stream_class); |
| 43 | |
| 44 | extern const char *bt_ctf_stream_class_get_name( |
| 45 | struct bt_ctf_stream_class *stream_class); |
| 46 | |
| 47 | extern int bt_ctf_stream_class_set_name( |
| 48 | struct bt_ctf_stream_class *stream_class, const char *name); |
| 49 | |
| 50 | extern int64_t bt_ctf_stream_class_get_id( |
| 51 | struct bt_ctf_stream_class *stream_class); |
| 52 | |
| 53 | extern int bt_ctf_stream_class_set_id( |
| 54 | struct bt_ctf_stream_class *stream_class, uint64_t id); |
| 55 | |
| 56 | extern struct bt_ctf_field_type *bt_ctf_stream_class_get_packet_context_type( |
| 57 | struct bt_ctf_stream_class *stream_class); |
| 58 | |
| 59 | extern int bt_ctf_stream_class_set_packet_context_type( |
| 60 | struct bt_ctf_stream_class *stream_class, |
| 61 | struct bt_ctf_field_type *packet_context_type); |
| 62 | |
| 63 | extern struct bt_ctf_field_type * |
| 64 | bt_ctf_stream_class_get_event_header_type( |
| 65 | struct bt_ctf_stream_class *stream_class); |
| 66 | |
| 67 | extern int bt_ctf_stream_class_set_event_header_type( |
| 68 | struct bt_ctf_stream_class *stream_class, |
| 69 | struct bt_ctf_field_type *event_header_type); |
| 70 | |
| 71 | extern struct bt_ctf_field_type * |
| 72 | bt_ctf_stream_class_get_event_context_type( |
| 73 | struct bt_ctf_stream_class *stream_class); |
| 74 | |
| 75 | extern int bt_ctf_stream_class_set_event_context_type( |
| 76 | struct bt_ctf_stream_class *stream_class, |
| 77 | struct bt_ctf_field_type *event_context_type); |
| 78 | |
| 79 | extern int64_t bt_ctf_stream_class_get_event_class_count( |
| 80 | struct bt_ctf_stream_class *stream_class); |
| 81 | |
| 82 | extern struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_index( |
| 83 | struct bt_ctf_stream_class *stream_class, uint64_t index); |
| 84 | |
| 85 | extern struct bt_ctf_event_class *bt_ctf_stream_class_get_event_class_by_id( |
| 86 | struct bt_ctf_stream_class *stream_class, uint64_t id); |
| 87 | |
| 88 | extern int bt_ctf_stream_class_add_event_class( |
| 89 | struct bt_ctf_stream_class *stream_class, |
| 90 | struct bt_ctf_event_class *event_class); |
| 91 | |
| 92 | extern int bt_ctf_stream_class_set_clock( |
| 93 | struct bt_ctf_stream_class *ctf_stream_class, |
| 94 | struct bt_ctf_clock *clock); |
| 95 | |
| 96 | extern struct bt_ctf_clock *bt_ctf_stream_class_get_clock( |
| 97 | struct bt_ctf_stream_class *stream_class); |
| 98 | |
| 99 | /* Pre-2.0 CTF writer compatibility */ |
| 100 | static inline |
| 101 | void bt_ctf_stream_class_get(struct bt_ctf_stream_class *stream_class) |
| 102 | { |
| 103 | bt_ctf_object_get_ref(stream_class); |
| 104 | } |
| 105 | |
| 106 | /* Pre-2.0 CTF writer compatibility */ |
| 107 | static inline |
| 108 | void bt_ctf_stream_class_put(struct bt_ctf_stream_class *stream_class) |
| 109 | { |
| 110 | bt_ctf_object_put_ref(stream_class); |
| 111 | } |
| 112 | |
| 113 | #ifdef __cplusplus |
| 114 | } |
| 115 | #endif |
| 116 | |
| 117 | #endif /* BABELTRACE2_CTF_WRITER_STREAM_CLASS_H */ |