rmw
master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
|
#include <stdint.h>
#include "rmw/init_options.h"
#include "rmw/macros.h"
#include "rmw/ret_types.h"
#include "rmw/visibility_control.h"
Go to the source code of this file.
Classes | |
struct | rmw_context_t |
Initialization context structure which is used to store init specific information. More... | |
Typedefs | |
typedef struct rmw_context_impl_t | rmw_context_impl_t |
Implementation defined context structure returned by rmw_init(). More... | |
typedef struct RMW_PUBLIC_TYPE rmw_context_t | rmw_context_t |
Initialization context structure which is used to store init specific information. More... | |
Functions | |
rmw_context_t | rmw_get_zero_initialized_context (void) |
Return a zero initialized context structure. More... | |
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. More... | |
rmw_ret_t | rmw_shutdown (rmw_context_t *context) |
Shutdown the middleware for a given context. More... | |
rmw_ret_t | rmw_context_fini (rmw_context_t *context) |
Finalize a context. More... | |
typedef struct rmw_context_impl_t rmw_context_impl_t |
Implementation defined context structure returned by rmw_init().
This should be defined by the rmw implementation.
typedef struct RMW_PUBLIC_TYPE rmw_context_t rmw_context_t |
Initialization context structure which is used to store init specific information.
rmw_context_t rmw_get_zero_initialized_context | ( | void | ) |
Return a zero initialized context structure.
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.
The given context must be zero initialized, and 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 |
This should be defined by the rmw implementation.
[in] | options | initialization options to be used during initialization |
[out] | context | resulting context struct |
RMW_RET_OK
if successful, or RMW_RET_INCORRECT_RMW_IMPLEMENTATION
if the implementation identifier does not match, or RMW_RET_INVALID_ARGUMENT
if any arguments are null or invalid, or RMW_RET_ERROR
if an unexpected error occurs. rmw_ret_t rmw_shutdown | ( | rmw_context_t * | context | ) |
Shutdown the middleware for a given context.
The given context must be a valid context which has been initialized with rmw_init().
Attribute | Adherence |
---|---|
Allocates Memory | Yes |
Thread-Safe | No |
Uses Atomics | No |
Lock-Free | Yes |
This should be defined by the rmw implementation.
[in] | context | resulting context struct |
RMW_RET_OK
if successful, or RMW_RET_INCORRECT_RMW_IMPLEMENTATION
if the implementation identifier does not match, or RMW_RET_INVALID_ARGUMENT
if the argument is null or invalid, or RMW_RET_ERROR
if an unexpected error occurs. rmw_ret_t rmw_context_fini | ( | rmw_context_t * | context | ) |
Finalize a context.
The context to be finalized must have been previously initialized with rmw_init()
, and then later invalidated with rmw_shutdown()
. If context is NULL
, then RMW_RET_INVALID_ARGUMENT
is returned. If context is zero-initialized, then RMW_RET_INVALID_ARGUMENT
is returned. If context is initialized and valid (rmw_shutdown()
was not called on it), then RMW_RET_INVALID_ARGUMENT
is returned.
Attribute | Adherence |
---|---|
Allocates Memory | Yes |
Thread-Safe | No |
Uses Atomics | Yes |
Lock-Free | Yes [1] |
[1] if atomic_is_lock_free()
returns true for atomic_uint_least64_t
RMW_RET_OK
if the shutdown was completed successfully, or RMW_RET_INVALID_ARGUMENT
if any arguments are invalid, or RMW_RET_ERROR
if an unspecified error occur.