Move to kernel style SPDX license identifiers
[babeltrace.git] / src / ctf-writer / clock-class.h
CommitLineData
16ca5ff0 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
16ca5ff0 3 *
0235b0db 4 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
16ca5ff0
PP
5 */
6
0235b0db
MJ
7#ifndef BABELTRACE_CTF_WRITER_CLOCK_CLASS_INTERNAL_H
8#define BABELTRACE_CTF_WRITER_CLOCK_CLASS_INTERNAL_H
9
91d81473 10#include "common/macros.h"
cb169d05 11#include "object-pool.h"
6162e6b7 12#include "common/uuid.h"
217cf9d3 13#include <babeltrace2-ctf-writer/types.h>
16ca5ff0
PP
14#include <stdint.h>
15#include <glib.h>
16
578e048b
MJ
17#include "object.h"
18
16ca5ff0 19struct bt_ctf_clock_class {
e1e02a22 20 struct bt_ctf_object base;
16ca5ff0
PP
21 GString *name;
22 GString *description;
23 uint64_t frequency;
24 uint64_t precision;
25 int64_t offset_s; /* Offset in seconds */
26 int64_t offset; /* Offset in ticks */
6162e6b7 27 bt_uuid_t uuid;
16ca5ff0
PP
28 int uuid_set;
29 int absolute;
30
31 /*
32 * A clock's properties can't be modified once it is added to a stream
33 * class.
34 */
35 int frozen;
36};
37
38BT_HIDDEN
39void bt_ctf_clock_class_freeze(struct bt_ctf_clock_class *clock_class);
40
41BT_HIDDEN
00409097 42bt_ctf_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class);
16ca5ff0
PP
43
44BT_HIDDEN
45int bt_ctf_clock_class_compare(struct bt_ctf_clock_class *clock_class_a,
46 struct bt_ctf_clock_class *clock_class_b);
47
48BT_HIDDEN
49struct bt_ctf_clock_class *bt_ctf_clock_class_create(const char *name,
50 uint64_t freq);
51BT_HIDDEN
52const char *bt_ctf_clock_class_get_name(
53 struct bt_ctf_clock_class *clock_class);
54BT_HIDDEN
55int bt_ctf_clock_class_set_name(struct bt_ctf_clock_class *clock_class,
56 const char *name);
57BT_HIDDEN
58const char *bt_ctf_clock_class_get_description(
59 struct bt_ctf_clock_class *clock_class);
60BT_HIDDEN
61int bt_ctf_clock_class_set_description(
62 struct bt_ctf_clock_class *clock_class,
63 const char *desc);
64BT_HIDDEN
65uint64_t bt_ctf_clock_class_get_frequency(
66 struct bt_ctf_clock_class *clock_class);
67BT_HIDDEN
68int bt_ctf_clock_class_set_frequency(
69 struct bt_ctf_clock_class *clock_class, uint64_t freq);
70BT_HIDDEN
71uint64_t bt_ctf_clock_class_get_precision(
72 struct bt_ctf_clock_class *clock_class);
73BT_HIDDEN
74int bt_ctf_clock_class_set_precision(
75 struct bt_ctf_clock_class *clock_class, uint64_t precision);
76BT_HIDDEN
77int bt_ctf_clock_class_get_offset_s(
78 struct bt_ctf_clock_class *clock_class, int64_t *seconds);
79BT_HIDDEN
80int bt_ctf_clock_class_set_offset_s(
81 struct bt_ctf_clock_class *clock_class, int64_t seconds);
82BT_HIDDEN
83int bt_ctf_clock_class_get_offset_cycles(
84 struct bt_ctf_clock_class *clock_class, int64_t *cycles);
85BT_HIDDEN
86int bt_ctf_clock_class_set_offset_cycles(
87 struct bt_ctf_clock_class *clock_class, int64_t cycles);
88BT_HIDDEN
00409097 89bt_ctf_bool bt_ctf_clock_class_is_absolute(
16ca5ff0
PP
90 struct bt_ctf_clock_class *clock_class);
91BT_HIDDEN
92int bt_ctf_clock_class_set_is_absolute(
00409097 93 struct bt_ctf_clock_class *clock_class, bt_ctf_bool is_absolute);
16ca5ff0 94BT_HIDDEN
6162e6b7 95const uint8_t *bt_ctf_clock_class_get_uuid(
16ca5ff0
PP
96 struct bt_ctf_clock_class *clock_class);
97BT_HIDDEN
98int bt_ctf_clock_class_set_uuid(struct bt_ctf_clock_class *clock_class,
6162e6b7 99 const uint8_t *uuid);
16ca5ff0
PP
100
101#endif /* BABELTRACE_CTF_WRITER_CLOCK_CLASS_INTERNAL_H */
This page took 0.06581 seconds and 4 git commands to generate.