X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=src%2Fcpp-common%2Fbt2%2Fclock-class.hpp;h=35ddfbfa9ec9b92ecb84437909e48623f1b6d7ee;hb=ac19444e607847c47917c1cc1abfa09311e19e25;hp=b101ee66f4c9e985170ed2e548f37fe9cccddbc3;hpb=328a274a0722349196f8c7161dce7d5adc7e2489;p=babeltrace.git diff --git a/src/cpp-common/bt2/clock-class.hpp b/src/cpp-common/bt2/clock-class.hpp index b101ee66..35ddfbfa 100644 --- a/src/cpp-common/bt2/clock-class.hpp +++ b/src/cpp-common/bt2/clock-class.hpp @@ -96,13 +96,10 @@ class CommonClockClass final : public BorrowedObject private: using typename BorrowedObject::_ThisBorrowedObject; using typename BorrowedObject::_LibObjPtr; - using _ThisCommonClockClass = CommonClockClass; public: - using Shared = SharedObject<_ThisCommonClockClass, LibObjT, internal::ClockClassRefFuncs>; - - using UserAttributes = - typename std::conditional::value, ConstMapValue, MapValue>::type; + using Shared = SharedObject; + using UserAttributes = internal::DepUserAttrs; explicit CommonClockClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr} { @@ -115,7 +112,7 @@ public: } template - _ThisCommonClockClass& operator=(const CommonClockClass clkClass) noexcept + CommonClockClass& operator=(const CommonClockClass clkClass) noexcept { _ThisBorrowedObject::operator=(clkClass); return *this; @@ -128,7 +125,7 @@ public: void frequency(const std::uint64_t frequency) const noexcept { - static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); + static_assert(!std::is_const::value, "Not available with `bt2::ConstClockClass`."); bt_clock_class_set_frequency(this->libObjPtr(), frequency); } @@ -140,7 +137,7 @@ public: void offset(const ClockClassOffset& offset) const noexcept { - static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); + static_assert(!std::is_const::value, "Not available with `bt2::ConstClockClass`."); bt_clock_class_set_offset(this->libObjPtr(), offset.seconds(), offset.cycles()); } @@ -156,7 +153,7 @@ public: void precision(const std::uint64_t precision) const noexcept { - static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); + static_assert(!std::is_const::value, "Not available with `bt2::ConstClockClass`."); bt_clock_class_set_precision(this->libObjPtr(), precision); } @@ -168,7 +165,7 @@ public: void originIsUnixEpoch(const bool originIsUnixEpoch) const noexcept { - static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); + static_assert(!std::is_const::value, "Not available with `bt2::ConstClockClass`."); bt_clock_class_set_origin_is_unix_epoch(this->libObjPtr(), static_cast(originIsUnixEpoch)); @@ -181,7 +178,7 @@ public: void name(const char * const name) const { - static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); + static_assert(!std::is_const::value, "Not available with `bt2::ConstClockClass`."); const auto status = bt_clock_class_set_name(this->libObjPtr(), name); @@ -208,7 +205,7 @@ public: void description(const char * const description) const { - static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); + static_assert(!std::is_const::value, "Not available with `bt2::ConstClockClass`."); const auto status = bt_clock_class_set_description(this->libObjPtr(), description); @@ -252,7 +249,7 @@ public: template void userAttributes(const CommonMapValue userAttrs) const noexcept { - static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); + static_assert(!std::is_const::value, "Not available with `bt2::ConstClockClass`."); bt_clock_class_set_user_attributes(this->libObjPtr(), userAttrs.libObjPtr()); }