Function dds_get_matched_publications

Function Documentation

dds_return_t dds_get_matched_publications(dds_entity_t reader, dds_instance_handle_t *wrs, size_t nwrs)

Get instance handles of the data writers matching a reader.

This operation fills the provided array with the instance handles of the data writers that match the reader. On successful output, the number of entries of “wrs” set is the minimum of the return value and the value of “nwrs”.

Parameters
  • reader[in] The reader.

  • wrs[in] The array to be filled.

  • nwrs[in] The size of the wrs array, at most the first nwrs entries will be filled. wrs = NULL and wrds = 0 is a valid way of determining the number of matched readers, but inefficient compared to relying on the matched publication status.

Return values
  • >=0 – The number of matching writers.

  • DDS_RETCODE_BAD_PARAMETER – The entity parameter is not valid or wrs = NULL and nwrs > 0.

  • DDS_RETCODE_ILLEGAL_OPERATION – The operation is invoked on an inappropriate object.

Returns

A dds_return_t indicating the number of matched writers or failure. The return value may be larger than nwrs if there are more matching writers than the array can hold.