Function rmw_service_endpoint_info_set_gids

Function Documentation

rmw_ret_t rmw_service_endpoint_info_set_gids(rmw_service_endpoint_info_t *service_endpoint_info, const uint8_t *gids, size_t endpoint_count, size_t size, rcutils_allocator_t *allocator)

Set the endpoint gids in the given service endpoint info data structure.

Copies the value of the gids argument to the data structure’s endpoint_gids member.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Remark

This function sets the RMW error state on failure.

Thread-safety

Setting a member is a reentrant procedure, but access to the service endpoint info data structure is not synchronized. It is not safe to read or write the gid member of the given service_endpoint while setting it.

Parameters:
  • service_endpoint_info[inout] Data structure to be populated.

  • gids[in] Pointer to a buffer containing endpoint GIDs to set.

  • endpoint_count[in] Number of endpoints used to construct the service.

  • size[in] Size in bytes of each individual gid.

  • allocator[in] Allocator to be used.

Returns:

RMW_RET_OK if successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if service_endpoint_info is NULL, or

Returns:

RMW_RET_INVALID_ARGUMENT if gids is NULL, or

Returns:

RMW_RET_INVALID_ARGUMENT if ‘endpoint_count’ is not 1 or 2, or

Returns:

RMW_RET_INVALID_ARGUMENT if size is greater than RMW_GID_STORAGE_SIZE, or

Returns:

RMW_RET_INVALID_ARGUMENT if allocator is NULL, or

Returns:

RMW_RET_BAD_ALLOC if memory allocation fails, or

Returns:

RMW_RET_ERROR when an unspecified error occurs.