Skip to content

Commit

Permalink
Refs #21295: Change signature of fill_discovery_data_from_cdr_message
Browse files Browse the repository at this point in the history
Signed-off-by: elianalf <[email protected]>
  • Loading branch information
elianalf committed Jul 17, 2024
1 parent 49278c4 commit 6bfa982
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 20 deletions.
5 changes: 3 additions & 2 deletions include/fastdds/rtps/participant/RTPSParticipant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <fastdds/dds/subscriber/qos/ReaderQos.hpp>
#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
#include <fastdds/rtps/builtin/data/ContentFilterProperty.hpp>
#include <fastdds/rtps/builtin/data/ParticipantBuiltinTopicData.hpp>
#include <fastdds/rtps/common/Guid.hpp>
#include <fastdds/statistics/IListeners.hpp>
#include <fastdds/fastdds_dll.hpp>
Expand Down Expand Up @@ -396,15 +397,15 @@ class FASTDDS_EXPORTED_API RTPSParticipant
bool disable_monitor_service() const;

/**
* fills in the ParticipantProxyData from a MonitorService Message
* fills in the ParticipantBuiltinTopicData from a MonitorService Message
*
* @param [out] data Proxy to fill
* @param [in] msg MonitorService Message to get the proxy information from.
*
* @return true if the operation succeeds.
*/
bool fill_discovery_data_from_cdr_message(
ParticipantProxyData& data,
ParticipantBuiltinTopicData& data,
fastdds::statistics::MonitorServiceStatusData& msg);

/**
Expand Down
8 changes: 4 additions & 4 deletions include/fastdds/statistics/dds/domain/DomainParticipant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant
FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t disable_monitor_service();

/**
* fills in the ParticipantProxyData from a MonitorService Message
* fills in the ParticipantBuiltinTopicData from a MonitorService Message
*
* @param [out] data Proxy to fill
* @param [in] msg MonitorService Message to get the proxy information from.
Expand All @@ -145,7 +145,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant
* @return RETCODE_ERROR if the operation fails.
*/
FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message(
fastdds::rtps::ParticipantProxyData& data,
fastdds::rtps::ParticipantBuiltinTopicData& data,
statistics::MonitorServiceStatusData& msg);

/**
Expand All @@ -162,7 +162,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant
statistics::MonitorServiceStatusData& msg);

/**
* fills in the ParticipantProxyData from a MonitorService Message
* fills in the ParticipantBuiltinTopicData from a MonitorService Message
*
* @param [out] data Proxy to fill
* @param [in] msg MonitorService Message to get the proxy information from.
Expand All @@ -171,7 +171,7 @@ class DomainParticipant : public eprosima::fastdds::dds::DomainParticipant
* @return RETCODE_ERROR if the operation fails.
*/
FASTDDS_EXPORTED_API eprosima::fastdds::dds::ReturnCode_t fill_discovery_data_from_cdr_message(
fastdds::rtps::ParticipantProxyData& data,
fastdds::rtps::ParticipantBuiltinTopicData& data,
const statistics::MonitorServiceStatusData& msg);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/participant/RTPSParticipant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ bool RTPSParticipant::disable_monitor_service() const
}

bool RTPSParticipant::fill_discovery_data_from_cdr_message(
ParticipantProxyData& data,
ParticipantBuiltinTopicData& data,
fastdds::statistics::MonitorServiceStatusData& msg)
{
return mp_impl->fill_discovery_data_from_cdr_message(data, msg);
Expand Down
14 changes: 11 additions & 3 deletions src/cpp/rtps/participant/RTPSParticipantImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2931,7 +2931,7 @@ bool RTPSParticipantImpl::disable_monitor_service() const
}

