Fix: field.hpp: various typos
[babeltrace.git] / src / cpp-common / bt2 / trace-ir.hpp
index 87f51b9a2b483d052b983d9f9f08ad39a26af784..d55b6e1f4e4f22c117443dfb224c7f9c675a5538 100644 (file)
@@ -151,12 +151,12 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonEvent(const CommonEvent<OtherLibObjT>& event) noexcept : _ThisBorrowedObj {event}
+    CommonEvent(const CommonEvent<OtherLibObjT> event) noexcept : _ThisBorrowedObj {event}
     {
     }
 
     template <typename OtherLibObjT>
-    CommonEvent<LibObjT>& operator=(const CommonEvent<OtherLibObjT>& event) noexcept
+    CommonEvent<LibObjT>& operator=(const CommonEvent<OtherLibObjT> event) noexcept
     {
         _ThisBorrowedObj::operator=(event);
         return *this;
@@ -330,12 +330,12 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonPacket(const CommonPacket<OtherLibObjT>& packet) noexcept : _ThisBorrowedObj {packet}
+    CommonPacket(const CommonPacket<OtherLibObjT> packet) noexcept : _ThisBorrowedObj {packet}
     {
     }
 
     template <typename OtherLibObjT>
-    _ThisCommonPacket& operator=(const CommonPacket<OtherLibObjT>& packet) noexcept
+    _ThisCommonPacket& operator=(const CommonPacket<OtherLibObjT> packet) noexcept
     {
         _ThisBorrowedObj::operator=(packet);
         return *this;
@@ -368,7 +368,7 @@ public:
 
     Shared shared() const noexcept
     {
-        return Shared {*this};
+        return Shared::createWithRef(*this);
     }
 };
 
@@ -508,12 +508,12 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonStream(const CommonStream<OtherLibObjT>& stream) noexcept : _ThisBorrowedObj {stream}
+    CommonStream(const CommonStream<OtherLibObjT> stream) noexcept : _ThisBorrowedObj {stream}
     {
     }
 
     template <typename OtherLibObjT>
-    _ThisCommonStream& operator=(const CommonStream<OtherLibObjT>& stream) noexcept
+    _ThisCommonStream& operator=(const CommonStream<OtherLibObjT> stream) noexcept
     {
         _ThisBorrowedObj::operator=(stream);
         return *this;
@@ -526,7 +526,7 @@ public:
         const auto libObjPtr = bt_packet_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return Packet::Shared {Packet {libObjPtr}};
+        return Packet::Shared::createWithoutRef(libObjPtr);
     }
 
     CommonStreamClass<const bt_stream_class> cls() const noexcept;
@@ -546,7 +546,7 @@ public:
         const auto status = bt_stream_set_name(this->libObjPtr(), name);
 
         if (status == BT_STREAM_SET_NAME_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -567,7 +567,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT>& userAttrs)
+    void userAttributes(const CommonMapValue<LibValT> userAttrs)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -586,7 +586,7 @@ public:
 
     Shared shared() const noexcept
     {
-        return Shared {*this};
+        return Shared::createWithRef(*this);
     }
 };
 
@@ -747,12 +747,12 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonTrace(const CommonTrace<OtherLibObjT>& trace) noexcept : _ThisBorrowedObj {trace}
+    CommonTrace(const CommonTrace<OtherLibObjT> trace) noexcept : _ThisBorrowedObj {trace}
     {
     }
 
     template <typename OtherLibObjT>
-    _ThisCommonTrace& operator=(const CommonTrace<OtherLibObjT>& trace) noexcept
+    _ThisCommonTrace& operator=(const CommonTrace<OtherLibObjT> trace) noexcept
     {
         _ThisBorrowedObj::operator=(trace);
         return *this;
@@ -768,7 +768,7 @@ public:
         const auto status = bt_trace_set_name(this->libObjPtr(), name);
 
         if (status == BT_TRACE_SET_NAME_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -848,7 +848,7 @@ public:
         const auto status = bt_trace_set_environment_entry_integer(this->libObjPtr(), name, val);
 
         if (status == BT_TRACE_SET_ENVIRONMENT_ENTRY_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -864,7 +864,7 @@ public:
         const auto status = bt_trace_set_environment_entry_string(this->libObjPtr(), name, val);
 
         if (status == BT_TRACE_SET_ENVIRONMENT_ENTRY_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -916,7 +916,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT>& userAttrs)
+    void userAttributes(const CommonMapValue<LibValT> userAttrs)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -935,7 +935,7 @@ public:
 
     Shared shared() const noexcept
     {
-        return Shared {*this};
+        return Shared::createWithRef(*this);
     }
 };
 
@@ -1094,13 +1094,13 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonEventClass(const CommonEventClass<OtherLibObjT>& eventClass) noexcept :
+    CommonEventClass(const CommonEventClass<OtherLibObjT> eventClass) noexcept :
         _ThisBorrowedObj {eventClass}
     {
     }
 
     template <typename OtherLibObjT>
-    _ThisCommonEventClass& operator=(const CommonEventClass<OtherLibObjT>& eventClass) noexcept
+    _ThisCommonEventClass& operator=(const CommonEventClass<OtherLibObjT> eventClass) noexcept
     {
         _ThisBorrowedObj::operator=(eventClass);
         return *this;
@@ -1121,7 +1121,7 @@ public:
         const auto status = bt_event_class_set_name(this->libObjPtr(), name);
 
         if (status == BT_EVENT_CLASS_SET_NAME_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -1168,7 +1168,7 @@ public:
         const auto status = bt_event_class_set_emf_uri(this->libObjPtr(), emfUri);
 
         if (status == BT_EVENT_CLASS_SET_EMF_URI_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -1188,7 +1188,7 @@ public:
         return nonstd::nullopt;
     }
 
-    void payloadFieldClass(const StructureFieldClass& fc)
+    void payloadFieldClass(const StructureFieldClass fc)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1196,7 +1196,7 @@ public:
             bt_event_class_set_payload_field_class(this->libObjPtr(), fc.libObjPtr());
 
         if (status == BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -1222,7 +1222,7 @@ public:
         return nonstd::nullopt;
     }
 
-    void specificContextFieldClass(const StructureFieldClass& fc)
+    void specificContextFieldClass(const StructureFieldClass fc)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1230,7 +1230,7 @@ public:
             bt_event_class_set_specific_context_field_class(this->libObjPtr(), fc.libObjPtr());
 
         if (status == BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -1257,7 +1257,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT>& userAttrs)
+    void userAttributes(const CommonMapValue<LibValT> userAttrs)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1276,7 +1276,7 @@ public:
 
     Shared shared() const noexcept
     {
-        return Shared {*this};
+        return Shared::createWithRef(*this);
     }
 };
 
@@ -1458,36 +1458,36 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonStreamClass(const CommonStreamClass<OtherLibObjT>& streamClass) noexcept :
+    CommonStreamClass(const CommonStreamClass<OtherLibObjT> streamClass) noexcept :
         _ThisBorrowedObj {streamClass}
     {
     }
 
     template <typename OtherLibObjT>
-    _ThisCommonStreamClass& operator=(const CommonStreamClass<OtherLibObjT>& streamClass) noexcept
+    _ThisCommonStreamClass& operator=(const CommonStreamClass<OtherLibObjT> streamClass) noexcept
     {
         _ThisBorrowedObj::operator=(streamClass);
         return *this;
     }
 
-    Stream::Shared instantiate(const Trace& trace)
+    Stream::Shared instantiate(const Trace trace)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
         const auto libObjPtr = bt_stream_create(this->libObjPtr(), trace.libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return Stream::Shared {Stream {libObjPtr}};
+        return Stream::Shared::createWithoutRef(libObjPtr);
     }
 
-    Stream::Shared instantiate(const Trace& trace, const std::uint64_t id)
+    Stream::Shared instantiate(const Trace trace, const std::uint64_t id)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
         const auto libObjPtr = bt_stream_create_with_id(this->libObjPtr(), trace.libObjPtr(), id);
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return Stream::Shared {Stream {libObjPtr}};
+        return Stream::Shared::createWithoutRef(libObjPtr);
     }
 
     EventClass::Shared createEventClass()
@@ -1497,7 +1497,7 @@ public:
         const auto libObjPtr = bt_event_class_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return EventClass::Shared {EventClass {libObjPtr}};
+        return EventClass::Shared::createWithoutRef(libObjPtr);
     }
 
     EventClass::Shared createEventClass(const std::uint64_t id)
@@ -1507,7 +1507,7 @@ public:
         const auto libObjPtr = bt_event_class_create_with_id(this->libObjPtr(), id);
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return EventClass::Shared {EventClass {libObjPtr}};
+        return EventClass::Shared::createWithoutRef(libObjPtr);
     }
 
     CommonTraceClass<const bt_trace_class> traceClass() const noexcept;
