Move to kernel style SPDX license identifiers
[babeltrace.git] / src / lib / trace-ir / stream.h
CommitLineData
273b65be 1/*
0235b0db
MJ
2 * SPDX-License-Identifier: MIT
3 *
e2f7325d 4 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
de9dd397 5 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
273b65be
JG
6 */
7
0235b0db
MJ
8#ifndef BABELTRACE_TRACE_IR_STREAM_INTERNAL_H
9#define BABELTRACE_TRACE_IR_STREAM_INTERNAL_H
10
3fadfbc0 11#include <babeltrace2/trace-ir/stream.h>
578e048b
MJ
12#include "lib/object.h"
13#include "lib/object-pool.h"
91d81473 14#include "common/macros.h"
273b65be 15#include <glib.h>
c4f23e30 16#include <stdbool.h>
273b65be 17
578e048b
MJ
18#include "utils.h"
19
3dca2276 20struct bt_stream_class;
cb6f1f7d 21struct bt_stream;
3230ee6b 22
cb6f1f7d 23struct bt_stream {
83509119 24 struct bt_object base;
44c440bc 25
c6962c96
PP
26 /* Owned by this */
27 struct bt_value *user_attributes;
28
862ca4ed 29 /* Owned by this */
44c440bc
PP
30 struct bt_stream_class *class;
31
32 struct {
33 GString *str;
34
35 /* NULL or `str->str` above */
36 const char *value;
37 } name;
38
39 uint64_t id;
312c056a
PP
40
41 /* Pool of `struct bt_packet *` */
42 struct bt_object_pool packet_pool;
44c440bc
PP
43
44 bool frozen;
3dca2276
PP
45};
46
44c440bc 47BT_HIDDEN
40f4ba76 48void _bt_stream_freeze(const struct bt_stream *stream);
44c440bc
PP
49
50#ifdef BT_DEV_MODE
51# define bt_stream_freeze _bt_stream_freeze
52#else
53# define bt_stream_freeze(_stream)
54#endif
55
862ca4ed
PP
56static inline
57struct bt_trace *bt_stream_borrow_trace_inline(const struct bt_stream *stream)
58{
98b15851 59 BT_ASSERT_DBG(stream);
862ca4ed
PP
60 return (void *) bt_object_borrow_parent(&stream->base);
61}
62
56e18c4c 63#endif /* BABELTRACE_TRACE_IR_STREAM_INTERNAL_H */
This page took 0.087563 seconds and 4 git commands to generate.