Function rcl_yaml_node_struct_reallocate

Function Documentation

rcutils_ret_t rcl_yaml_node_struct_reallocate(rcl_params_t *params_st, size_t new_capacity, const rcutils_allocator_t allocator)

Reallocate parameter structure with a new capacity.

Parameters:
  • params_st[in] a parameter structure

  • new_capacity[in] a new capacity to param structure that must be greater than num_params

  • allocator[in] memory allocator to be used

Post:

the address of node_names in params_st might be changed even if the result value is RCL_RET_BAD_ALLOC.

Returns:

RCL_RET_OK if the structure was reallocated successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if params_st is NULL, or allocator is invalid, or new_capacity is less than num_nodes

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed.