Skip to content

Commit

Permalink
Refs #20722: Apply rev suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: JesusPoderoso <[email protected]>
  • Loading branch information
JesusPoderoso committed Apr 2, 2024
1 parent 8d7fb2a commit 1d82d1f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/fastdds/dds/core/policy/QosPolicies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1728,21 +1728,21 @@ class ResourceLimitsQosPolicy : public Parameter_t, public QosPolicy
* @brief Specifies the maximum number of data-samples the DataWriter (or DataReader) can manage across all the
* instances associated with it. Represents the maximum samples the middleware can store for any one DataWriter
* (or DataReader). <br>
* Value 0 means infinite resources. By default, 5000.
* Value less or equal to 0 means infinite resources. By default, 5000.
*
* @warning It is inconsistent if `max_samples < (max_instances * max_samples_per_instance)`.
*/
int32_t max_samples;
/**
* @brief Represents the maximum number of instances DataWriter (or DataReader) can manage. <br>
* Value 0 means infinite resources. By default, 10.
* Value less or equal to 0 means infinite resources. By default, 10.
*
* @warning It is inconsistent if `(max_instances * max_samples_per_instance) > max_samples`.
*/
int32_t max_instances;
/**
* @brief Represents the maximum number of samples of any one instance a DataWriter(or DataReader) can manage. <br>
* Value 0 means infinite resources. By default, 400.
* Value less or equal to 0 means infinite resources. By default, 400.
*
* @warning It is inconsistent if `(max_instances * max_samples_per_instance) > max_samples`.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/cpp/fastdds/publisher/DataWriterHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ DataWriterHistory::DataWriterHistory(
, topic_att_(topic_att)
, unacknowledged_sample_removed_functor_(unack_sample_remove_functor)
{
if (resource_limited_qos_.max_samples <= 0)
{
resource_limited_qos_.max_samples = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
Expand Down
5 changes: 5 additions & 0 deletions src/cpp/fastrtps_deprecated/publisher/PublisherHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ PublisherHistory::PublisherHistory(
, resource_limited_qos_(topic_att.resourceLimitsQos)
, topic_att_(topic_att)
{
if (resource_limited_qos_.max_samples <= 0)
{
resource_limited_qos_.max_samples = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ class DataWriterHistory : public WriterHistory
, topic_att_(topic_att)
, unacknowledged_sample_removed_functor_(unack_sample_remove_functor)
{
if (resource_limited_qos_.max_samples <= 0)
{
resource_limited_qos_.max_samples = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ class PublisherHistory : public WriterHistory
, resource_limited_qos_(topic_att.resourceLimitsQos)
, topic_att_(topic_att)
{
if (resource_limited_qos_.max_samples <= 0)
{
resource_limited_qos_.max_samples = std::numeric_limits<int32_t>::max();
}

if (resource_limited_qos_.max_instances <= 0)
{
resource_limited_qos_.max_instances = std::numeric_limits<int32_t>::max();
Expand Down

0 comments on commit 1d82d1f

Please sign in to comment.