@@ -1525,7 +1525,7 @@ public:
         const auto status = bt_stream_class_set_name(this->libObjPtr(), name);
 
         if (status == BT_STREAM_CLASS_SET_NAME_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -1642,7 +1642,7 @@ public:
             bt_stream_class_discarded_packets_have_default_clock_snapshots(this->libObjPtr()));
     }
 
-    void defaultClockClass(const ClockClass& clkCls)
+    void defaultClockClass(const ClockClass clkCls)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1711,7 +1711,7 @@ public:
         return nonstd::nullopt;
     }
 
-    void packetContextFieldClass(const StructureFieldClass& fc)
+    void packetContextFieldClass(const StructureFieldClass fc)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1719,7 +1719,7 @@ public:
             bt_stream_class_set_packet_context_field_class(this->libObjPtr(), fc.libObjPtr());
 
         if (status == BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -1745,7 +1745,7 @@ public:
         return nonstd::nullopt;
     }
 
-    void eventCommonContextFieldClass(const StructureFieldClass& fc)
+    void eventCommonContextFieldClass(const StructureFieldClass fc)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1753,7 +1753,7 @@ public:
             bt_stream_class_set_event_common_context_field_class(this->libObjPtr(), fc.libObjPtr());
 
         if (status == BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR) {
-            throw LibMemoryError {};
+            throw MemoryError {};
         }
     }
 
@@ -1780,7 +1780,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT>& userAttrs)
+    void userAttributes(const CommonMapValue<LibValT> userAttrs)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -1799,7 +1799,7 @@ public:
 
     Shared shared() const noexcept
     {
-        return Shared {*this};
+        return Shared::createWithRef(*this);
     }
 };
 
@@ -1940,26 +1940,26 @@ public:
     }
 
     template <typename OtherLibObjT>
-    CommonTraceClass(const CommonTraceClass<OtherLibObjT>& traceClass) noexcept :
+    CommonTraceClass(const CommonTraceClass<OtherLibObjT> traceClass) noexcept :
         _ThisBorrowedObj {traceClass}
     {
     }
 
     template <typename OtherLibObjT>
-    _ThisCommonTraceClass& operator=(const CommonTraceClass<OtherLibObjT>& traceClass) noexcept
+    _ThisCommonTraceClass& operator=(const CommonTraceClass<OtherLibObjT> traceClass) noexcept
     {
         _ThisBorrowedObj::operator=(traceClass);
         return *this;
     }
 
-    Trace::Shared instantiate(const Trace& trace)
+    Trace::Shared instantiate(const Trace trace)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
         const auto libObjPtr = bt_trace_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return Trace::Shared {Trace {libObjPtr}};
+        return Trace::Shared::createWithoutRef(libObjPtr);
     }
 
     StreamClass::Shared createStreamClass()
@@ -1969,7 +1969,7 @@ public:
         const auto libObjPtr = bt_stream_class_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return StreamClass::Shared {StreamClass {libObjPtr}};
+        return StreamClass::Shared::createWithoutRef(libObjPtr);
     }
 
     StreamClass::Shared createStreamClass(const std::uint64_t id)
@@ -1979,7 +1979,7 @@ public:
         const auto libObjPtr = bt_stream_class_create_with_id(this->libObjPtr(), id);
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return StreamClass::Shared {StreamClass {libObjPtr}};
+        return StreamClass::Shared::createWithoutRef(libObjPtr);
     }
 
     FieldClass::Shared createBoolFieldClass()
@@ -1989,7 +1989,7 @@ public:
         const auto libObjPtr = bt_field_class_bool_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return FieldClass::Shared {FieldClass {libObjPtr}};
+        return FieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     BitArrayFieldClass::Shared createBitArrayFieldClass(const std::uint64_t length)
@@ -1999,7 +1999,7 @@ public:
         const auto libObjPtr = bt_field_class_bit_array_create(this->libObjPtr(), length);
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return BitArrayFieldClass::Shared {BitArrayFieldClass {libObjPtr}};
+        return BitArrayFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     IntegerFieldClass::Shared createUnsignedIntegerFieldClass()
@@ -2009,7 +2009,7 @@ public:
         const auto libObjPtr = bt_field_class_integer_unsigned_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return IntegerFieldClass::Shared {IntegerFieldClass {libObjPtr}};
+        return IntegerFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     IntegerFieldClass::Shared createSignedIntegerFieldClass()
@@ -2019,7 +2019,7 @@ public:
         const auto libObjPtr = bt_field_class_integer_signed_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return IntegerFieldClass::Shared {IntegerFieldClass {libObjPtr}};
