diff --git a/include/fastdds/rtps/attributes/PropertyPolicy.h b/include/fastdds/rtps/attributes/PropertyPolicy.h index ac673936b39..936e32d16ad 100644 --- a/include/fastdds/rtps/attributes/PropertyPolicy.h +++ b/include/fastdds/rtps/attributes/PropertyPolicy.h @@ -71,6 +71,12 @@ class PropertyPolicy (this->binary_properties_ == b.binary_properties_); } + FASTDDS_EXPORTED_API bool operator !=( + const PropertyPolicy& b) const + { + return !(*this == b); + } + //!Get properties FASTDDS_EXPORTED_API const PropertySeq& properties() const { diff --git a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp index 19e43db755a..6b387d4b08f 100644 --- a/src/cpp/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/fastdds/domain/DomainParticipantImpl.cpp @@ -1663,7 +1663,7 @@ bool DomainParticipantImpl::set_qos( { to.allocation() = from.allocation(); } - if (first_time && !(to.properties() == from.properties())) + if (first_time && (to.properties() != from.properties())) { to.properties() = from.properties(); } @@ -1710,7 +1710,7 @@ bool DomainParticipantImpl::can_qos_be_updated( EPROSIMA_LOG_WARNING(RTPS_QOS_CHECK, "ParticipantResourceLimitsQos cannot be changed after the participant is enabled"); } - if (!(to.properties() == from.properties())) + if ((to.properties() != from.properties())) { updatable = false; EPROSIMA_LOG_WARNING(RTPS_QOS_CHECK, "PropertyPolicyQos cannot be changed after the participant is enabled"); diff --git a/src/cpp/fastdds/publisher/DataWriterImpl.cpp b/src/cpp/fastdds/publisher/DataWriterImpl.cpp index 617bb73b6b0..c82df633c35 100644 --- a/src/cpp/fastdds/publisher/DataWriterImpl.cpp +++ b/src/cpp/fastdds/publisher/DataWriterImpl.cpp @@ -1998,7 +1998,7 @@ bool DataWriterImpl::can_qos_be_updated( EPROSIMA_LOG_WARNING(RTPS_QOS_CHECK, "Only the period of Positive ACKs can be changed after the creation of a DataWriter."); } - if (!(to.properties() == from.properties())) + if (to.properties() != from.properties()) { updatable = false; EPROSIMA_LOG_WARNING(RTPS_QOS_CHECK, "PropertyPolicyQos cannot be changed after the DataWriter is enabled."); diff --git a/src/cpp/fastdds/subscriber/DataReaderImpl.cpp b/src/cpp/fastdds/subscriber/DataReaderImpl.cpp index 09cb62ded93..fa864c546b3 100644 --- a/src/cpp/fastdds/subscriber/DataReaderImpl.cpp +++ b/src/cpp/fastdds/subscriber/DataReaderImpl.cpp @@ -1646,7 +1646,7 @@ bool DataReaderImpl::can_qos_be_updated( EPROSIMA_LOG_WARNING(RTPS_QOS_CHECK, "data_sharing_listener_thread cannot be changed after the DataReader is enabled."); } - if (!(to.properties() == from.properties())) + if (to.properties() != from.properties()) { updatable = false; EPROSIMA_LOG_WARNING(RTPS_QOS_CHECK, "PropertyPolicyQos cannot be changed after the DataReader is enabled."); @@ -1749,7 +1749,7 @@ void DataReaderImpl::set_qos( to.expects_inline_qos(from.expects_inline_qos()); } - if (first_time && !(to.properties() == from.properties())) + if (first_time && (to.properties() != from.properties())) { to.properties() = from.properties(); }