cpp-common/bt2/borrowed-obj.hpp: remove unused `SharedObj` forward decl.
[babeltrace.git] / src / cpp-common / bt2 / integer-range-set.hpp
index 22ff4da18e6c96c56e22c8acacbcc402c095a917..a86bcaf9dc872b307bd79803619587bcbfe038ec 100644 (file)
@@ -9,13 +9,14 @@
 
 #include <cstdint>
 #include <type_traits>
+
 #include <babeltrace2/babeltrace.h>
 
 #include "common-iter.hpp"
+#include "exc.hpp"
+#include "integer-range.hpp"
 #include "internal/borrowed-obj.hpp"
 #include "internal/utils.hpp"
-#include "integer-range.hpp"
-#include "lib-error.hpp"
 
 namespace bt2 {
 
@@ -34,7 +35,7 @@ struct IntegerRangeSetRefFuncs<const bt_integer_range_set_unsigned> final
 
     static void put(const bt_integer_range_set_unsigned * const libObjPtr)
     {
-        bt_integer_range_set_unsigned_get_ref(libObjPtr);
+        bt_integer_range_set_unsigned_put_ref(libObjPtr);
     }
 };
 
@@ -48,7 +49,7 @@ struct IntegerRangeSetRefFuncs<const bt_integer_range_set_signed> final
 
     static void put(const bt_integer_range_set_signed * const libObjPtr)
     {
-        bt_integer_range_set_signed_get_ref(libObjPtr);
+        bt_integer_range_set_signed_put_ref(libObjPtr);
     }
 };
 
@@ -190,31 +191,31 @@ public:
         const auto libObjPtr = _Spec::create();
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return Shared {_ThisCommonIntegerRangeSet {libObjPtr}};
+        return CommonIntegerRangeSet::Shared::createWithoutRef(libObjPtr);
     }
 
     template <typename OtherLibObjT>
-    CommonIntegerRangeSet(const CommonIntegerRangeSet<OtherLibObjT>& rangeSet) noexcept :
+    CommonIntegerRangeSet(const CommonIntegerRangeSet<OtherLibObjT> rangeSet) noexcept :
         _ThisBorrowedObj {rangeSet}
     {
     }
 
     template <typename OtherLibObjT>
     _ThisCommonIntegerRangeSet&
-    operator=(const CommonIntegerRangeSet<OtherLibObjT>& rangeSet) noexcept
+    operator=(const CommonIntegerRangeSet<OtherLibObjT> rangeSet) noexcept
     {
         _ThisBorrowedObj::operator=(rangeSet);
         return *this;
     }
 
     template <typename OtherLibObjT>
-    bool operator==(const CommonIntegerRangeSet<OtherLibObjT>& other) const noexcept
+    bool operator==(const CommonIntegerRangeSet<OtherLibObjT> other) const noexcept
     {
         return _Spec::isEqual(this->libObjPtr(), other.libObjPtr());
     }
 
     template <typename OtherLibObjT>
-    bool operator!=(const CommonIntegerRangeSet<OtherLibObjT>& other) const noexcept
+    bool operator!=(const CommonIntegerRangeSet<OtherLibObjT> other) const noexcept
     {
         return !(*this == other);
     }
@@ -226,7 +227,7 @@ public:
         const auto status = _Spec::addRange(this->libObjPtr(), lower, upper);
 
         if (status == BT_INTEGER_RANGE_SET_ADD_RANGE_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -252,7 +253,7 @@ public:
 
     Shared shared() const noexcept
     {
-        return Shared {*this};
+        return Shared::createWithRef(*this);
     }
 };
 
This page took 0.024684 seconds and 4 git commands to generate.