ROS 2 rclcpp + rcl - kilted  kilted
ROS 2 C++ Client Library with ROS Client Library
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
rclcpp::InitOptions Class Reference

Encapsulation of options for initializing rclcpp. More...

#include <rclcpp/init_options.hpp>

Public Member Functions

RCLCPP_PUBLIC InitOptions (rcl_allocator_t allocator=rcl_get_default_allocator())
 Constructor. More...
 
RCLCPP_PUBLIC InitOptions (const rcl_init_options_t &init_options)
 Constructor which is initialized by an existing init_options. More...
 
RCLCPP_PUBLIC InitOptions (const InitOptions &other)
 Copy constructor.
 
RCLCPP_PUBLIC bool auto_initialize_logging () const
 Return true if logging should be initialized when rclcpp::Context::init is called.
 
RCLCPP_PUBLIC InitOptionsauto_initialize_logging (bool initialize_logging)
 Set flag indicating if logging should be initialized or not.
 
RCLCPP_PUBLIC InitOptionsoperator= (const InitOptions &other)
 Assignment operator.
 
RCLCPP_PUBLIC const rcl_init_options_tget_rcl_init_options () const
 Return the rcl init options. More...
 
RCLCPP_PUBLIC void use_default_domain_id ()
 Retrieve default domain id and set.
 
RCLCPP_PUBLIC void set_domain_id (size_t domain_id)
 Set the domain id.
 
RCLCPP_PUBLIC size_t get_domain_id () const
 Return domain id.
 

Public Attributes

bool shutdown_on_signal = true
 If true, the context will be shutdown on SIGINT by the signal handler (if it was installed).
 

Protected Member Functions

void finalize_init_options ()
 

Detailed Description

Encapsulation of options for initializing rclcpp.

Definition at line 28 of file init_options.hpp.

Constructor & Destructor Documentation

◆ InitOptions() [1/2]

rclcpp::InitOptions::InitOptions ( rcl_allocator_t  allocator = rcl_get_default_allocator())
explicit

Constructor.

It allows you to specify the allocator used within the init options.

Parameters
[in]allocatorused allocate memory within the init options
Exceptions
anythingrclcpp::exceptions::throw_from_rcl_error can throw.

Definition at line 23 of file init_options.cpp.

References rcl_get_zero_initialized_init_options(), rcl_init_options_init(), and RCL_RET_OK.

Here is the call graph for this function:

◆ InitOptions() [2/2]

rclcpp::InitOptions::InitOptions ( const rcl_init_options_t init_options)
explicit

Constructor which is initialized by an existing init_options.

Initialized by an existing init_options.

Parameters
[in]init_optionsrcl_init_options_t to initialized
Exceptions
anythingrclcpp::exceptions::throw_from_rcl_error can throw.

Definition at line 33 of file init_options.cpp.

References rcl_get_zero_initialized_init_options(), rcl_init_options_copy(), and RCL_RET_OK.

Here is the call graph for this function:

Member Function Documentation

◆ get_rcl_init_options()

const rcl_init_options_t * rclcpp::InitOptions::get_rcl_init_options ( ) const

Return the rcl init options.

Returns
the rcl init options.
Exceptions
anythingrclcpp::exceptions::throw_from_rcl_error can throw.

Definition at line 107 of file init_options.cpp.

Referenced by rclcpp::Context::init(), and operator=().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: