Function rosidl_runtime_c_type_description_utils_find_field

Function Documentation

rcutils_ret_t rosidl_runtime_c_type_description_utils_find_field(const rosidl_runtime_c__type_description__Field__Sequence *fields, const char *name, rosidl_runtime_c__type_description__Field **field)

Get the first Field, matching by name.

The field output arg must be passed in pointing to NULL. It will remain pointing to NULL if no matching Field is found.

Ownership:

  • The output Field borrows the fields arg’s Field element. It is not authorized to deallocate it and cannot outlive the owner it borrows from.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • fields[in] array of fields to search through

  • name[in] field name of the field to look for

  • field[out] the first field with field name that matches the name arg. Must point to NULL, outputs pointing to NULL if not found.

Returns:

#RCUTILS_RET_OK if successful, or

Returns:

#RCUTILS_RET_INVALID_ARGUMENT for invalid arguments, or

Returns:

#RCUTILS_RET_NOT_FOUND if no Field with a matching name is found, or

Returns:

#RCUTILS_RET_ERROR if an unknown error occurs.