doc/api/libbabeltrace2/DoxygenLayout.xml: use `topics` tab
[babeltrace.git] / src / cpp-common / bt2 / integer-range.hpp
index 1dff95aa77a15e403b28654561901e04d198dd38..6f449403098dd95294ab6a84d9c0839c9f2f8ecc 100644 (file)
@@ -7,14 +7,14 @@
 #ifndef BABELTRACE_CPP_COMMON_BT2_INTEGER_RANGE_HPP
 #define BABELTRACE_CPP_COMMON_BT2_INTEGER_RANGE_HPP
 
-#include <type_traits>
 #include <cstdint>
+#include <type_traits>
+
 #include <babeltrace2/babeltrace.h>
 
-#include "internal/borrowed-obj.hpp"
+#include "borrowed-object.hpp"
 
 namespace bt2 {
-
 namespace internal {
 
 template <typename ValueT>
@@ -65,52 +65,42 @@ struct ConstIntegerRangeSpec<const bt_integer_range_signed> final
 } /* namespace internal */
 
 template <typename LibObjT>
-class ConstIntegerRange final : public internal::BorrowedObj<LibObjT>
+class ConstIntegerRange final : public BorrowedObject<LibObjT>
 {
 private:
-    using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
-    using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
-    using _ThisConstIntegerRange = ConstIntegerRange<LibObjT>;
+    using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
 
 public:
+    using typename BorrowedObject<LibObjT>::LibObjPtr;
+
     using Value =
         typename std::conditional<std::is_same<LibObjT, const bt_integer_range_unsigned>::value,
                                   std::uint64_t, std::int64_t>::type;
 
 public:
-    explicit ConstIntegerRange(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
-    {
-    }
-
-    ConstIntegerRange(const _ThisConstIntegerRange& range) noexcept : _ThisBorrowedObj {range}
-    {
-    }
-
-    _ThisConstIntegerRange& operator=(const _ThisConstIntegerRange& range) noexcept
+    explicit ConstIntegerRange(const LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
     {
-        _ThisBorrowedObj::operator=(range);
-        return *this;
     }
 
-    bool operator==(const _ThisConstIntegerRange& other) const noexcept
+    bool operator==(const ConstIntegerRange& other) const noexcept
     {
-        return internal::ConstIntegerRangeSpec<LibObjT>::isEqual(this->_libObjPtr(),
-                                                                 other._libObjPtr());
+        return internal::ConstIntegerRangeSpec<LibObjT>::isEqual(this->libObjPtr(),
+                                                                 other.libObjPtr());
     }
 
-    bool operator!=(const _ThisConstIntegerRange& other) const noexcept
+    bool operator!=(const ConstIntegerRange& other) const noexcept
     {
         return !(*this == other);
     }
 
     Value lower() const noexcept
     {
-        return internal::ConstIntegerRangeSpec<LibObjT>::lower(this->_libObjPtr());
+        return internal::ConstIntegerRangeSpec<LibObjT>::lower(this->libObjPtr());
     }
 
     Value upper() const noexcept
     {
-        return internal::ConstIntegerRangeSpec<LibObjT>::upper(this->_libObjPtr());
+        return internal::ConstIntegerRangeSpec<LibObjT>::upper(this->libObjPtr());
     }
 };
 
This page took 0.023887 seconds and 4 git commands to generate.