Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21710] DataWriter/Reader get_matched_publication/subscription() Test implementation #5264

Open
wants to merge 7 commits into
base: feature/21709/main
Choose a base branch
from
26 changes: 26 additions & 0 deletions include/fastdds/rtps/participant/RTPSParticipant.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ namespace dds {
namespace builtin {

class TypeLookupManager;
struct PublicationBuiltinTopicData;
struct SubscriptionBuiltinTopicData;

} // namespace builtin
} // namespace dds
Expand Down Expand Up @@ -306,6 +308,30 @@ class RTPS_DllAPI RTPSParticipant
*/
std::vector<fastdds::rtps::TransportNetmaskFilterInfo> get_netmask_filter_info() const;

/**
* @brief Fills the provided PublicationBuiltinTopicData with the information of the
* writer identified by writer_guid.
*
* @param[out] data PublicationBuiltinTopicData to fill.
* @param[in] writer_guid GUID of the writer to get the information from.
* @return True if the writer was found and the data was filled.
*/
bool get_publication_info(
fastdds::dds::builtin::PublicationBuiltinTopicData& data,
const GUID_t& writer_guid) const;

/**
* @brief Fills the provided SubscriptionBuiltinTopicData with the information of the
* reader identified by reader_guid.
*
* @param[out] data SubscriptionBuiltinTopicData to fill.
* @param[in] reader_guid GUID of the reader to get the information from.
* @return True if the reader was found and the data was filled.
*/
bool get_subscription_info(
fastdds::dds::builtin::SubscriptionBuiltinTopicData& data,
const GUID_t& reader_guid) const;

#if HAVE_SECURITY

/**
Expand Down
9 changes: 9 additions & 0 deletions include/fastdds/rtps/reader/RTPSReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@ class RTPSReader
data_filter_ = filter;
}

/**
* @brief Fills the provided vector with the GUIDs of the matched writers.
*
* @param[out] guids Vector to be filled with the GUIDs of the matched writers.
* @return True if the operation was successful.
*/
RTPS_DllAPI bool matched_writers_guids(
std::vector<GUID_t>& guids) const;

/*!
* @brief Returns there is a clean state with all Writers.
* It occurs when the Reader received all samples sent by Writers. In other words,
Expand Down
9 changes: 9 additions & 0 deletions include/fastdds/rtps/writer/RTPSWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,15 @@ class RTPSWriter
return false;
}

/**
* @brief Fills the provided vector with the GUIDs of the matched readers.
*
* @param[out] guids Vector to be filled with the GUIDs of the matched readers.
* @return True if the operation was successful.
*/
RTPS_DllAPI bool matched_readers_guids(
std::vector<GUID_t>& guids) const;

/**
* Tries to remove a change waiting a maximum of the provided microseconds.
* @param max_blocking_time_point Maximum time to wait for.
Expand Down
14 changes: 14 additions & 0 deletions src/cpp/rtps/participant/RTPSParticipant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ std::vector<fastdds::rtps::TransportNetmaskFilterInfo> RTPSParticipant::get_netm
return mp_impl->get_netmask_filter_info();
}

bool RTPSParticipant::get_publication_info(
fastdds::dds::builtin::PublicationBuiltinTopicData&,
const GUID_t&) const
{
return false;
}

bool RTPSParticipant::get_subscription_info(
fastdds::dds::builtin::SubscriptionBuiltinTopicData&,
const GUID_t&) const
{
return false;
}

#if HAVE_SECURITY

bool RTPSParticipant::is_security_enabled_for_writer(
Expand Down
6 changes: 6 additions & 0 deletions src/cpp/rtps/reader/RTPSReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@ bool RTPSReader::is_sample_valid(
return true;
}

bool RTPSReader::matched_writers_guids(
std::vector<GUID_t>&) const
{
return false;
}

#ifdef FASTDDS_STATISTICS

bool RTPSReader::add_statistics_listener(
Expand Down
6 changes: 6 additions & 0 deletions src/cpp/rtps/writer/RTPSWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,12 @@ bool RTPSWriter::send_nts(
locator_selector.locator_selector.end(), max_blocking_time_point);
}

bool RTPSWriter::matched_readers_guids(
std::vector<GUID_t>&) const
{
return false;
}

#ifdef FASTDDS_STATISTICS

bool RTPSWriter::add_statistics_listener(
Expand Down
Loading
Loading