Skip to content

Commit

Permalink
Fix and expose pull mode (#1891)
Browse files Browse the repository at this point in the history
* Refs 10716. Fix on send_any_unsent_changes.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 10716. Always use push mode for best effort readers.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 10716. Refactor heartbeat sending.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 10716. Always push on intraprocess.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 10716. Improve synchronous delivery.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Fixed discovery tests.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Fixed RequestReplier tests.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Correctly enabling datasharing on request replier.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Added pull_mode infrastructure to blackbox tests.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Added pull_mode to PubSubBasic blackbox.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Refactor on DataWriterTests.InvalidQos.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Added pull mode inconsistencies to DataWriterTests.InvalidQos.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Added pull mode consistency checks.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Set push mode value on RTPS writer creation.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Uncrustify.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 11113. Fixed PubSubBasic.PubSubAsNonReliableHelloworld.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
  • Loading branch information
MiguelCompany authored Apr 13, 2021
1 parent d05d0cf commit e0ba220
Show file tree
Hide file tree
Showing 13 changed files with 296 additions and 155 deletions.
21 changes: 21 additions & 0 deletions src/cpp/fastdds/publisher/DataWriterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ namespace eprosima {
namespace fastdds {
namespace dds {

static bool qos_has_pull_mode_request(
const DataWriterQos& qos)
{
auto push_mode = PropertyPolicyHelper::find_property(qos.properties(), "fastdds.push_mode");
return (nullptr != push_mode) && ("false" == *push_mode);
}

class DataWriterImpl::LoanCollection
{
public:
Expand Down Expand Up @@ -1335,6 +1342,20 @@ ReturnCode_t DataWriterImpl::check_qos(
logError(RTPS_QOS_CHECK, "Unique network flows not supported on writers");
return ReturnCode_t::RETCODE_UNSUPPORTED;
}
bool is_pull_mode = qos_has_pull_mode_request(qos);
if (is_pull_mode)
{
if (BEST_EFFORT_RELIABILITY_QOS == qos.reliability().kind)
{
logError(RTPS_QOS_CHECK, "BEST_EFFORT incompatible with pull mode");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
if (c_TimeInfinite == qos.reliable_writer_qos().times.heartbeatPeriod)
{
logError(RTPS_QOS_CHECK, "Infinite heartbeat period incompatible with pull mode");
return ReturnCode_t::RETCODE_INCONSISTENT_POLICY;
}
}
if (qos.reliability().kind == BEST_EFFORT_RELIABILITY_QOS && qos.ownership().kind == EXCLUSIVE_OWNERSHIP_QOS)
{
logError(RTPS_QOS_CHECK, "BEST_EFFORT incompatible with EXCLUSIVE ownership");
Expand Down
Loading

0 comments on commit e0ba220

Please sign in to comment.