@@ -2228,6 +2228,69 @@ void DataWriterImpl::filter_is_being_removed(
2228
2228
}
2229
2229
}
2230
2230
2231
+ ReturnCode_t DataWriterImpl::get_matched_subscription_data (
2232
+ builtin::SubscriptionBuiltinTopicData& subscription_data,
2233
+ const fastrtps::rtps::InstanceHandle_t& subscription_handle) const
2234
+ {
2235
+ fastrtps::types::ReturnCode_t ret = ReturnCode_t::RETCODE_BAD_PARAMETER;
2236
+ GUID_t reader_guid = iHandle2GUID (subscription_handle);
2237
+
2238
+ if (writer_ && writer_->matched_reader_is_matched (reader_guid))
2239
+ {
2240
+ if (publisher_)
2241
+ {
2242
+ RTPSParticipant* rtps_participant = publisher_->rtps_participant ();
2243
+ if (rtps_participant &&
2244
+ rtps_participant->get_subscription_info (subscription_data, reader_guid))
2245
+ {
2246
+ ret = ReturnCode_t::RETCODE_OK;
2247
+ }
2248
+ }
2249
+ }
2250
+
2251
+ return ret;
2252
+ }
2253
+
2254
+ ReturnCode_t DataWriterImpl::get_matched_subscriptions (
2255
+ std::vector<InstanceHandle_t>& subscription_handles) const
2256
+ {
2257
+ ReturnCode_t ret = ReturnCode_t::RETCODE_ERROR;
2258
+ std::vector<GUID_t> matched_reader_guids;
2259
+ subscription_handles.clear ();
2260
+
2261
+ if (writer_ && writer_->matched_readers_guids (matched_reader_guids))
2262
+ {
2263
+ for (const GUID_t& guid : matched_reader_guids)
2264
+ {
2265
+ subscription_handles.emplace_back (InstanceHandle_t (guid));
2266
+ }
2267
+ ret = ReturnCode_t::RETCODE_OK;
2268
+ }
2269
+
2270
+ return ret;
2271
+ }
2272
+
2273
+ ReturnCode_t DataWriterImpl::get_matched_subscriptions (
2274
+ std::vector<InstanceHandle_t*>& subscription_handles) const
2275
+ {
2276
+ ReturnCode_t ret = ReturnCode_t::RETCODE_ERROR;
2277
+ std::vector<GUID_t> matched_reader_guids;
2278
+ subscription_handles.clear ();
2279
+
2280
+ if (writer_ && writer_->matched_readers_guids (matched_reader_guids))
2281
+ {
2282
+ for (const GUID_t& guid : matched_reader_guids)
2283
+ {
2284
+ // Note: user is responsible for deleting the InstanceHandle_t objects
2285
+ subscription_handles.push_back (new InstanceHandle_t (guid));
2286
+ }
2287
+
2288
+ ret = ReturnCode_t::RETCODE_OK;
2289
+ }
2290
+
2291
+ return ret;
2292
+ }
2293
+
2231
2294
bool DataWriterImpl::is_relevant (
2232
2295
const fastrtps::rtps::CacheChange_t& change,
2233
2296
const fastrtps::rtps::GUID_t& reader_guid) const
0 commit comments