Function rmw_dds_common::qos_profile_get_best_available_for_topic_publisher

Function Documentation

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

Update a publisher QoS profile so that it is compatible with discovered subscriptions.

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_publisher.

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 subscriptions on this topic name.

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

  • get_endpoint_info[in] The function used to query for subscription endpoint information. I.e. an implementation of rmw_get_subscriptions_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.