doc/api/libbabeltrace2/DoxygenLayout.xml: use `topics` tab
[babeltrace.git] / src / cpp-common / bt2 / integer-range.hpp
index 7e94e9e037c42bbcefe0711056f692f94dc05b22..6f449403098dd95294ab6a84d9c0839c9f2f8ecc 100644 (file)
@@ -7,20 +7,20 @@
 #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>
 struct ConstIntegerRangeSpec;
 
-// Functions specific to unsigned integer ranges
+/* Functions specific to unsigned integer ranges */
 template <>
 struct ConstIntegerRangeSpec<const bt_integer_range_unsigned> final
 {
@@ -41,7 +41,7 @@ struct ConstIntegerRangeSpec<const bt_integer_range_unsigned> final
     }
 };
 
-// Functions specific to signed integer ranges
+/* Functions specific to signed integer ranges */
 template <>
 struct ConstIntegerRangeSpec<const bt_integer_range_signed> final
 {
@@ -62,61 +62,51 @@ struct ConstIntegerRangeSpec<const bt_integer_range_signed> final
     }
 };
 
-} // namespace internal
+} /* 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());
     }
 };
 
 using ConstUnsignedIntegerRange = ConstIntegerRange<const bt_integer_range_unsigned>;
 using ConstSignedIntegerRange = ConstIntegerRange<const bt_integer_range_signed>;
 
-} // namespace bt2
+} /* namespace bt2 */
 
-#endif // BABELTRACE_CPP_COMMON_BT2_INTEGER_RANGE_HPP
+#endif /* BABELTRACE_CPP_COMMON_BT2_INTEGER_RANGE_HPP */
This page took 0.02457 seconds and 4 git commands to generate.