Skip to content

Commit 3224e48

Browse files
Apply more suggestions
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
1 parent 34155d1 commit 3224e48

4 files changed

Lines changed: 58 additions & 11 deletions

File tree

ddspipe_participants/include/ddspipe_participants/writer/dds/CommonWriter.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,25 @@ class CommonWriter : public BaseWriter
131131
// INTERNAL METHODS
132132
/////////////////////////
133133

134+
/**
135+
* @brief Get the specific Publisher QoS for the \c DdsTopic associated to this writer.
136+
*
137+
* This method is used to set the QoS of the Publisher that will be created for this writer.
138+
* It takes into account the default publisher QoS and the specific \c DdsTopic QoS of this writer.
139+
*
140+
* @return The Publisher QoS to be used for this writer.
141+
*/
134142
DDSPIPE_PARTICIPANTS_DllAPI
135143
virtual fastdds::dds::PublisherQos reckon_publisher_qos_() const noexcept;
136144

145+
/**
146+
* @brief Get the specific DataWriter QoS for the \c DdsTopic associated to this writer.
147+
*
148+
* This method is used to set the QoS of the DataWriter that will be created for this writer.
149+
* It takes into account the default data writer QoS and the specific \c DdsTopic QoS of this writer.
150+
*
151+
* @return The DataWriter QoS to be used for this writer.
152+
*/
137153
DDSPIPE_PARTICIPANTS_DllAPI
138154
virtual fastdds::dds::DataWriterQos reckon_writer_qos_() const noexcept;
139155

ddspipe_participants/include/ddspipe_participants/writer/dds/filter/RepeaterDataFilter.hpp

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/**
16+
* @file RepeaterDataFilter.hpp
17+
*/
18+
1519
#pragma once
1620

1721
#include <fastdds/rtps/common/Guid.hpp>
@@ -26,24 +30,41 @@ namespace participants {
2630
namespace dds {
2731

2832
/**
29-
* Struct containing all relevant information for the RepeaterDataFilter.
33+
* @brief Struct containing all relevant information for the \c RepeaterDataFilter.
34+
*
35+
* This structure extends the \c UserWriteData to include the GUID prefix of the last writer
36+
* that sent a change. It is used to track the origin of a message in repeater scenarios.
3037
*/
3138
struct RepeaterWriteData : public fastdds::rtps::WriteParams::UserWriteData
3239
{
33-
// GUID of the writer that sent this change.
40+
/// GUID of the writer that sent this change.
3441
fastdds::rtps::GuidPrefix_t last_writer_guid_prefix;
3542
};
3643

3744
/**
38-
* This filter allows to not send messages from this Writer to the Readers belonging to the source Participant.
39-
* It is used in "repeater" participants in order to propagate information to external participants
40-
* (participants not belonging to the same DDS-Router instance),
41-
* leaving out the participant from which this information was received.
45+
* @brief Data filter to prevent sending messages back to their source participant.
46+
*
47+
* This filter is used by "repeater" participants to propagate information only to external participants,
48+
* i.e., participants not belonging to the same DDS-Router instance. It ensures that messages are not
49+
* sent to readers that belong to the participant from which the information was originally received.
4250
*/
4351
class RepeaterDataFilter : public SelfDataFilter
4452
{
4553
public:
4654

55+
/**
56+
* @brief Evaluates whether a message should be sent to a given reader.
57+
*
58+
* This method checks whether the reader belongs to the same participant from which the message originated.
59+
* I also checks whether the reader belongs to the same participant as the writer.
60+
*
61+
* @param payload The serialized payload of the message.
62+
* @param sample_info Information about the sample for content filtering.
63+
* @param reader_guid The GUID of the reader to which the message may be sent.
64+
* @return true if the reader does not belong to the participant that sent the message
65+
* and also does not belong to the same participant as the writer.
66+
* @return false otherwise.
67+
*/
4768
DDSPIPE_PARTICIPANTS_DllAPI
4869
bool evaluate(
4970
const fastdds::rtps::SerializedPayload_t& payload,

ddspipe_participants/include/ddspipe_participants/writer/dds/filter/SelfDataFilter.hpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
/**
16+
* @file SelfDataFilter.hpp
17+
*/
18+
1519
#pragma once
1620

1721
#include <fastdds/dds/topic/IContentFilter.hpp>
@@ -27,16 +31,24 @@ namespace participants {
2731
namespace dds {
2832

2933
/**
30-
* This filter allows to not send messages from this Writer to the Readers in the same Participant.
34+
* @brief Filter to prevent sending messages from this writer to readers in the same participant.
35+
*
36+
* This filter ensures that messages originating from this writer are not delivered
37+
* to readers that belong to the same participant, avoiding self-data delivery.
3138
*/
3239
class SelfDataFilter : public fastdds::dds::IContentFilter
3340
{
3441
public:
3542

3643
/**
37-
* @brief Whether incoming sample is relevant for this reader.
44+
* @brief Evaluates whether a message should be sent to a given reader.
45+
*
46+
* This method checks whether the reader belongs to the same participant as the writer.
3847
*
39-
* @return true if the reader does not belong to same Participant.
48+
* @param payload The serialized payload of the message.
49+
* @param sample_info Information about the sample for content filtering.
50+
* @param reader_guid The GUID of the reader to which the message may be sent.
51+
* @return true if the reader does not belong to the same participant.
4052
* @return false otherwise.
4153
*/
4254
DDSPIPE_PARTICIPANTS_DllAPI

ddspipe_participants/src/cpp/writer/dds/CommonWriter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ fastdds::dds::DataWriterQos CommonWriter::reckon_writer_qos_() const noexcept
170170
{
171171
fastdds::dds::DataWriterQos qos = dds_publisher_->get_default_datawriter_qos();
172172

173-
dds_publisher_->get_default_datawriter_qos();
174-
175173
qos.durability().kind =
176174
(topic_.topic_qos.is_transient_local())
177175
? fastdds::dds::DurabilityQosPolicyKind::TRANSIENT_LOCAL_DURABILITY_QOS

0 commit comments

Comments
 (0)