+        return IntegerFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     UnsignedEnumerationFieldClass::Shared createUnsignedEnumerationFieldClass()
@@ -2029,7 +2029,7 @@ public:
         const auto libObjPtr = bt_field_class_enumeration_unsigned_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return UnsignedEnumerationFieldClass::Shared {UnsignedEnumerationFieldClass {libObjPtr}};
+        return UnsignedEnumerationFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     SignedEnumerationFieldClass::Shared createSignedEnumerationFieldClass()
@@ -2039,7 +2039,7 @@ public:
         const auto libObjPtr = bt_field_class_enumeration_signed_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return SignedEnumerationFieldClass::Shared {SignedEnumerationFieldClass {libObjPtr}};
+        return SignedEnumerationFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     FieldClass::Shared createSinglePrecisionRealFieldClass()
@@ -2049,7 +2049,7 @@ public:
         const auto libObjPtr = bt_field_class_real_single_precision_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return FieldClass::Shared {FieldClass {libObjPtr}};
+        return FieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     FieldClass::Shared createDoublePrecisionRealFieldClass()
@@ -2059,7 +2059,7 @@ public:
         const auto libObjPtr = bt_field_class_real_double_precision_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return FieldClass::Shared {FieldClass {libObjPtr}};
+        return FieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     FieldClass::Shared createStringFieldClass()
@@ -2069,10 +2069,10 @@ public:
         const auto libObjPtr = bt_field_class_string_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return FieldClass::Shared {FieldClass {libObjPtr}};
+        return FieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
-    StaticArrayFieldClass::Shared createStaticArrayFieldClass(const FieldClass& elementFieldClass,
+    StaticArrayFieldClass::Shared createStaticArrayFieldClass(const FieldClass elementFieldClass,
                                                               const std::uint64_t length)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
@@ -2081,10 +2081,10 @@ public:
             this->libObjPtr(), elementFieldClass.libObjPtr(), length);
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return StaticArrayFieldClass::Shared {StaticArrayFieldClass {libObjPtr}};
+        return StaticArrayFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
-    ArrayFieldClass::Shared createDynamicArrayFieldClass(const FieldClass& elementFieldClass)
+    ArrayFieldClass::Shared createDynamicArrayFieldClass(const FieldClass elementFieldClass)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -2092,12 +2092,12 @@ public:
             this->libObjPtr(), elementFieldClass.libObjPtr(), nullptr);
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return ArrayFieldClass::Shared {ArrayFieldClass {libObjPtr}};
+        return ArrayFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     DynamicArrayWithLengthFieldClass::Shared
-    createDynamicArrayFieldClass(const FieldClass& elementFieldClass,
-                                 const IntegerFieldClass& lengthFieldClass)
+    createDynamicArrayFieldClass(const FieldClass elementFieldClass,
+                                 const IntegerFieldClass lengthFieldClass)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -2105,8 +2105,7 @@ public:
             this->libObjPtr(), elementFieldClass.libObjPtr(), lengthFieldClass.libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return DynamicArrayWithLengthFieldClass::Shared {
-            DynamicArrayWithLengthFieldClass {libObjPtr}};
+        return DynamicArrayWithLengthFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     StructureFieldClass::Shared createStructureFieldClass()
@@ -2116,10 +2115,10 @@ public:
         const auto libObjPtr = bt_field_class_structure_create(this->libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return StructureFieldClass::Shared {StructureFieldClass {libObjPtr}};
+        return StructureFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
-    OptionFieldClass::Shared createOptionFieldClass(const FieldClass& optionalFieldClass)
+    OptionFieldClass::Shared createOptionFieldClass(const FieldClass optionalFieldClass)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -2127,12 +2126,12 @@ public:
             this->libObjPtr(), optionalFieldClass.libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return OptionFieldClass::Shared {OptionFieldClass {libObjPtr}};
+        return OptionFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     OptionWithBoolSelectorFieldClass::Shared
-    createOptionWithBoolSelectorFieldClass(const FieldClass& optionalFieldClass,
-                                           const FieldClass& selectorFieldClass)
+    createOptionWithBoolSelectorFieldClass(const FieldClass optionalFieldClass,
+                                           const FieldClass selectorFieldClass)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -2140,14 +2139,13 @@ public:
             this->libObjPtr(), optionalFieldClass.libObjPtr(), selectorFieldClass.libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return OptionWithBoolSelectorFieldClass::Shared {
-            OptionWithBoolSelectorFieldClass {libObjPtr}};
+        return OptionWithBoolSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     OptionWithUnsignedIntegerSelectorFieldClass::Shared
-    createOptionWithUnsignedIntegerSelectorFieldClass(const FieldClass& optionalFieldClass,
-                                                      const IntegerFieldClass& selectorFieldClass,
-                                                      const ConstUnsignedIntegerRangeSet& ranges)
+    createOptionWithUnsignedIntegerSelectorFieldClass(const FieldClass optionalFieldClass,
+                                                      const IntegerFieldClass selectorFieldClass,
+                                                      const ConstUnsignedIntegerRangeSet ranges)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -2156,14 +2154,13 @@ public:
             ranges.libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return OptionWithUnsignedIntegerSelectorFieldClass::Shared {
-            OptionWithUnsignedIntegerSelectorFieldClass {libObjPtr}};
+        return OptionWithUnsignedIntegerSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     OptionWithSignedIntegerSelectorFieldClass::Shared
-    createOptionWithSignedIntegerSelectorFieldClass(const FieldClass& optionalFieldClass,
-                                                    const IntegerFieldClass& selectorFieldClass,
-                                                    const ConstSignedIntegerRangeSet& ranges)
+    createOptionWithSignedIntegerSelectorFieldClass(const FieldClass optionalFieldClass,
+                                                    const IntegerFieldClass selectorFieldClass,
+                                                    const ConstSignedIntegerRangeSet ranges)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -2172,8 +2169,7 @@ public:
             ranges.libObjPtr());
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return OptionWithSignedIntegerSelectorFieldClass::Shared {
-            OptionWithSignedIntegerSelectorFieldClass {libObjPtr}};
+        return OptionWithSignedIntegerSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     VariantWithoutSelectorFieldClass::Shared createVariantFieldClass()
@@ -2183,24 +2179,23 @@ public:
         const auto libObjPtr = bt_field_class_variant_create(this->libObjPtr(), nullptr);
 
         internal::validateCreatedObjPtr(libObjPtr);
