bt2/clock-class.hpp: "clock class offset" -> "clock offset"
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 12 Mar 2024 01:10:01 +0000 (21:10 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 12 Mar 2024 01:10:01 +0000 (21:10 -0400)
It really is the offset a clock (clock class instance).

Also, "offset" -> "offset from origin".

This is in preparation of CTF 2 support (including libbabeltrace2
changes), where the concept of origin is more defined.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Id623085ae2194a452d2b9b07a8be17395324a5d5

src/cpp-common/bt2/clock-class.hpp

index f8fc17e04cc727ef4848445738574819aa8061fa..f9814a78b58c0df128cf5a214d2f835012288592 100644 (file)
@@ -63,10 +63,10 @@ struct CommonClockClassSpec<const bt_clock_class> final
 
 } /* namespace internal */
 
-class ClockClassOffset final
+class ClockOffset final
 {
 public:
-    explicit ClockClassOffset(const std::int64_t seconds, const std::uint64_t cycles) :
+    explicit ClockOffset(const std::int64_t seconds, const std::uint64_t cycles) :
         _mSeconds {seconds}, _mCycles {cycles}
     {
     }
@@ -131,20 +131,21 @@ public:
         return bt_clock_class_get_frequency(this->libObjPtr());
     }
 
-    void offset(const ClockClassOffset& offset) const noexcept
+    void offsetFromOrigin(const ClockOffset& offsetFromOrigin) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
 
-        bt_clock_class_set_offset(this->libObjPtr(), offset.seconds(), offset.cycles());
+        bt_clock_class_set_offset(this->libObjPtr(), offsetFromOrigin.seconds(),
+                                  offsetFromOrigin.cycles());
     }
 
-    ClockClassOffset offset() const noexcept
+    ClockOffset offsetFromOrigin() const noexcept
     {
         std::int64_t seconds;
         std::uint64_t cycles;
 
         bt_clock_class_get_offset(this->libObjPtr(), &seconds, &cycles);
-        return ClockClassOffset {seconds, cycles};
+        return ClockOffset {seconds, cycles};
     }
 
     void precision(const std::uint64_t precision) const noexcept
This page took 0.02474 seconds and 4 git commands to generate.