Function rmw_dds_common::qos_profile_get_best_available_for_topic_subscription

Function Documentation

rmw_ret_t rmw_dds_common::qos_profile_get_best_available_for_topic_subscription(const rmw_node_t *node, const char *topic_name, rmw_qos_profile_t *qos_profile, const GetEndpointInfoByTopicFunction &get_endpoint_info)

Update a subscription QoS profile so that it is compatible with discovered publishers.

If any policies in qos_profile are set to BEST_AVAILABLE, then get_endpoint_info will be called to query endpoint information for adapting the QoS policies.

For rules related to adapting ‘best available’ policies, see qos_profile_get_best_available_for_subscription.

This function allocates memory with the node’s context allocator.

Parameters:
  • node[in] Node used to query the graph.

  • topic_name[in] Query info for publishers on this topic name.

  • qos_profile[inout] Any policies that are set to ‘best available’ will by updated based on publisher endpoint QoS policies.

  • get_endpoint_info[in] The function used to query for publisher endpoint information. I.e. an implementation of rmw_get_publishers_info_by_topic.

Returns:

RMW_RET_OK if the operation was successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if node is nullptr, or

Returns:

RMW_RET_INVALID_ARGUMENT if topic_name is nullptr, or

Returns:

RMW_RET_INVALID_ARGUMENT if qos_profile is nullptr, or

Returns:

RMW_RET_INCORRECT_RMW_IMPLEMENTATION if the node implementation identifier does not match this implementation, or

Returns:

RMW_RET_BAD_ALLOC if memory allocation fails, or

Returns:

RMW_RET_ERROR if there is an unexpected error.