From 100fa861dbb7e463175e63326e8871446f0f35f0 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 30 May 2022 08:08:10 -0400 Subject: [PATCH] cpp-common/bt2: pass wrappers by value instead of by reference This is the convention elsewhere when using those wrappers as they only contain a single pointer. Signed-off-by: Philippe Proulx Change-Id: I23d73f6447a90372df349cb75afe56db28afc9aa Reviewed-on: https://review.lttng.org/c/babeltrace/+/8177 Reviewed-on: https://review.lttng.org/c/babeltrace/+/10826 Tested-by: jenkins --- src/cpp-common/bt2/clock-class.hpp | 6 +- src/cpp-common/bt2/field-class.hpp | 106 +++++++++++------------ src/cpp-common/bt2/field.hpp | 61 +++++++------ src/cpp-common/bt2/integer-range-set.hpp | 8 +- src/cpp-common/bt2/message.hpp | 36 ++++---- src/cpp-common/bt2/trace-ir.hpp | 86 +++++++++--------- src/cpp-common/bt2/value.hpp | 48 +++++----- 7 files changed, 175 insertions(+), 176 deletions(-) diff --git a/src/cpp-common/bt2/clock-class.hpp b/src/cpp-common/bt2/clock-class.hpp index e80c8f9d..e3463d96 100644 --- a/src/cpp-common/bt2/clock-class.hpp +++ b/src/cpp-common/bt2/clock-class.hpp @@ -109,13 +109,13 @@ public: } template - CommonClockClass(const CommonClockClass& clkClass) noexcept : + CommonClockClass(const CommonClockClass clkClass) noexcept : _ThisBorrowedObj {clkClass} { } template - _ThisCommonClockClass& operator=(const CommonClockClass& clkClass) noexcept + _ThisCommonClockClass& operator=(const CommonClockClass clkClass) noexcept { _ThisBorrowedObj::operator=(clkClass); return *this; @@ -245,7 +245,7 @@ public: } template - void userAttributes(const CommonMapValue& userAttrs) + void userAttributes(const CommonMapValue userAttrs) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); diff --git a/src/cpp-common/bt2/field-class.hpp b/src/cpp-common/bt2/field-class.hpp index 536401c4..6e1c0d67 100644 --- a/src/cpp-common/bt2/field-class.hpp +++ b/src/cpp-common/bt2/field-class.hpp @@ -202,12 +202,12 @@ public: } template - CommonFieldClass(const CommonFieldClass& fc) noexcept : _ThisBorrowedObj {fc} + CommonFieldClass(const CommonFieldClass fc) noexcept : _ThisBorrowedObj {fc} { } template - CommonFieldClass& operator=(const CommonFieldClass& fc) noexcept + CommonFieldClass& operator=(const CommonFieldClass fc) noexcept { _ThisBorrowedObj::operator=(fc); return *this; @@ -419,7 +419,7 @@ public: asVariantWithSignedIntegerSelector() const noexcept; template - void userAttributes(const CommonMapValue& userAttrs) + void userAttributes(const CommonMapValue userAttrs) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -490,14 +490,14 @@ public: } template - CommonBitArrayFieldClass(const CommonBitArrayFieldClass& fc) noexcept : + CommonBitArrayFieldClass(const CommonBitArrayFieldClass fc) noexcept : _ThisCommonFieldClass {fc} { } template CommonBitArrayFieldClass& - operator=(const CommonBitArrayFieldClass& fc) noexcept + operator=(const CommonBitArrayFieldClass fc) noexcept { _ThisCommonFieldClass::operator=(fc); return *this; @@ -565,13 +565,13 @@ public: } template - CommonIntegerFieldClass(const CommonIntegerFieldClass& fc) noexcept : + CommonIntegerFieldClass(const CommonIntegerFieldClass fc) noexcept : _ThisCommonFieldClass {fc} { } template - CommonIntegerFieldClass& operator=(const CommonIntegerFieldClass& fc) noexcept + CommonIntegerFieldClass& operator=(const CommonIntegerFieldClass fc) noexcept { _ThisCommonFieldClass::operator=(fc); return *this; @@ -798,15 +798,15 @@ public: } template - CommonBaseEnumerationFieldClass( - const CommonBaseEnumerationFieldClass& fc) noexcept : + CommonBaseEnumerationFieldClass(const CommonBaseEnumerationFieldClass fc) noexcept + : _ThisCommonIntegerFieldClass {fc} { } template CommonBaseEnumerationFieldClass& - operator=(const CommonBaseEnumerationFieldClass& fc) noexcept + operator=(const CommonBaseEnumerationFieldClass fc) noexcept { _ThisCommonIntegerFieldClass::operator=(fc); return *this; @@ -844,14 +844,14 @@ public: template CommonEnumerationFieldClass( - const CommonEnumerationFieldClass& fc) noexcept : + const CommonEnumerationFieldClass fc) noexcept : _ThisCommonEnumerationFieldClass {fc} { } template CommonEnumerationFieldClass& - operator=(const CommonEnumerationFieldClass& fc) noexcept + operator=(const CommonEnumerationFieldClass fc) noexcept { _ThisCommonEnumerationFieldClass::operator=(fc); return *this; @@ -1017,15 +1017,15 @@ public: } template - CommonStructureFieldClassMember( - const CommonStructureFieldClassMember& fc) noexcept : + CommonStructureFieldClassMember(const CommonStructureFieldClassMember fc) noexcept + : _ThisBorrowedObj {fc} { } template CommonStructureFieldClassMember& - operator=(const CommonStructureFieldClassMember& fc) noexcept + operator=(const CommonStructureFieldClassMember fc) noexcept { _ThisBorrowedObj::operator=(fc); return *this; @@ -1049,7 +1049,7 @@ public: } template - void userAttributes(const CommonMapValue& userAttrs) + void userAttributes(const CommonMapValue userAttrs) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1155,19 +1155,19 @@ public: } template - CommonStructureFieldClass(const CommonStructureFieldClass& fc) noexcept : + CommonStructureFieldClass(const CommonStructureFieldClass fc) noexcept : _ThisCommonFieldClass {fc} { } template - CommonStructureFieldClass& operator=(const CommonStructureFieldClass& fc) noexcept + CommonStructureFieldClass& operator=(const CommonStructureFieldClass fc) noexcept { _ThisCommonFieldClass::operator=(fc); return *this; } - void appendMember(const char * const name, const FieldClass& fc) + void appendMember(const char * const name, const FieldClass fc) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1179,7 +1179,7 @@ public: } } - void appendMember(const std::string& name, const FieldClass& fc) + void appendMember(const std::string& name, const FieldClass fc) { this->appendMember(name.data(), fc); } @@ -1324,13 +1324,13 @@ public: } template - CommonArrayFieldClass(const CommonArrayFieldClass& fc) noexcept : + CommonArrayFieldClass(const CommonArrayFieldClass fc) noexcept : _ThisCommonFieldClass {fc} { } template - CommonArrayFieldClass& operator=(const CommonArrayFieldClass& fc) noexcept + CommonArrayFieldClass& operator=(const CommonArrayFieldClass fc) noexcept { _ThisCommonFieldClass::operator=(fc); return *this; @@ -1395,14 +1395,14 @@ public: } template - CommonStaticArrayFieldClass(const CommonStaticArrayFieldClass& fc) noexcept : + CommonStaticArrayFieldClass(const CommonStaticArrayFieldClass fc) noexcept : _ThisCommonArrayFieldClass {fc} { } template CommonStaticArrayFieldClass& - operator=(const CommonStaticArrayFieldClass& fc) noexcept + operator=(const CommonStaticArrayFieldClass fc) noexcept { _ThisCommonArrayFieldClass::operator=(fc); return *this; @@ -1461,14 +1461,14 @@ public: template CommonDynamicArrayWithLengthFieldClass( - const CommonDynamicArrayWithLengthFieldClass& fc) noexcept : + const CommonDynamicArrayWithLengthFieldClass fc) noexcept : _ThisCommonArrayFieldClass {fc} { } template CommonDynamicArrayWithLengthFieldClass& - operator=(const CommonDynamicArrayWithLengthFieldClass& fc) noexcept + operator=(const CommonDynamicArrayWithLengthFieldClass fc) noexcept { _ThisCommonArrayFieldClass::operator=(fc); return *this; @@ -1560,13 +1560,13 @@ public: } template - CommonOptionFieldClass(const CommonOptionFieldClass& fc) noexcept : + CommonOptionFieldClass(const CommonOptionFieldClass fc) noexcept : _ThisCommonFieldClass {fc} { } template - CommonOptionFieldClass& operator=(const CommonOptionFieldClass& fc) noexcept + CommonOptionFieldClass& operator=(const CommonOptionFieldClass fc) noexcept { _ThisCommonFieldClass::operator=(fc); return *this; @@ -1635,14 +1635,14 @@ public: template CommonOptionWithSelectorFieldClass( - const CommonOptionWithSelectorFieldClass& fc) noexcept : + const CommonOptionWithSelectorFieldClass fc) noexcept : _ThisCommonOptionFieldClass {fc} { } template CommonOptionWithSelectorFieldClass& - operator=(const CommonOptionWithSelectorFieldClass& fc) noexcept + operator=(const CommonOptionWithSelectorFieldClass fc) noexcept { _ThisCommonOptionFieldClass::operator=(fc); return *this; @@ -1705,14 +1705,14 @@ public: template CommonOptionWithBoolSelectorFieldClass( - const CommonOptionWithBoolSelectorFieldClass& fc) noexcept : + const CommonOptionWithBoolSelectorFieldClass fc) noexcept : _ThisCommonOptionWithSelectorFieldClass {fc} { } template CommonOptionWithBoolSelectorFieldClass& - operator=(const CommonOptionWithBoolSelectorFieldClass& fc) noexcept + operator=(const CommonOptionWithBoolSelectorFieldClass fc) noexcept { _ThisCommonOptionWithSelectorFieldClass::operator=(fc); return *this; @@ -1810,14 +1810,14 @@ public: template CommonOptionWithIntegerSelectorFieldClass( - const CommonOptionWithIntegerSelectorFieldClass& fc) noexcept : + const CommonOptionWithIntegerSelectorFieldClass fc) noexcept : _ThisCommonOptionWithSelectorFieldClass {fc} { } template CommonOptionWithIntegerSelectorFieldClass& - operator=(const CommonOptionWithIntegerSelectorFieldClass& fc) noexcept + operator=(const CommonOptionWithIntegerSelectorFieldClass fc) noexcept { _ThisCommonOptionWithSelectorFieldClass::operator=(fc); return *this; @@ -1942,14 +1942,14 @@ public: } template - CommonVariantFieldClassOption(const CommonVariantFieldClassOption& fc) noexcept : + CommonVariantFieldClassOption(const CommonVariantFieldClassOption fc) noexcept : _ThisBorrowedObj {fc} { } template CommonVariantFieldClassOption& - operator=(const CommonVariantFieldClassOption& fc) noexcept + operator=(const CommonVariantFieldClassOption fc) noexcept { _ThisBorrowedObj::operator=(fc); return *this; @@ -1979,7 +1979,7 @@ public: } template - void userAttributes(const CommonMapValue& userAttrs) + void userAttributes(const CommonMapValue userAttrs) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2095,14 +2095,14 @@ public: template ConstVariantWithIntegerSelectorFieldClassOption( - const ConstVariantWithIntegerSelectorFieldClassOption& fc) noexcept : + const ConstVariantWithIntegerSelectorFieldClassOption fc) noexcept : _ThisBorrowedObj {fc} { } template ConstVariantWithIntegerSelectorFieldClassOption& - operator=(const ConstVariantWithIntegerSelectorFieldClassOption& fc) noexcept + operator=(const ConstVariantWithIntegerSelectorFieldClassOption fc) noexcept { _ThisBorrowedObj::operator=(fc); return *this; @@ -2204,13 +2204,13 @@ public: } template - CommonVariantFieldClass(const CommonVariantFieldClass& fc) noexcept : + CommonVariantFieldClass(const CommonVariantFieldClass fc) noexcept : _ThisCommonFieldClass {fc} { } template - CommonVariantFieldClass& operator=(const CommonVariantFieldClass& fc) noexcept + CommonVariantFieldClass& operator=(const CommonVariantFieldClass fc) noexcept { _ThisCommonFieldClass::operator=(fc); return *this; @@ -2329,20 +2329,20 @@ public: template CommonVariantWithoutSelectorFieldClass( - const CommonVariantWithoutSelectorFieldClass& fc) noexcept : + const CommonVariantWithoutSelectorFieldClass fc) noexcept : _ThisCommonVariantFieldClass {fc} { } template CommonVariantWithoutSelectorFieldClass& - operator=(const CommonVariantWithoutSelectorFieldClass& fc) noexcept + operator=(const CommonVariantWithoutSelectorFieldClass fc) noexcept { _ThisCommonVariantFieldClass::operator=(fc); return *this; } - void appendOption(const char * const name, const FieldClass& fc) + void appendOption(const char * const name, const FieldClass fc) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2355,7 +2355,7 @@ public: } } - void appendOption(const nonstd::optional& name, const FieldClass& fc) + void appendOption(const nonstd::optional& name, const FieldClass fc) { this->appendOption(name ? name->data() : nullptr, fc); } @@ -2476,14 +2476,14 @@ public: template CommonVariantWithSelectorFieldClass( - const CommonVariantWithSelectorFieldClass& fc) noexcept : + const CommonVariantWithSelectorFieldClass fc) noexcept : _ThisCommonVariantFieldClass {fc} { } template CommonVariantWithSelectorFieldClass& - operator=(const CommonVariantWithSelectorFieldClass& fc) noexcept + operator=(const CommonVariantWithSelectorFieldClass fc) noexcept { _ThisCommonVariantFieldClass::operator=(fc); return *this; @@ -2535,14 +2535,14 @@ public: template CommonVariantWithIntegerSelectorFieldClass( - const CommonVariantWithIntegerSelectorFieldClass& fc) noexcept : + const CommonVariantWithIntegerSelectorFieldClass fc) noexcept : _ThisCommonVariantWithSelectorFieldClass {fc} { } template CommonVariantWithIntegerSelectorFieldClass& - operator=(const CommonVariantWithIntegerSelectorFieldClass& fc) noexcept + operator=(const CommonVariantWithIntegerSelectorFieldClass fc) noexcept { _ThisCommonVariantWithSelectorFieldClass::operator=(fc); return *this; @@ -2569,8 +2569,8 @@ public: return (*this)[name.data()]; } - void appendOption(const char * const name, const FieldClass& fc, - const typename Option::RangeSet& ranges) + void appendOption(const char * const name, const FieldClass fc, + const typename Option::RangeSet ranges) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2583,8 +2583,8 @@ public: } } - void appendOption(const nonstd::optional& name, const FieldClass& fc, - const typename Option::RangeSet& ranges) + void appendOption(const nonstd::optional& name, const FieldClass fc, + const typename Option::RangeSet ranges) { this->appendOption(name ? name->data() : nullptr, fc, ranges); } diff --git a/src/cpp-common/bt2/field.hpp b/src/cpp-common/bt2/field.hpp index 126f8aa8..7b677718 100644 --- a/src/cpp-common/bt2/field.hpp +++ b/src/cpp-common/bt2/field.hpp @@ -108,12 +108,12 @@ public: } template - CommonField(const CommonField& val) noexcept : _ThisBorrowedObj {val} + CommonField(const CommonField val) noexcept : _ThisBorrowedObj {val} { } template - _ThisCommonField& operator=(const CommonField& val) noexcept + _ThisCommonField& operator=(const CommonField val) noexcept { _ThisBorrowedObj::operator=(val); return *this; @@ -265,12 +265,12 @@ public: } template - CommonBoolField(const CommonBoolField& val) noexcept : _ThisCommonField {val} + CommonBoolField(const CommonBoolField val) noexcept : _ThisCommonField {val} { } template - CommonBoolField& operator=(const CommonBoolField& val) noexcept + CommonBoolField& operator=(const CommonBoolField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -335,13 +335,13 @@ public: } template - CommonBitArrayField(const CommonBitArrayField& val) noexcept : + CommonBitArrayField(const CommonBitArrayField val) noexcept : _ThisCommonField {val} { } template - CommonBitArrayField& operator=(const CommonBitArrayField& val) noexcept + CommonBitArrayField& operator=(const CommonBitArrayField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -424,14 +424,14 @@ public: } template - CommonUnsignedIntegerField(const CommonUnsignedIntegerField& val) noexcept : + CommonUnsignedIntegerField(const CommonUnsignedIntegerField val) noexcept : _ThisCommonField {val} { } template _ThisCommonUnsignedIntegerField& - operator=(const CommonUnsignedIntegerField& val) noexcept + operator=(const CommonUnsignedIntegerField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -513,14 +513,14 @@ public: } template - CommonSignedIntegerField(const CommonSignedIntegerField& val) noexcept : + CommonSignedIntegerField(const CommonSignedIntegerField val) noexcept : _ThisCommonField {val} { } template _ThisCommonSignedIntegerField& - operator=(const CommonSignedIntegerField& val) noexcept + operator=(const CommonSignedIntegerField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -629,7 +629,7 @@ public: } template - CommonUnsignedEnumerationField(const CommonUnsignedEnumerationField& val) noexcept + CommonUnsignedEnumerationField(const CommonUnsignedEnumerationField val) noexcept : _ThisCommonUnsignedIntegerField {val} { @@ -637,7 +637,7 @@ public: template CommonUnsignedEnumerationField& - operator=(const CommonUnsignedEnumerationField& val) noexcept + operator=(const CommonUnsignedEnumerationField val) noexcept { _ThisCommonUnsignedIntegerField::operator=(val); return *this; @@ -711,14 +711,14 @@ public: } template - CommonSignedEnumerationField(const CommonSignedEnumerationField& val) noexcept : + CommonSignedEnumerationField(const CommonSignedEnumerationField val) noexcept : _ThisCommonSignedIntegerField {val} { } template CommonSignedEnumerationField& - operator=(const CommonSignedEnumerationField& val) noexcept + operator=(const CommonSignedEnumerationField val) noexcept { _ThisCommonSignedIntegerField::operator=(val); return *this; @@ -790,7 +790,7 @@ public: } template - CommonSinglePrecisionRealField(const CommonSinglePrecisionRealField& val) noexcept + CommonSinglePrecisionRealField(const CommonSinglePrecisionRealField val) noexcept : _ThisCommonField {val} { @@ -798,7 +798,7 @@ public: template CommonSinglePrecisionRealField& - operator=(const CommonSinglePrecisionRealField& val) noexcept + operator=(const CommonSinglePrecisionRealField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -863,7 +863,7 @@ public: } template - CommonDoublePrecisionRealField(const CommonDoublePrecisionRealField& val) noexcept + CommonDoublePrecisionRealField(const CommonDoublePrecisionRealField val) noexcept : _ThisCommonField {val} { @@ -871,7 +871,7 @@ public: template CommonDoublePrecisionRealField& - operator=(const CommonDoublePrecisionRealField& val) noexcept + operator=(const CommonDoublePrecisionRealField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -933,12 +933,12 @@ public: } template - CommonStringField(const CommonStringField& val) noexcept : _ThisCommonField {val} + CommonStringField(const CommonStringField val) noexcept : _ThisCommonField {val} { } template - CommonStringField& operator=(const CommonStringField& val) noexcept + CommonStringField& operator=(const CommonStringField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -1053,13 +1053,13 @@ public: } template - CommonStructureField(const CommonStructureField& val) noexcept : + CommonStructureField(const CommonStructureField val) noexcept : _ThisCommonField {val} { } template - CommonStructureField& operator=(const CommonStructureField& val) noexcept + CommonStructureField& operator=(const CommonStructureField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -1196,12 +1196,12 @@ public: } template - CommonArrayField(const CommonArrayField& val) noexcept : _ThisCommonField {val} + CommonArrayField(const CommonArrayField val) noexcept : _ThisCommonField {val} { } template - _ThisCommonArrayField& operator=(const CommonArrayField& val) noexcept + _ThisCommonArrayField& operator=(const CommonArrayField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -1273,14 +1273,14 @@ public: } template - CommonDynamicArrayField(const CommonDynamicArrayField& val) noexcept : + CommonDynamicArrayField(const CommonDynamicArrayField val) noexcept : _ThisCommonArrayField {val} { } template CommonDynamicArrayField& - operator=(const CommonDynamicArrayField& val) noexcept + operator=(const CommonDynamicArrayField val) noexcept { _ThisCommonArrayField::operator=(val); return *this; @@ -1367,12 +1367,12 @@ public: } template - CommonOptionField(const CommonOptionField& val) noexcept : _ThisCommonField {val} + CommonOptionField(const CommonOptionField val) noexcept : _ThisCommonField {val} { } template - CommonOptionField& operator=(const CommonOptionField& val) noexcept + CommonOptionField& operator=(const CommonOptionField val) noexcept { _ThisCommonField::operator=(val); return *this; @@ -1489,13 +1489,12 @@ public: } template - CommonVariantField(const CommonVariantField& val) noexcept : - _ThisCommonField {val} + CommonVariantField(const CommonVariantField val) noexcept : _ThisCommonField {val} { } template - CommonVariantField& operator=(const CommonVariantField& val) noexcept + CommonVariantField& operator=(const CommonVariantField val) noexcept { _ThisCommonField::operator=(val); return *this; diff --git a/src/cpp-common/bt2/integer-range-set.hpp b/src/cpp-common/bt2/integer-range-set.hpp index a2cf1192..38c2a7fd 100644 --- a/src/cpp-common/bt2/integer-range-set.hpp +++ b/src/cpp-common/bt2/integer-range-set.hpp @@ -194,27 +194,27 @@ public: } template - CommonIntegerRangeSet(const CommonIntegerRangeSet& rangeSet) noexcept : + CommonIntegerRangeSet(const CommonIntegerRangeSet rangeSet) noexcept : _ThisBorrowedObj {rangeSet} { } template _ThisCommonIntegerRangeSet& - operator=(const CommonIntegerRangeSet& rangeSet) noexcept + operator=(const CommonIntegerRangeSet rangeSet) noexcept { _ThisBorrowedObj::operator=(rangeSet); return *this; } template - bool operator==(const CommonIntegerRangeSet& other) const noexcept + bool operator==(const CommonIntegerRangeSet other) const noexcept { return _Spec::isEqual(this->libObjPtr(), other.libObjPtr()); } template - bool operator!=(const CommonIntegerRangeSet& other) const noexcept + bool operator!=(const CommonIntegerRangeSet other) const noexcept { return !(*this == other); } diff --git a/src/cpp-common/bt2/message.hpp b/src/cpp-common/bt2/message.hpp index 5f6d3760..35dd2c5b 100644 --- a/src/cpp-common/bt2/message.hpp +++ b/src/cpp-common/bt2/message.hpp @@ -96,12 +96,12 @@ public: } template - CommonMessage(const CommonMessage& val) noexcept : _ThisBorrowedObj {val} + CommonMessage(const CommonMessage val) noexcept : _ThisBorrowedObj {val} { } template - _ThisCommonMessage& operator=(const CommonMessage& val) noexcept + _ThisCommonMessage& operator=(const CommonMessage val) noexcept { _ThisBorrowedObj::operator=(val); return *this; @@ -240,14 +240,14 @@ public: } template - CommonStreamBeginningMessage(const CommonStreamBeginningMessage& val) noexcept : + CommonStreamBeginningMessage(const CommonStreamBeginningMessage val) noexcept : _ThisCommonMessage {val} { } template CommonStreamBeginningMessage& - operator=(const CommonStreamBeginningMessage& val) noexcept + operator=(const CommonStreamBeginningMessage val) noexcept { _ThisCommonMessage::operator=(val); return *this; @@ -358,14 +358,14 @@ public: } template - CommonStreamEndMessage(const CommonStreamEndMessage& val) noexcept : + CommonStreamEndMessage(const CommonStreamEndMessage val) noexcept : _ThisCommonMessage {val} { } template CommonStreamEndMessage& - operator=(const CommonStreamEndMessage& val) noexcept + operator=(const CommonStreamEndMessage val) noexcept { _ThisCommonMessage::operator=(val); return *this; @@ -475,14 +475,14 @@ public: } template - CommonPacketBeginningMessage(const CommonPacketBeginningMessage& val) noexcept : + CommonPacketBeginningMessage(const CommonPacketBeginningMessage val) noexcept : _ThisCommonMessage {val} { } template CommonPacketBeginningMessage& - operator=(const CommonPacketBeginningMessage& val) noexcept + operator=(const CommonPacketBeginningMessage val) noexcept { _ThisCommonMessage::operator=(val); return *this; @@ -588,14 +588,14 @@ public: } template - CommonPacketEndMessage(const CommonPacketEndMessage& val) noexcept : + CommonPacketEndMessage(const CommonPacketEndMessage val) noexcept : _ThisCommonMessage {val} { } template CommonPacketEndMessage& - operator=(const CommonPacketEndMessage& val) noexcept + operator=(const CommonPacketEndMessage val) noexcept { _ThisCommonMessage::operator=(val); return *this; @@ -700,13 +700,13 @@ public: } template - CommonEventMessage(const CommonEventMessage& val) noexcept : + CommonEventMessage(const CommonEventMessage val) noexcept : _ThisCommonMessage {val} { } template - CommonEventMessage& operator=(const CommonEventMessage& val) noexcept + CommonEventMessage& operator=(const CommonEventMessage val) noexcept { _ThisCommonMessage::operator=(val); return *this; @@ -804,14 +804,14 @@ public: } template - CommonDiscardedEventsMessage(const CommonDiscardedEventsMessage& val) noexcept : + CommonDiscardedEventsMessage(const CommonDiscardedEventsMessage val) noexcept : _ThisCommonMessage {val} { } template CommonDiscardedEventsMessage& - operator=(const CommonDiscardedEventsMessage& val) noexcept + operator=(const CommonDiscardedEventsMessage val) noexcept { _ThisCommonMessage::operator=(val); return *this; @@ -938,14 +938,14 @@ public: } template - CommonDiscardedPacketsMessage(const CommonDiscardedPacketsMessage& val) noexcept : + CommonDiscardedPacketsMessage(const CommonDiscardedPacketsMessage val) noexcept : _ThisCommonMessage {val} { } template CommonDiscardedPacketsMessage& - operator=(const CommonDiscardedPacketsMessage& val) noexcept + operator=(const CommonDiscardedPacketsMessage val) noexcept { _ThisCommonMessage::operator=(val); return *this; @@ -1047,14 +1047,14 @@ public: template CommonMessageIteratorInactivityMessage( - const CommonMessageIteratorInactivityMessage& val) noexcept : + const CommonMessageIteratorInactivityMessage val) noexcept : _ThisCommonMessage {val} { } template CommonMessageIteratorInactivityMessage& - operator=(const CommonMessageIteratorInactivityMessage& val) noexcept + operator=(const CommonMessageIteratorInactivityMessage val) noexcept { _ThisCommonMessage::operator=(val); return *this; diff --git a/src/cpp-common/bt2/trace-ir.hpp b/src/cpp-common/bt2/trace-ir.hpp index 5881092b..d55b6e1f 100644 --- a/src/cpp-common/bt2/trace-ir.hpp +++ b/src/cpp-common/bt2/trace-ir.hpp @@ -151,12 +151,12 @@ public: } template - CommonEvent(const CommonEvent& event) noexcept : _ThisBorrowedObj {event} + CommonEvent(const CommonEvent event) noexcept : _ThisBorrowedObj {event} { } template - CommonEvent& operator=(const CommonEvent& event) noexcept + CommonEvent& operator=(const CommonEvent event) noexcept { _ThisBorrowedObj::operator=(event); return *this; @@ -330,12 +330,12 @@ public: } template - CommonPacket(const CommonPacket& packet) noexcept : _ThisBorrowedObj {packet} + CommonPacket(const CommonPacket packet) noexcept : _ThisBorrowedObj {packet} { } template - _ThisCommonPacket& operator=(const CommonPacket& packet) noexcept + _ThisCommonPacket& operator=(const CommonPacket packet) noexcept { _ThisBorrowedObj::operator=(packet); return *this; @@ -508,12 +508,12 @@ public: } template - CommonStream(const CommonStream& stream) noexcept : _ThisBorrowedObj {stream} + CommonStream(const CommonStream stream) noexcept : _ThisBorrowedObj {stream} { } template - _ThisCommonStream& operator=(const CommonStream& stream) noexcept + _ThisCommonStream& operator=(const CommonStream stream) noexcept { _ThisBorrowedObj::operator=(stream); return *this; @@ -567,7 +567,7 @@ public: } template - void userAttributes(const CommonMapValue& userAttrs) + void userAttributes(const CommonMapValue userAttrs) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -747,12 +747,12 @@ public: } template - CommonTrace(const CommonTrace& trace) noexcept : _ThisBorrowedObj {trace} + CommonTrace(const CommonTrace trace) noexcept : _ThisBorrowedObj {trace} { } template - _ThisCommonTrace& operator=(const CommonTrace& trace) noexcept + _ThisCommonTrace& operator=(const CommonTrace trace) noexcept { _ThisBorrowedObj::operator=(trace); return *this; @@ -916,7 +916,7 @@ public: } template - void userAttributes(const CommonMapValue& userAttrs) + void userAttributes(const CommonMapValue userAttrs) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1094,13 +1094,13 @@ public: } template - CommonEventClass(const CommonEventClass& eventClass) noexcept : + CommonEventClass(const CommonEventClass eventClass) noexcept : _ThisBorrowedObj {eventClass} { } template - _ThisCommonEventClass& operator=(const CommonEventClass& eventClass) noexcept + _ThisCommonEventClass& operator=(const CommonEventClass eventClass) noexcept { _ThisBorrowedObj::operator=(eventClass); return *this; @@ -1188,7 +1188,7 @@ public: return nonstd::nullopt; } - void payloadFieldClass(const StructureFieldClass& fc) + void payloadFieldClass(const StructureFieldClass fc) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1222,7 +1222,7 @@ public: return nonstd::nullopt; } - void specificContextFieldClass(const StructureFieldClass& fc) + void specificContextFieldClass(const StructureFieldClass fc) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1257,7 +1257,7 @@ public: } template - void userAttributes(const CommonMapValue& userAttrs) + void userAttributes(const CommonMapValue userAttrs) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1458,19 +1458,19 @@ public: } template - CommonStreamClass(const CommonStreamClass& streamClass) noexcept : + CommonStreamClass(const CommonStreamClass streamClass) noexcept : _ThisBorrowedObj {streamClass} { } template - _ThisCommonStreamClass& operator=(const CommonStreamClass& streamClass) noexcept + _ThisCommonStreamClass& operator=(const CommonStreamClass streamClass) noexcept { _ThisBorrowedObj::operator=(streamClass); return *this; } - Stream::Shared instantiate(const Trace& trace) + Stream::Shared instantiate(const Trace trace) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1480,7 +1480,7 @@ public: 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::value, "`LibObjT` must NOT be `const`."); @@ -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::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::value, "`LibObjT` must NOT be `const`."); @@ -1745,7 +1745,7 @@ public: return nonstd::nullopt; } - void eventCommonContextFieldClass(const StructureFieldClass& fc) + void eventCommonContextFieldClass(const StructureFieldClass fc) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1780,7 +1780,7 @@ public: } template - void userAttributes(const CommonMapValue& userAttrs) + void userAttributes(const CommonMapValue userAttrs) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1940,19 +1940,19 @@ public: } template - CommonTraceClass(const CommonTraceClass& traceClass) noexcept : + CommonTraceClass(const CommonTraceClass traceClass) noexcept : _ThisBorrowedObj {traceClass} { } template - _ThisCommonTraceClass& operator=(const CommonTraceClass& traceClass) noexcept + _ThisCommonTraceClass& operator=(const CommonTraceClass traceClass) noexcept { _ThisBorrowedObj::operator=(traceClass); return *this; } - Trace::Shared instantiate(const Trace& trace) + Trace::Shared instantiate(const Trace trace) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2072,7 +2072,7 @@ public: 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::value, "`LibObjT` must NOT be `const`."); @@ -2084,7 +2084,7 @@ public: return StaticArrayFieldClass::Shared::createWithoutRef(libObjPtr); } - ArrayFieldClass::Shared createDynamicArrayFieldClass(const FieldClass& elementFieldClass) + ArrayFieldClass::Shared createDynamicArrayFieldClass(const FieldClass elementFieldClass) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2096,8 +2096,8 @@ public: } DynamicArrayWithLengthFieldClass::Shared - createDynamicArrayFieldClass(const FieldClass& elementFieldClass, - const IntegerFieldClass& lengthFieldClass) + createDynamicArrayFieldClass(const FieldClass elementFieldClass, + const IntegerFieldClass lengthFieldClass) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2118,7 +2118,7 @@ public: return StructureFieldClass::Shared::createWithoutRef(libObjPtr); } - OptionFieldClass::Shared createOptionFieldClass(const FieldClass& optionalFieldClass) + OptionFieldClass::Shared createOptionFieldClass(const FieldClass optionalFieldClass) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2130,8 +2130,8 @@ public: } OptionWithBoolSelectorFieldClass::Shared - createOptionWithBoolSelectorFieldClass(const FieldClass& optionalFieldClass, - const FieldClass& selectorFieldClass) + createOptionWithBoolSelectorFieldClass(const FieldClass optionalFieldClass, + const FieldClass selectorFieldClass) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2143,9 +2143,9 @@ public: } 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::value, "`LibObjT` must NOT be `const`."); @@ -2158,9 +2158,9 @@ public: } 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::value, "`LibObjT` must NOT be `const`."); @@ -2183,7 +2183,7 @@ public: } VariantWithUnsignedIntegerSelectorFieldClass::Shared - createVariantWithUnsignedIntegerSelectorFieldClass(const IntegerFieldClass& selectorFieldClass) + createVariantWithUnsignedIntegerSelectorFieldClass(const IntegerFieldClass selectorFieldClass) { return VariantWithUnsignedIntegerSelectorFieldClass { this->_createVariantWithIntegerSelectorFieldClass(selectorFieldClass)} @@ -2191,7 +2191,7 @@ public: } VariantWithSignedIntegerSelectorFieldClass::Shared - createVariantWithSignedIntegerSelectorFieldClass(const IntegerFieldClass& selectorFieldClass) + createVariantWithSignedIntegerSelectorFieldClass(const IntegerFieldClass selectorFieldClass) { return VariantWithSignedIntegerSelectorFieldClass { this->_createVariantWithIntegerSelectorFieldClass(selectorFieldClass)} @@ -2250,7 +2250,7 @@ public: } template - void userAttributes(const CommonMapValue& userAttrs) + void userAttributes(const CommonMapValue userAttrs) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -2274,7 +2274,7 @@ public: private: bt_field_class * - _createVariantWithIntegerSelectorFieldClass(const IntegerFieldClass& selectorFieldClass) + _createVariantWithIntegerSelectorFieldClass(const IntegerFieldClass selectorFieldClass) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); diff --git a/src/cpp-common/bt2/value.hpp b/src/cpp-common/bt2/value.hpp index 41bb4db5..6e05cd0d 100644 --- a/src/cpp-common/bt2/value.hpp +++ b/src/cpp-common/bt2/value.hpp @@ -134,12 +134,12 @@ public: } template - CommonValue(const CommonValue& val) noexcept : _ThisBorrowedObj {val} + CommonValue(const CommonValue val) noexcept : _ThisBorrowedObj {val} { } template - _ThisCommonValue& operator=(const CommonValue& val) noexcept + _ThisCommonValue& operator=(const CommonValue val) noexcept { _ThisBorrowedObj::operator=(val); return *this; @@ -196,13 +196,13 @@ public: } template - bool operator==(const CommonValue& other) const noexcept + bool operator==(const CommonValue other) const noexcept { return static_cast(bt_value_is_equal(this->libObjPtr(), other.libObjPtr())); } template - bool operator!=(const CommonValue& other) const noexcept + bool operator!=(const CommonValue other) const noexcept { return !(*this == other); } @@ -271,12 +271,12 @@ public: } template - CommonNullValue(const CommonNullValue& val) noexcept : _ThisCommonValue {val} + CommonNullValue(const CommonNullValue val) noexcept : _ThisCommonValue {val} { } template - CommonNullValue& operator=(const CommonNullValue& val) noexcept + CommonNullValue& operator=(const CommonNullValue val) noexcept { _ThisCommonValue::operator=(val); return *this; @@ -328,7 +328,7 @@ public: } template - CommonBoolValue(const CommonBoolValue& val) noexcept : _ThisCommonValue {val} + CommonBoolValue(const CommonBoolValue val) noexcept : _ThisCommonValue {val} { } @@ -341,7 +341,7 @@ public: } template - CommonBoolValue& operator=(const CommonBoolValue& val) noexcept + CommonBoolValue& operator=(const CommonBoolValue val) noexcept { _ThisCommonValue::operator=(val); return *this; @@ -420,14 +420,14 @@ public: } template - CommonUnsignedIntegerValue(const CommonUnsignedIntegerValue& val) noexcept : + CommonUnsignedIntegerValue(const CommonUnsignedIntegerValue val) noexcept : _ThisCommonValue {val} { } template CommonUnsignedIntegerValue& - operator=(const CommonUnsignedIntegerValue& val) noexcept + operator=(const CommonUnsignedIntegerValue val) noexcept { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -506,14 +506,14 @@ public: } template - CommonSignedIntegerValue(const CommonSignedIntegerValue& val) noexcept : + CommonSignedIntegerValue(const CommonSignedIntegerValue val) noexcept : _ThisCommonValue {val} { } template CommonSignedIntegerValue& - operator=(const CommonSignedIntegerValue& val) noexcept + operator=(const CommonSignedIntegerValue val) noexcept { _ThisCommonValue::operator=(val); return *this; @@ -591,12 +591,12 @@ public: } template - CommonRealValue(const CommonRealValue& val) noexcept : _ThisCommonValue {val} + CommonRealValue(const CommonRealValue val) noexcept : _ThisCommonValue {val} { } template - CommonRealValue& operator=(const CommonRealValue& val) noexcept + CommonRealValue& operator=(const CommonRealValue val) noexcept { _ThisCommonValue::operator=(val); return *this; @@ -678,12 +678,12 @@ public: } template - CommonStringValue(const CommonStringValue& val) noexcept : _ThisCommonValue {val} + CommonStringValue(const CommonStringValue val) noexcept : _ThisCommonValue {val} { } template - CommonStringValue& operator=(const CommonStringValue& val) noexcept + CommonStringValue& operator=(const CommonStringValue val) noexcept { _ThisCommonValue::operator=(val); return *this; @@ -790,12 +790,12 @@ public: } template - CommonArrayValue(const CommonArrayValue& val) noexcept : _ThisCommonValue {val} + CommonArrayValue(const CommonArrayValue val) noexcept : _ThisCommonValue {val} { } template - CommonArrayValue& operator=(const CommonArrayValue& val) noexcept + CommonArrayValue& operator=(const CommonArrayValue val) noexcept { _ThisCommonValue::operator=(val); return *this; @@ -839,7 +839,7 @@ public: internal::CommonArrayValueSpec::elementByIndex(this->libObjPtr(), index)}; } - void append(const Value& val) + void append(const Value val) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -903,7 +903,7 @@ public: CommonArrayValue appendEmptyArray(); CommonMapValue appendEmptyMap(); - void operator+=(const Value& val) + void operator+=(const Value val) { this->append(val); } @@ -1100,12 +1100,12 @@ public: } template - CommonMapValue(const CommonMapValue& val) noexcept : _ThisCommonValue {val} + CommonMapValue(const CommonMapValue val) noexcept : _ThisCommonValue {val} { } template - CommonMapValue& operator=(const CommonMapValue& val) noexcept + CommonMapValue& operator=(const CommonMapValue val) noexcept { _ThisCommonValue::operator=(val); return *this; @@ -1165,7 +1165,7 @@ public: return this->hasEntry(key.data()); } - void insert(const char * const key, const Value& val) + void insert(const char * const key, const Value val) { static_assert(!std::is_const::value, "`LibObjT` must NOT be `const`."); @@ -1174,7 +1174,7 @@ public: this->_handleInsertLibStatus(status); } - void insert(const std::string& key, const Value& val) + void insert(const std::string& key, const Value val) { this->insert(key.data(), val); } -- 2.34.1