Function rmw_discovery_options_copy

Function Documentation

rmw_ret_t rmw_discovery_options_copy(const rmw_discovery_options_t *src, rcutils_allocator_t *allocator, rmw_discovery_options_t *dst)

Perform a deep copy of the discovery options from src into dst using the given allocator. The dst will be left with an owned copy of the static peers array whose string values match the src. If successful, src and dst will evaluate as equal using rmw_discovery_options_equal.

Parameters:
  • src[in] discovery options to be copied.

  • allocator[in] to use.

  • dst[out] Destination options to use.

Returns:

RMW_RET_OK if success.

Returns:

RMW_RET_INVALID_ARGUMENT if either the src, allocator or dst is null, or

Returns:

RMW_RET_INVALID_ARUGMENT if src and dst are the same object.

Returns:

RMW_RET_BAD_ALLOC if allocation fails.