bool RTPSParticipantImpl::fill_discovery_data_from_cdr_message(
fastdds::rtps::ParticipantProxyData& data,
fastdds::rtps::ParticipantBuiltinTopicData& data,
fastdds::statistics::MonitorServiceStatusData& msg)
{
bool ret = true;
Expand All @@ -2941,15 +2941,23 @@ bool RTPSParticipantImpl::fill_discovery_data_from_cdr_message(
serialized_msg.buffer = msg.value().entity_proxy().data();
serialized_msg.length = static_cast<uint32_t>(msg.value().entity_proxy().size());

ret = data.readFromCDRMessage(
ParticipantProxyData part_prox_data(m_att.allocation);


ret = part_prox_data.readFromCDRMessage(
&serialized_msg,
true,
network_factory(),
has_shm_transport(),
false,
c_VendorId_eProsima);

return ret && (data.m_guid.entityId == c_EntityId_RTPSParticipant);
if (ret)
{
from_proxy_to_builtin(part_prox_data, data);
}

return ret && (data.guid.entityId == c_EntityId_RTPSParticipant);
}

bool RTPSParticipantImpl::fill_discovery_data_from_cdr_message(
Expand Down
5 changes: 3 additions & 2 deletions src/cpp/rtps/participant/RTPSParticipantImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
#include <fastdds/rtps/builtin/data/ContentFilterProperty.hpp>
#include <fastdds/rtps/builtin/data/ParticipantBuiltinTopicData.hpp>
#include <fastdds/rtps/builtin/data/ReaderProxyData.hpp>
#include <fastdds/rtps/common/Guid.hpp>
#include <fastdds/rtps/common/LocatorList.hpp>
Expand Down Expand Up @@ -1218,15 +1219,15 @@ class RTPSParticipantImpl
bool disable_monitor_service() const;

/**
* fills in the ParticipantProxyData from a MonitorService Message
* fills in the ParticipantBuiltinTopicData from a MonitorService Message
*
* @param [out] data Proxy to fill
* @param [in] msg MonitorService Message to get the proxy information from.
*
* @return true if the operation succeeds.
*/
bool fill_discovery_data_from_cdr_message(
ParticipantProxyData& data,
ParticipantBuiltinTopicData& data,
fastdds::statistics::MonitorServiceStatusData& msg);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/statistics/fastdds/domain/DomainParticipant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fastdds::dds::ReturnCode_t DomainParticipant::disable_monitor_service()
}

fastdds::dds::ReturnCode_t DomainParticipant::fill_discovery_data_from_cdr_message(
fastdds::rtps::ParticipantProxyData& data,
fastdds::rtps::ParticipantBuiltinTopicData& data,
fastdds::statistics::MonitorServiceStatusData& msg)
{
#ifdef FASTDDS_STATISTICS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ ReturnCode_t DomainParticipantImpl::disable_monitor_service()
}

ReturnCode_t DomainParticipantImpl::fill_discovery_data_from_cdr_message(
fastdds::rtps::ParticipantProxyData& data,
fastdds::rtps::ParticipantBuiltinTopicData& data,
fastdds::statistics::MonitorServiceStatusData& msg)
{
ReturnCode_t ret{efd::RETCODE_OK};
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl,
efd::ReturnCode_t disable_monitor_service();

/**
* fills in the ParticipantProxyData from a MonitorService Message
* fills in the ParticipantBuiltinTopicData from a MonitorService Message
*
* @param [out] data Proxy to fill
* @param [in] msg MonitorService Message to get the proxy information from.
Expand All @@ -155,7 +155,7 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl,
* @return RETCODE_ERROR if the operation fails.
*/
efd::ReturnCode_t fill_discovery_data_from_cdr_message(
fastdds::rtps::ParticipantProxyData& data,
fastdds::rtps::ParticipantBuiltinTopicData& data,
fastdds::statistics::MonitorServiceStatusData& msg);

/**
Expand Down
5 changes: 2 additions & 3 deletions test/blackbox/common/DDSBlackboxTestsMonitorService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,16 +703,15 @@ struct ProxySampleValidator : public SampleValidator

if (guid.entityId == c_EntityId_RTPSParticipant)
{
RTPSParticipantAllocationAttributes att;
eprosima::fastdds::rtps::ParticipantProxyData pdata(att);
eprosima::fastdds::rtps::ParticipantBuiltinTopicData pdata;

ASSERT_EQ(participant->fill_discovery_data_from_cdr_message(pdata,
data),
eprosima::fastdds::dds::RETCODE_OK);

auto part_names = participant->get_participant_names();
auto it_names =
std::find(part_names.begin(), part_names.end(), pdata.m_participantName.to_string());
std::find(part_names.begin(), part_names.end(), pdata.participant_name.to_string());
ASSERT_TRUE(it_names != part_names.end());
}
else if (guid.entityId.is_reader())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <fastdds/dds/subscriber/qos/ReaderQos.hpp>
#include <fastdds/fastdds_dll.hpp>
#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
#include <fastdds/rtps/builtin/data/ParticipantBuiltinTopicData.hpp>
#include <fastdds/rtps/common/Guid.hpp>

#include <rtps/builtin/data/ParticipantProxyData.hpp>
Expand Down Expand Up @@ -126,7 +127,7 @@ class FASTDDS_EXPORTED_API RTPSParticipant
}

bool fill_discovery_data_from_cdr_message(
fastdds::rtps::ParticipantProxyData& /*data*/,
fastdds::rtps::ParticipantBuiltinTopicData& /*data*/,
fastdds::statistics::MonitorServiceStatusData& /*msg*/)
{
return true;
Expand Down

0 comments on commit 6bfa982

Please sign in to comment.