X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-ir%2Fclock-internal.h;h=e13978110e3c799b566ec4c3cdb7b7ecdd6861fd;hp=501f6247c09969e6e294ceddc3b316fc530d78b3;hb=61cf588beae752e5ddfc60b6b5310f769ac9e852;hpb=87d76bb1f3202bcdd577df14bbbf2231a26c244c diff --git a/include/babeltrace/ctf-ir/clock-internal.h b/include/babeltrace/ctf-ir/clock-internal.h index 501f6247..e1397811 100644 --- a/include/babeltrace/ctf-ir/clock-internal.h +++ b/include/babeltrace/ctf-ir/clock-internal.h @@ -4,7 +4,7 @@ /* * BabelTrace - CTF IR: Clock internal * - * Copyright 2013 EfficiOS Inc. + * Copyright 2013, 2014 Jérémie Galarneau * * Author: Jérémie Galarneau * @@ -27,23 +27,24 @@ * SOFTWARE. */ -#include #include -#include +#include +#include #include #include -#include +#include struct bt_ctf_clock { - struct bt_ctf_ref ref_count; + struct bt_object base; GString *name; GString *description; uint64_t frequency; uint64_t precision; - uint64_t offset_s; /* Offset in seconds */ - uint64_t offset; /* Offset in ticks */ - uint64_t time; /* Current clock value */ + int64_t offset_s; /* Offset in seconds */ + int64_t offset; /* Offset in ticks */ + int64_t time; /* Current clock value */ uuid_t uuid; + int uuid_set; int absolute; /* * A clock's properties can't be modified once it is added to a stream @@ -52,6 +53,24 @@ struct bt_ctf_clock { int frozen; }; +/* + * This is not part of the public API to prevent users from creating clocks + * in an invalid state (being nameless, in this case). + * + * The only legitimate use-case for this function is to allocate a clock + * while the TSDL metadata is being parsed. + */ +BT_HIDDEN +struct bt_ctf_clock *_bt_ctf_clock_create(void); + +/* + * Not exposed as part of the public API since the only usecase + * for this is when we are creating clocks from the TSDL metadata. + */ +BT_HIDDEN +int bt_ctf_clock_set_name(struct bt_ctf_clock *clock, + const char *name); + BT_HIDDEN void bt_ctf_clock_freeze(struct bt_ctf_clock *clock);