From aa5aac94c5ec89c7f361cf37c4df668229704180 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 11 Mar 2024 21:10:01 -0400 Subject: [PATCH] bt2/clock-class.hpp: "clock class offset" -> "clock offset" 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 Change-Id: Id623085ae2194a452d2b9b07a8be17395324a5d5 --- src/cpp-common/bt2/clock-class.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/cpp-common/bt2/clock-class.hpp b/src/cpp-common/bt2/clock-class.hpp index f8fc17e0..f9814a78 100644 --- a/src/cpp-common/bt2/clock-class.hpp +++ b/src/cpp-common/bt2/clock-class.hpp @@ -63,10 +63,10 @@ struct CommonClockClassSpec 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::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 -- 2.34.1