Skip to content

Commit

Permalink
Refs #21710: Empty APIs in RTPSParticipant, RTPSWriter, RTPSReader
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL committed Sep 25, 2024
1 parent bfdb23e commit 37e9345
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 0 deletions.
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[in] writer_guid GUID of the writer to get the information from.
* @param[out] data PublicationBuiltinTopicData to fill.
* @return True if the writer was found and the data was filled.
*/
bool get_publication_info(
const GUID_t& writer_guid,
fastdds::dds::builtin::PublicationBuiltinTopicData& data) const;

/**
* @brief Fills the provided SubscriptionBuiltinTopicData with the information of the
* reader identified by reader_guid.
*
* @param[in] reader_guid GUID of the reader to get the information from.
* @param[out] data SubscriptionBuiltinTopicData to fill.
* @return True if the reader was found and the data was filled.
*/
bool get_subscription_info(
const GUID_t& reader_guid,
fastdds::dds::builtin::SubscriptionBuiltinTopicData& data) 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 get_matched_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 get_matched_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(
const GUID_t&,
fastdds::dds::builtin::PublicationBuiltinTopicData&) const
{
return false;
}

bool RTPSParticipant::get_subscription_info(
const GUID_t&,
fastdds::dds::builtin::SubscriptionBuiltinTopicData&) 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::get_matched_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::get_matched_guids(
std::vector<GUID_t>&) const
{
return false;
}

#ifdef FASTDDS_STATISTICS

bool RTPSWriter::add_statistics_listener(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ namespace dds {
namespace builtin {

class TypeLookupManager;
struct PublicationBuiltinTopicData;
struct SubscriptionBuiltinTopicData;

} // namespace builtin
} // namespace dds
Expand Down Expand Up @@ -225,6 +227,16 @@ class RTPS_DllAPI RTPSParticipant
return {};
}

MOCK_METHOD2(
get_publication_info, bool(
const GUID_t& writer_guid,
fastdds::dds::builtin::PublicationBuiltinTopicData& data));

MOCK_METHOD2(
get_subscription_info, bool(
const GUID_t& writer_guid,
fastdds::dds::builtin::SubscriptionBuiltinTopicData& data));

const RTPSParticipantAttributes& getRTPSParticipantAttributes()
{
return attributes_;
Expand Down

0 comments on commit 37e9345

Please sign in to comment.