ROS 2 rclcpp + rcl - humble
humble
ROS 2 C++ Client Library with ROS Client Library
|
#include "rmw/init.h"
#include "rcl/allocator.h"
#include "rcl/macros.h"
#include "rcl/types.h"
#include "rcl/visibility_control.h"
Go to the source code of this file.
Classes | |
struct | rcl_init_options_s |
Encapsulation of init options and implementation defined init options. More... | |
Typedefs | |
typedef struct rcl_init_options_impl_s | rcl_init_options_impl_t |
typedef struct rcl_init_options_s | rcl_init_options_t |
Encapsulation of init options and implementation defined init options. | |
Functions | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_init_options_t | rcl_get_zero_initialized_init_options (void) |
Return a zero initialized rcl_init_options_t struct. | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t | rcl_init_options_init (rcl_init_options_t *init_options, rcl_allocator_t allocator) |
Initialize given init_options with the default values and implementation specific values. More... | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t | rcl_init_options_copy (const rcl_init_options_t *src, rcl_init_options_t *dst) |
Copy the given source init_options to the destination init_options. More... | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t | rcl_init_options_fini (rcl_init_options_t *init_options) |
Finalize the given init_options. More... | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t | rcl_init_options_get_domain_id (const rcl_init_options_t *init_options, size_t *domain_id) |
Return the domain_id stored in the init options. More... | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t | rcl_init_options_set_domain_id (rcl_init_options_t *init_options, size_t domain_id) |
Set a domain id in the init options provided. More... | |
RCL_PUBLIC RCL_WARN_UNUSED rmw_init_options_t * | rcl_init_options_get_rmw_init_options (rcl_init_options_t *init_options) |
Return the rmw init options which are stored internally. More... | |
RCL_PUBLIC RCL_WARN_UNUSED const rcl_allocator_t * | rcl_init_options_get_allocator (const rcl_init_options_t *init_options) |
Return the allocator stored in the init_options. More... | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_init_options_copy | ( | const rcl_init_options_t * | src, |
rcl_init_options_t * | dst | ||
) |
Copy the given source init_options to the destination init_options.
The allocator from the source is used for any allocations and stored in the destination.
The destination should either be zero initialized with rcl_get_zero_initialized_init_options() or should have had rcl_init_options_fini() called on it. Giving an already initialized init options for the destination will result in a failure with return code RCL_RET_ALREADY_INIT.
Attribute | Adherence |
---|---|
Allocates Memory | Yes |
Thread-Safe | No |
Uses Atomics | Yes |
Lock-Free | Yes |
[in] | src | rcl_init_options_t object to be copied from |
[out] | dst | rcl_init_options_t object to be copied into |
Definition at line 82 of file init_options.c.
References rcl_init_options_s::impl, RCL_CHECK_ALLOCATOR, rcl_init_options_fini(), RCL_RET_ALREADY_INIT, RCL_RET_BAD_ALLOC, RCL_RET_ERROR, RCL_RET_INVALID_ARGUMENT, and RCL_RET_OK.
Referenced by rclcpp::InitOptions::InitOptions(), rclcpp::InitOptions::operator=(), and rcl_init().
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_init_options_fini | ( | rcl_init_options_t * | init_options | ) |
Finalize the given init_options.
The given init_options must be non-NULL
and valid, i.e. had rcl_init_options_init() called on it but not this function yet.
Attribute | Adherence |
---|---|
Allocates Memory | Yes |
Thread-Safe | No |
Uses Atomics | Yes |
Lock-Free | Yes |
[in,out] | init_options | object to be setup |
Definition at line 126 of file init_options.c.
References rcl_init_options_s::impl, RCL_CHECK_ALLOCATOR, RCL_RET_INVALID_ARGUMENT, and RCL_RET_OK.
Referenced by rcl_init_options_copy().
RCL_PUBLIC RCL_WARN_UNUSED const rcl_allocator_t* rcl_init_options_get_allocator | ( | const rcl_init_options_t * | init_options | ) |
Return the allocator stored in the init_options.
This function can fail and return NULL
if:
If NULL is returned an error message will have been set.
Attribute | Adherence |
---|---|
Allocates Memory | No |
Thread-Safe | Yes |
Uses Atomics | No |
Lock-Free | Yes |
[in] | init_options | object from which the allocator should be retrieved |
NULL
if there was an error Definition at line 169 of file init_options.c.
References rcl_init_options_s::impl.
Referenced by rclcpp::Context::init().
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_init_options_get_domain_id | ( | const rcl_init_options_t * | init_options, |
size_t * | domain_id | ||
) |
Return the domain_id stored in the init options.
Get the domain id from the specified rcl_init_options_t object.
Attribute | Adherence |
---|---|
Allocates Memory | No |
Thread-Safe | Yes |
Uses Atomics | No |
Lock-Free | Yes |
[in] | init_options | object from which the domain id should be retrieved. |
[out] | domain_id | domain id to be set in init_options object. |
Definition at line 142 of file init_options.c.
References rcl_init_options_s::impl, RCL_RET_INVALID_ARGUMENT, and RCL_RET_OK.
Referenced by rclcpp::InitOptions::get_domain_id().
RCL_PUBLIC RCL_WARN_UNUSED rmw_init_options_t* rcl_init_options_get_rmw_init_options | ( | rcl_init_options_t * | init_options | ) |
Return the rmw init options which are stored internally.
This function can fail and return NULL
if:
If NULL is returned an error message will have been set.
Attribute | Adherence |
---|---|
Allocates Memory | No |
Thread-Safe | No |
Uses Atomics | Yes |
Lock-Free | Yes |
[in] | init_options | object from which the rmw init options should be retrieved |
NULL
if there was an error Definition at line 161 of file init_options.c.
References rcl_init_options_s::impl.
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_init_options_init | ( | rcl_init_options_t * | init_options, |
rcl_allocator_t | allocator | ||
) |
Initialize given init_options with the default values and implementation specific values.
The given allocator is used, if required, during setup of the init options, but is also used during initialization.
In either case the given allocator is stored in the returned init options.
The impl
pointer should not be changed manually.
Attribute | Adherence |
---|---|
Allocates Memory | Yes |
Thread-Safe | No |
Uses Atomics | Yes |
Lock-Free | Yes |
[in,out] | init_options | object to be setup |
[in] | allocator | to be used during setup and during initialization |
Definition at line 54 of file init_options.c.
References rcl_init_options_s::impl, RCL_CHECK_ALLOCATOR, RCL_RET_ALREADY_INIT, RCL_RET_BAD_ALLOC, RCL_RET_ERROR, RCL_RET_INVALID_ARGUMENT, and RCL_RET_OK.
Referenced by rclcpp::InitOptions::InitOptions().
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_init_options_set_domain_id | ( | rcl_init_options_t * | init_options, |
size_t | domain_id | ||
) |
Set a domain id in the init options provided.
Store the domain id in the specified init_options object.
Attribute | Adherence |
---|---|
Allocates Memory | No |
Thread-Safe | Yes |
Uses Atomics | No |
Lock-Free | Yes |
[in] | init_options | objects in which to set the specified domain id. |
[in] | domain_id | domain id to be set in init_options object. |
Definition at line 152 of file init_options.c.
References rcl_init_options_s::impl, RCL_RET_INVALID_ARGUMENT, and RCL_RET_OK.
Referenced by rclcpp::InitOptions::set_domain_id().