Function rmw_dds_common::qos_profile_get_best_available_for_subscription

Function Documentation

rmw_ret_t rmw_dds_common::qos_profile_get_best_available_for_subscription(const rmw_topic_endpoint_info_array_t *publishers_info, rmw_qos_profile_t *subscription_profile)

Get the best available QoS policies for a subscription.

Given zero or more publisher endpoints, update any BEST_AVAILABLE policies in a subscription QoS profile such that is matches all publishers while maintaining the highest level of service.

If reliability is BEST_AVAILABLE, then it will be set to RELIABLE if all publishers are RELIABLE. Otherwise, reliability will be set to BEST_EFFORT.

If durability is BEST_AVAILABLE, then it will be set to TRANSIENT_LOCAL if all publishers are TRANSIENT_LOCAL. Otherwise, durability will be set to VOLATILE.

If liveliness is BEST_AVAILABLE, then it will be set to MANUAL_BY_TOPIC if all publishers are MANUAL_BY_TOPIC. Otherwise, liveliness will be set to AUTOMATIC.

If deadline is BEST_AVAILABLE, then it will be set to DEFAULT if all publishers are DEFAULT. Otherwise, deadline will be set to the maximum deadline of all publishers.

If liveliness lease duration is BEST_AVAILABLE, then it will be set to DEFAULT if all publishers are DEFAULT. Otherwise, liveliness lease duration will be set to the maximum deadline of all publishers.

History, history depth, and lifespan policies are not changed by this function.

Parameters:
  • publishers_info[in] Endpoint information for publishers.

  • subscription_profile[out] QoS profile that is compatible with the majority of the input publishers.

Returns:

RMW_RET_OK if the operation was successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if publishers_info is nullptr, or

Returns:

RMW_RET_INVALID_ARGUMENT if subscription_profile is nullptr, or

Returns:

RMW_RET_ERROR if there is an unexpected error.