Function rmw_dds_common::qos_profile_get_best_available_for_publisher

Function Documentation

rmw_ret_t rmw_dds_common::qos_profile_get_best_available_for_publisher(const rmw_topic_endpoint_info_array_t *subscriptions_info, rmw_qos_profile_t *publisher_profile)

Get the best available QoS policies for a publisher.

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

If reliability is BEST_AVAILABLE, then it will be set to RELIABLE.

If durability is BEST_AVAILABLE, then it will be set to TRANSIENT_LOCAL.

If liveliness is BEST_AVAILABLE, then it will be set to MANUAL_BY_TOPIC if at least one subscription is MANUAL_BY_TOPIC. Otherwise, liveliness will be set to AUTOMATIC.

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

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

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

Parameters:
  • subscriptions_info[in] Endpoint information for subscriptions.

  • publisher_profile[out] QoS profile that is compatible with the majority of the input subscriptions.

Returns:

RMW_RET_OK if the operation was successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if subscriptions_info is nullptr, or

Returns:

RMW_RET_INVALID_ARGUMENT if publisher_profile is nullptr, or

Returns:

RMW_RET_ERROR if there is an unexpected error.