Function rcl_remap_service_name

Function Documentation

rcl_ret_t rcl_remap_service_name(const rcl_arguments_t *local_arguments, const rcl_arguments_t *global_arguments, const char *service_name, const char *node_name, const char *node_namespace, rcl_allocator_t allocator, char **output_name)

Remap a service name based on given rules.

The supplied service name must have already been expanded to a fully qualified name.

The behavior of this function is identical to rcl_expand_topic_name() except that it applies to service names instead of topic names.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • local_arguments[in] Command line arguments to be used before global arguments, or if NULL or zero-initialized then only global arguments are used.

  • global_arguments[in] Command line arguments to use if no local rules matched, or NULL or zero-initialized to ignore global arguments.

  • service_name[in] A fully qualified and expanded service name to be remapped.

  • node_name[in] The name of the node to which name belongs.

  • node_namespace[in] The namespace of a node to which name belongs.

  • allocator[in] A valid allocator to use.

  • output_name[out] Either an allocated string with the remapped name, or NULL if no remap rules matched the name.

Returns:

RCL_RET_OK if the name was remapped or no rules matched, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed, or

Returns:

RCL_RET_SERVICE_NAME_INVALID if the given name is invalid, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.