Skip to content

Commit

Permalink
Print PolicyMasks as strings (#121)
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <[email protected]>
  • Loading branch information
Tempate authored Jul 8, 2024
1 parent 37364bc commit cb8f7e1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class CommonReader : public BaseReader, public fastrtps::rtps::ReaderListener
DDSPIPE_PARTICIPANTS_DllAPI
void on_requested_incompatible_qos(
fastrtps::rtps::RTPSReader*,
eprosima::fastdds::dds::PolicyMask qos) noexcept override;
fastdds::dds::PolicyMask qos) noexcept override;

/**
* This method is called when the reader detects that one or more samples have been lost.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class CommonWriter : public BaseWriter, public fastrtps::rtps::WriterListener
DDSPIPE_PARTICIPANTS_DllAPI
void on_offered_incompatible_qos(
fastrtps::rtps::RTPSWriter*,
eprosima::fastdds::dds::PolicyMask qos) noexcept override;
fastdds::dds::PolicyMask qos) noexcept override;

/////////////////////
// STATIC ATTRIBUTES
Expand Down
6 changes: 4 additions & 2 deletions ddspipe_participants/src/cpp/reader/rtps/CommonReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <cpp_utils/exception/InitializationException.hpp>
#include <cpp_utils/Log.hpp>
#include <cpp_utils/qos/qos_utils.hpp>

#include <ddspipe_core/interface/IRoutingData.hpp>
#include <ddspipe_core/monitoring/producers/StatusMonitorProducer.hpp>
Expand Down Expand Up @@ -447,10 +448,11 @@ void CommonReader::onReaderMatched(

void CommonReader::on_requested_incompatible_qos(
fastrtps::rtps::RTPSReader*,
eprosima::fastdds::dds::PolicyMask qos) noexcept
fastdds::dds::PolicyMask qos) noexcept
{
logWarning(DDSPIPE_RTPS_COMMONREADER_LISTENER,
"TOPIC_MISMATCH_QOS | Reader " << *this << " found a remote Writer with incompatible QoS: " << qos);
"TOPIC_MISMATCH_QOS | Reader " << *this << " found a remote Writer with incompatible QoS: " <<
utils::qos_policy_mask_to_string(qos));

monitor_qos_mismatch(topic_);
monitor_error("QOS_MISMATCH");
Expand Down
6 changes: 4 additions & 2 deletions ddspipe_participants/src/cpp/writer/rtps/CommonWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <cpp_utils/exception/InitializationException.hpp>
#include <cpp_utils/Log.hpp>
#include <cpp_utils/qos/qos_utils.hpp>
#include <cpp_utils/time/time_utils.hpp>

#include <ddspipe_participants/efficiency/cache_change/CacheChangePool.hpp>
Expand Down Expand Up @@ -138,10 +139,11 @@ void CommonWriter::onWriterChangeReceivedByAll(

void CommonWriter::on_offered_incompatible_qos(
fastrtps::rtps::RTPSWriter*,
eprosima::fastdds::dds::PolicyMask qos) noexcept
fastdds::dds::PolicyMask qos) noexcept
{
logWarning(DDSPIPE_RTPS_COMMONWRITER_LISTENER,
"Writer " << *this << " found a remote Reader with incompatible QoS: " << qos);
"Writer " << *this << " found a remote Reader with incompatible QoS: " <<
utils::qos_policy_mask_to_string(qos));
}

bool CommonWriter::come_from_this_participant_(
Expand Down

0 comments on commit cb8f7e1

Please sign in to comment.