Function rmw_init

Function Documentation

rmw_ret_t rmw_init(const rmw_init_options_t *options, rmw_context_t *context)

Initialize the middleware with the given options, and yielding an context.

Context is filled with middleware specific data upon success of this function. The context is used when initializing some entities like nodes and guard conditions, and is also required to properly call rmw_shutdown().

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Remark

If options are zero-initialized, then RMW_RET_INVALID_ARGUMENT is returned. If options are initialized but no enclave is provided, then RMW_RET_INVALID_ARGUMENT is returned. If context has been already initialized (rmw_init() was called on it), then RMW_RET_INVALID_ARGUMENT is returned.

This should be defined by the rmw implementation.

Pre:

The given options must have been initialized i.e. rmw_init_options_init() called on it and an enclave set.

Pre:

The given context must be zero initialized.

Post:

If initialization fails, context will remain zero initialized.

Post:

context->actual_domain_id will be set with the domain id the rmw implementation is using. This matches options->domain_id if it is not RMW_DEFAULT_DOMAIN_ID. In other case, the value is rmw implementation dependent.

Parameters:
  • options[in] initialization options to be used during initialization

  • context[out] resulting context struct

Returns:

RMW_RET_OK if successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RMW_RET_INCORRECT_RMW_IMPLEMENTATION if the implementation identifier does not match, or

Returns:

RMW_RET_ERROR if an unexpected error occurs.