Function rcl_names_and_types_init

Function Documentation

rcl_ret_t rcl_names_and_types_init(rcl_names_and_types_t *names_and_types, size_t size, rcl_allocator_t *allocator)

Initialize a rcl_names_and_types_t object.

This function initializes the string array for the names and allocates space for all the string arrays for the types according to the given size, but it does not initialize the string array for each set of types. However, the string arrays for each set of types is zero initialized.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • names_and_types[inout] object to be initialized

  • size[in] the number of names and sets of types to be stored

  • allocator[in] to be used to allocate and deallocate memory

Returns:

RCL_RET_OK on success, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_BAD_ALLOC if memory allocation fails, or

Returns:

RCL_RET_ERROR when an unspecified error occurs.