-        return VariantWithoutSelectorFieldClass::Shared {
-            VariantWithoutSelectorFieldClass {libObjPtr}};
+        return VariantWithoutSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
     VariantWithUnsignedIntegerSelectorFieldClass::Shared
-    createVariantWithUnsignedIntegerSelectorFieldClass(const IntegerFieldClass& selectorFieldClass)
+    createVariantWithUnsignedIntegerSelectorFieldClass(const IntegerFieldClass selectorFieldClass)
     {
-        return VariantWithUnsignedIntegerSelectorFieldClass::Shared {
-            VariantWithUnsignedIntegerSelectorFieldClass {
-                this->_createVariantWithIntegerSelectorFieldClass(selectorFieldClass)}};
+        return VariantWithUnsignedIntegerSelectorFieldClass {
+            this->_createVariantWithIntegerSelectorFieldClass(selectorFieldClass)}
+            .shared();
     }
 
     VariantWithSignedIntegerSelectorFieldClass::Shared
-    createVariantWithSignedIntegerSelectorFieldClass(const IntegerFieldClass& selectorFieldClass)
+    createVariantWithSignedIntegerSelectorFieldClass(const IntegerFieldClass selectorFieldClass)
     {
-        return VariantWithSignedIntegerSelectorFieldClass::Shared {
-            VariantWithSignedIntegerSelectorFieldClass {
-                this->_createVariantWithIntegerSelectorFieldClass(selectorFieldClass)}};
+        return VariantWithSignedIntegerSelectorFieldClass {
+            this->_createVariantWithIntegerSelectorFieldClass(selectorFieldClass)}
+            .shared();
     }
 
     void assignsAutomaticStreamClassId(const bool val) noexcept
@@ -2255,7 +2250,7 @@ public:
     }
 
     template <typename LibValT>
-    void userAttributes(const CommonMapValue<LibValT>& userAttrs)
+    void userAttributes(const CommonMapValue<LibValT> userAttrs)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
@@ -2274,12 +2269,12 @@ public:
 
     Shared shared() const noexcept
     {
-        return Shared {*this};
+        return Shared::createWithRef(*this);
     }
 
 private:
     bt_field_class *
-    _createVariantWithIntegerSelectorFieldClass(const IntegerFieldClass& selectorFieldClass)
+    _createVariantWithIntegerSelectorFieldClass(const IntegerFieldClass selectorFieldClass)
     {
         static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
 
This page took 0.03659 seconds and 4 git commands to generate.