ROS 2 rclcpp + rcl - jazzy  jazzy
ROS 2 C++ Client Library with ROS Client Library
Classes | Macros | Typedefs | Functions
node_options.h File Reference
#include "rcl/allocator.h"
#include "rcl/arguments.h"
#include "rcl/domain_id.h"
Include dependency graph for node_options.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rcl_node_options_s
 Structure which encapsulates the options for creating a rcl_node_t. More...
 

Macros

#define RCL_NODE_OPTIONS_DEFAULT_DOMAIN_ID   RCL_DEFAULT_DOMAIN_ID
 Constant which indicates that the default domain id should be used.
 

Typedefs

typedef struct rcl_node_options_s rcl_node_options_t
 Structure which encapsulates the options for creating a rcl_node_t.
 

Functions

RCL_PUBLIC rcl_node_options_t rcl_node_get_default_options (void)
 Return the default node options in a rcl_node_options_t. More...
 
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_node_options_copy (const rcl_node_options_t *options, rcl_node_options_t *options_out)
 Copy one options structure into another. More...
 
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_node_options_fini (rcl_node_options_t *options)
 Finalize the given node_options. More...
 

Function Documentation

◆ rcl_node_get_default_options()

RCL_PUBLIC rcl_node_options_t rcl_node_get_default_options ( void  )

Return the default node options in a rcl_node_options_t.

The default values are:

Returns
A structure with the default node options.

Definition at line 30 of file node_options.c.

References rcl_node_options_s::allocator, rcl_get_default_allocator, and rcl_get_zero_initialized_arguments().

Referenced by rclcpp::NodeOptions::get_rcl_node_options(), and rcl_node_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rcl_node_options_copy()

RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_node_options_copy ( const rcl_node_options_t options,
rcl_node_options_t options_out 
)

Copy one options structure into another.


Attribute Adherence
Allocates Memory Yes
Thread-Safe No
Uses Atomics No
Lock-Free Yes
Parameters
[in]optionsThe structure to be copied. Its allocator is used to copy memory into the new structure.
[out]options_outAn options structure containing default values.
Returns
RCL_RET_OK if the structure was copied successfully, or
RCL_RET_INVALID_ARGUMENT if any function arguments are invalid, or
RCL_RET_BAD_ALLOC if allocating memory failed, or
RCL_RET_ERROR if an unspecified error occurs.

Definition at line 44 of file node_options.c.

References rcl_node_options_s::allocator, rcl_node_options_s::arguments, rcl_node_options_s::enable_rosout, rcl_arguments_s::impl, rcl_arguments_copy(), RCL_RET_INVALID_ARGUMENT, RCL_RET_OK, rcl_node_options_s::rosout_qos, and rcl_node_options_s::use_global_arguments.

Referenced by rcl_node_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rcl_node_options_fini()

RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_node_options_fini ( rcl_node_options_t options)

Finalize the given node_options.

The given node_options must be non-NULL and valid, i.e. had rcl_node_get_default_options() called on it but not this function yet.


Attribute Adherence
Allocates Memory Yes
Thread-Safe No
Uses Atomics Yes
Lock-Free Yes
Parameters
[in,out]optionsobject to be finalized
Returns
RCL_RET_OK if setup is successful, or
RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
RCL_RET_ERROR if an unspecified error occurs.

Definition at line 71 of file node_options.c.

References rcl_node_options_s::allocator, rcl_node_options_s::arguments, rcl_arguments_s::impl, rcl_arguments_fini(), RCL_CHECK_ALLOCATOR, RCL_RET_INVALID_ARGUMENT, and RCL_RET_OK.

Referenced by rcl_node_init().

Here is the call graph for this function:
Here is the caller graph for this function: