lib: Reset libbabeltrace2 to SONANE 0
[babeltrace.git] / include / babeltrace / trace-ir / clock-class-internal.h
index a2fcc303367a2c584f8e0784191bd91ba5ecde4a..48ab713cb567f6a350284bca3bc5b3e4a612531e 100644 (file)
 #include <babeltrace/trace-ir/clock-class.h>
 #include <babeltrace/object-internal.h>
 #include <babeltrace/babeltrace-internal.h>
+#include <babeltrace/common-internal.h>
 #include <babeltrace/object-pool-internal.h>
 #include <babeltrace/compat/uuid-internal.h>
 #include <babeltrace/types.h>
 #include <babeltrace/property-internal.h>
+#include <babeltrace/assert-internal.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <glib.h>
@@ -64,7 +66,7 @@ struct bt_clock_class {
                bt_uuid value;
        } uuid;
 
-       bool is_absolute;
+       bool origin_is_unix_epoch;
 
        /*
         * This is computed every time you call
@@ -73,7 +75,7 @@ struct bt_clock_class {
         * base offset in nanoseconds including both `offset_seconds`
         * and `offset_cycles` above in the result. It is used to
         * accelerate future calls to
-        * bt_clock_value_get_ns_from_origin() and
+        * bt_clock_snapshot_get_ns_from_origin() and
         * bt_clock_class_cycles_to_ns_from_origin().
         *
         * `overflows` is true if the base offset cannot be computed
@@ -84,8 +86,8 @@ struct bt_clock_class {
                bool overflows;
        } base_offset;
 
-       /* Pool of `struct bt_clock_value *` */
-       struct bt_object_pool cv_pool;
+       /* Pool of `struct bt_clock_snapshot *` */
+       struct bt_object_pool cs_pool;
 
        bool frozen;
 };
@@ -102,4 +104,16 @@ void _bt_clock_class_freeze(const struct bt_clock_class *clock_class);
 BT_HIDDEN
 bt_bool bt_clock_class_is_valid(struct bt_clock_class *clock_class);
 
+static inline
+int bt_clock_class_clock_value_from_ns_from_origin(
+               struct bt_clock_class *cc, int64_t ns_from_origin,
+               uint64_t *raw_value)
+{
+       BT_ASSERT(cc);
+
+       return bt_common_clock_value_from_ns_from_origin(cc->offset_seconds,
+               cc->offset_cycles, cc->frequency, ns_from_origin,
+               raw_value);
+}
+
 #endif /* BABELTRACE_TRACE_IR_CLOCK_CLASS_INTERNAL_H */
This page took 0.024797 seconds and 4 git commands to generate.