ir: disable clock value accessors in non-writer mode
[babeltrace.git] / include / babeltrace / ctf-ir / clock-internal.h
index 135b1c5f40745285b7607dc3abb461d0bae62591..8f7b5f07e31f9d9b77dfe8ab800e4143bb2be51a 100644 (file)
@@ -40,12 +40,22 @@ struct bt_ctf_clock {
        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 */
+       uint64_t value;         /* Current clock value */
        uuid_t uuid;
        int uuid_set;
        int absolute;
+
+       /*
+        * This field is set once a clock is added to a trace. If the
+        * trace was created by a CTF writer, then the clock's value
+        * can be set and returned. Otherwise both functions fail
+        * because, in non-writer mode, clocks do not have global
+        * values: values are per-stream.
+        */
+       int has_value;
+
        /*
         * A clock's properties can't be modified once it is added to a stream
         * class.
This page took 0.024317 seconds and 4 git commands to generate.