Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: tempate <[email protected]>
  • Loading branch information
Tempate committed Nov 6, 2023
1 parent e13ca48 commit 1f9a662
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include <ddspipe_core/communication/dds/Track.hpp>
#include <ddspipe_core/configuration/RoutesConfiguration.hpp>
#include <ddspipe_core/types/topic/dds/DistributedTopic.hpp>
#include <ddspipe_core/types/topic/filter/WildcardDdsFilterTopic.hpp>
#include <ddspipe_core/types/topic/filter/ManualTopic.hpp>
#include <ddspipe_core/types/topic/filter/WildcardDdsFilterTopic.hpp>

namespace eprosima {
namespace ddspipe {
Expand Down
15 changes: 13 additions & 2 deletions ddspipe_core/include/ddspipe_core/types/dds/TopicQoS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,23 @@ using HistoryDepthType = unsigned int;
using OwnershipQosPolicyKind = eprosima::fastdds::dds::OwnershipQosPolicyKind;

/**
* Collection of QoS related with a Topic.
* The collection of QoS related to a Topic.
*
* The Topic QoS are:
* - Durability
* - Reliability
* - Ownership
* - Partitions
* - Keyed
* - History Depth
* - Max Transmission Rate
* - Max Reception Rate
* - Downsampling
*
* @warning partitions are considered a Topic QoS. A Topic can then only either have partitions or not have them, but it
* cannot support empty partitions.
*
* @todo add keys to Topic QoS
* @todo create a child of TopicQoS called DdsTopicQoS that contains the QoS specific to DDS.
*/
struct
TopicQoS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class CommonReader : public BaseReader, public fastdds::dds::DataReaderListener
reckon_reader_qos_() const;

//! Whether a change received should be processed
virtual bool should_accept_change_(
virtual bool should_accept_sample_(
const fastdds::dds::SampleInfo& info) noexcept;

virtual void fill_received_data_(
Expand Down
8 changes: 4 additions & 4 deletions ddspipe_participants/src/cpp/reader/dds/CommonReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ utils::ReturnCode CommonReader::take_nts_(
return ret;
}

// Check if the change is acceptable
if (should_accept_change_(info))
// Check if the sample is acceptable
if (should_accept_sample_(info))
{
break;
}
Expand Down Expand Up @@ -221,7 +221,7 @@ fastdds::dds::DataReaderQos CommonReader::reckon_reader_qos_() const
return qos;
}

bool CommonReader::should_accept_change_(
bool CommonReader::should_accept_sample_(
const fastdds::dds::SampleInfo& info) noexcept
{
// Reject samples sent by a Writer from the same Participant this Reader belongs to
Expand All @@ -232,7 +232,7 @@ bool CommonReader::should_accept_change_(
return false;
}

return should_accept_sample_();
return BaseReader::should_accept_sample_();
}

void CommonReader::fill_received_data_(
Expand Down
21 changes: 18 additions & 3 deletions ddspipe_yaml/include/ddspipe_yaml/YamlReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ enum YamlReaderVersion
V_1_0,

/**
* @brief Version 2.0
* @brief Version 2.0
*
* @version 0.3.0
*
Expand All @@ -68,7 +68,7 @@ enum YamlReaderVersion
V_2_0,

/**
* @brief Version 3.0
* @brief Version 3.0
*
* @version 0.4.0
*
Expand All @@ -78,7 +78,7 @@ enum YamlReaderVersion
V_3_0,

/**
* @brief Latest version.
* @brief Version 3.1.
*
* @version 0.5.0
*
Expand All @@ -87,6 +87,21 @@ enum YamlReaderVersion
*/
V_3_1,

/**
* @brief Latest version.
*
* @version 0.6.0
*
* - Forwarding Routes.
* - Remove Unused Entities.
* - Manual Topics.
* - Max Transmission Rate.
* - Max Reception Rate.
* - Downsampling.
* - Rename the `max-depth` under the `specs` tag to `history-depth`.
*/
V_4_0,

/**
* @brief Main version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ constexpr const char* VERSION_TAG_V_1_0("v1.0"); //! Version v1.0
constexpr const char* VERSION_TAG_V_2_0("v2.0"); //! Version v2.0
constexpr const char* VERSION_TAG_V_3_0("v3.0"); //! Version v3.0
constexpr const char* VERSION_TAG_V_3_1("v3.1"); //! Version v3.1
constexpr const char* VERSION_TAG_V_4_0("v4.0"); //! Version v4.0

// Topics related tags
constexpr const char* ALLOWLIST_TAG("allowlist"); //! List of allowed topics
Expand Down Expand Up @@ -136,10 +137,10 @@ constexpr const char* TOPIC_ROUTES_TAG("topic-routes"); // Topic specific forwar

// Advanced configuration
constexpr const char* SPECS_TAG("specs"); //! Specs options for DDS Router configuration
constexpr const char* SPECS_QOS_TAG("qos"); //! Global Topic QoS
constexpr const char* NUMBER_THREADS_TAG("threads"); //! Number of threads to configure the thread pool
constexpr const char* WAIT_ALL_ACKED_TIMEOUT_TAG("wait-all-acked-timeout"); //! Wait for a maximum of *wait-all-acked-timeout* ms until all msgs sent by reliable writers are acknowledged by their matched readers
constexpr const char* REMOVE_UNUSED_ENTITIES_TAG("remove-unused-entities"); //! Dynamically create and delete entities and tracks.
constexpr const char* SPECS_QOS_TAG("qos"); //! Global Topic QoS

// XML configuration tags
constexpr const char* XML_TAG("xml"); //! Tag to read xml configuration
Expand Down
5 changes: 3 additions & 2 deletions ddspipe_yaml/src/cpp/YamlReader_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ YamlReaderVersion YamlReader::get<YamlReaderVersion>(
{VERSION_TAG_V_2_0, YamlReaderVersion::V_2_0},
{VERSION_TAG_V_3_0, YamlReaderVersion::V_3_0},
{VERSION_TAG_V_3_1, YamlReaderVersion::V_3_1},
{VERSION_TAG_V_4_0, YamlReaderVersion::V_4_0},
});
}

Expand Down Expand Up @@ -411,13 +412,13 @@ void YamlReader::fill(
// Max Transmission Rate optional
if (is_tag_present(yml, QOS_MAX_TX_RATE_TAG))
{
object.max_tx_rate.set_value(get<float>(yml, QOS_MAX_TX_RATE_TAG, version));
object.max_tx_rate.set_value(get_nonnegative_float(yml, QOS_MAX_TX_RATE_TAG));
}

// Max Reception Rate optional
if (is_tag_present(yml, QOS_MAX_RX_RATE_TAG))
{
object.max_rx_rate.set_value(get<float>(yml, QOS_MAX_RX_RATE_TAG, version));
object.max_rx_rate.set_value(get_nonnegative_float(yml, QOS_MAX_RX_RATE_TAG));
}

// Downsampling optional
Expand Down

0 comments on commit 1f9a662

Please sign in to comment.