Cleanup: remove private babeltrace.h
[babeltrace.git] / src / ctf-writer / clock-class.h
CommitLineData
16ca5ff0
PP
1#ifndef BABELTRACE_CTF_WRITER_CLOCK_CLASS_INTERNAL_H
2#define BABELTRACE_CTF_WRITER_CLOCK_CLASS_INTERNAL_H
3
4/*
16ca5ff0
PP
5 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 *
7 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 */
27
91d81473 28#include "common/macros.h"
578e048b
MJ
29#include "lib/object-pool.h"
30#include "compat/uuid.h"
3fadfbc0 31#include <babeltrace2/types.h>
16ca5ff0
PP
32#include <stdbool.h>
33#include <stdint.h>
34#include <glib.h>
35
578e048b
MJ
36#include "object.h"
37
16ca5ff0 38struct bt_ctf_clock_class {
e1e02a22 39 struct bt_ctf_object base;
16ca5ff0
PP
40 GString *name;
41 GString *description;
42 uint64_t frequency;
43 uint64_t precision;
44 int64_t offset_s; /* Offset in seconds */
45 int64_t offset; /* Offset in ticks */
46 unsigned char uuid[BABELTRACE_UUID_LEN];
47 int uuid_set;
48 int absolute;
49
50 /*
51 * A clock's properties can't be modified once it is added to a stream
52 * class.
53 */
54 int frozen;
55};
56
57BT_HIDDEN
58void bt_ctf_clock_class_freeze(struct bt_ctf_clock_class *clock_class);
59
60BT_HIDDEN
61bt_bool bt_ctf_clock_class_is_valid(struct bt_ctf_clock_class *clock_class);
62
63BT_HIDDEN
64int bt_ctf_clock_class_compare(struct bt_ctf_clock_class *clock_class_a,
65 struct bt_ctf_clock_class *clock_class_b);
66
67BT_HIDDEN
68struct bt_ctf_clock_class *bt_ctf_clock_class_create(const char *name,
69 uint64_t freq);
70BT_HIDDEN
71const char *bt_ctf_clock_class_get_name(
72 struct bt_ctf_clock_class *clock_class);
73BT_HIDDEN
74int bt_ctf_clock_class_set_name(struct bt_ctf_clock_class *clock_class,
75 const char *name);
76BT_HIDDEN
77const char *bt_ctf_clock_class_get_description(
78 struct bt_ctf_clock_class *clock_class);
79BT_HIDDEN
80int bt_ctf_clock_class_set_description(
81 struct bt_ctf_clock_class *clock_class,
82 const char *desc);
83BT_HIDDEN
84uint64_t bt_ctf_clock_class_get_frequency(
85 struct bt_ctf_clock_class *clock_class);
86BT_HIDDEN
87int bt_ctf_clock_class_set_frequency(
88 struct bt_ctf_clock_class *clock_class, uint64_t freq);
89BT_HIDDEN
90uint64_t bt_ctf_clock_class_get_precision(
91 struct bt_ctf_clock_class *clock_class);
92BT_HIDDEN
93int bt_ctf_clock_class_set_precision(
94 struct bt_ctf_clock_class *clock_class, uint64_t precision);
95BT_HIDDEN
96int bt_ctf_clock_class_get_offset_s(
97 struct bt_ctf_clock_class *clock_class, int64_t *seconds);
98BT_HIDDEN
99int bt_ctf_clock_class_set_offset_s(
100 struct bt_ctf_clock_class *clock_class, int64_t seconds);
101BT_HIDDEN
102int bt_ctf_clock_class_get_offset_cycles(
103 struct bt_ctf_clock_class *clock_class, int64_t *cycles);
104BT_HIDDEN
105int bt_ctf_clock_class_set_offset_cycles(
106 struct bt_ctf_clock_class *clock_class, int64_t cycles);
107BT_HIDDEN
108bt_bool bt_ctf_clock_class_is_absolute(
109 struct bt_ctf_clock_class *clock_class);
110BT_HIDDEN
111int bt_ctf_clock_class_set_is_absolute(
112 struct bt_ctf_clock_class *clock_class, bt_bool is_absolute);
113BT_HIDDEN
114const unsigned char *bt_ctf_clock_class_get_uuid(
115 struct bt_ctf_clock_class *clock_class);
116BT_HIDDEN
117int bt_ctf_clock_class_set_uuid(struct bt_ctf_clock_class *clock_class,
118 const unsigned char *uuid);
119
120#endif /* BABELTRACE_CTF_WRITER_CLOCK_CLASS_INTERNAL_H */
This page took 0.045917 seconds and 4 git commands to generate.