rclcpp  master
C++ ROS Client Library API
Public Member Functions | List of all members
rclcpp::contexts::default_context::DefaultContext Class Reference

#include <default_context.hpp>

Inheritance diagram for rclcpp::contexts::default_context::DefaultContext:
Inheritance graph
[legend]
Collaboration diagram for rclcpp::contexts::default_context::DefaultContext:
Collaboration graph
[legend]

Public Member Functions

 DefaultContext ()
 
- Public Member Functions inherited from rclcpp::Context
 Context ()
 Default constructor, after which the Context is still not "initialized". More...
 
virtual ~Context ()
 
virtual void init (int argc, char const *const argv[], const rclcpp::InitOptions &init_options=rclcpp::InitOptions())
 Initialize the context, and the underlying elements like the rcl context. More...
 
bool is_valid () const
 Return true if the context is valid, otherwise false. More...
 
const rclcpp::InitOptionsget_init_options () const
 Return the init options used during init. More...
 
rclcpp::InitOptions get_init_options ()
 Return a copy of the init options used during init. More...
 
std::string shutdown_reason ()
 Return the shutdown reason, or empty string if not shutdown. More...
 
virtual bool shutdown (const std::string &reason)
 Shutdown the context, making it uninitialized and therefore invalid for derived entities. More...
 
virtual OnShutdownCallback on_shutdown (OnShutdownCallback callback)
 Add a on_shutdown callback to be called when shutdown is called for this context. More...
 
const std::vector< OnShutdownCallback > & get_on_shutdown_callbacks () const
 Return the shutdown callbacks as const. More...
 
std::vector< OnShutdownCallback > & get_on_shutdown_callbacks ()
 Return the shutdown callbacks. More...
 
std::shared_ptr< rcl_context_tget_rcl_context ()
 Return the internal rcl context. More...
 
bool sleep_for (const std::chrono::nanoseconds &nanoseconds)
 Sleep for a given period of time or until shutdown() is called. More...
 
virtual void interrupt_all_sleep_for ()
 Interrupt any blocking sleep_for calls, causing them to return immediately and return true. More...
 
rcl_guard_condition_tget_interrupt_guard_condition (rcl_wait_set_t *wait_set)
 Get a handle to the guard condition which is triggered when interrupted. More...
 
void release_interrupt_guard_condition (rcl_wait_set_t *wait_set)
 Release the previously allocated guard condition which is triggered when interrupted. More...
 
void release_interrupt_guard_condition (rcl_wait_set_t *wait_set, const std::nothrow_t &) noexcept
 Nothrow version of release_interrupt_guard_condition(), logs to RCLCPP_ERROR instead. More...
 
virtual void interrupt_all_wait_sets ()
 Interrupt any blocking executors, or wait sets associated with this context. More...
 
template<typename SubContext , typename ... Args>
std::shared_ptr< SubContext > get_sub_context (Args &&... args)
 Return a singleton instance for the SubContext type, constructing one if necessary. More...
 
- Public Member Functions inherited from std::enable_shared_from_this< Context >
enable_shared_from_this (T... args)
 
operator= (T... args)
 
shared_from_this (T... args)
 
~enable_shared_from_this (T... args)
 

Additional Inherited Members

- Public Types inherited from rclcpp::Context
using OnShutdownCallback = std::function< void()>
 
- Protected Member Functions inherited from rclcpp::Context
virtual void clean_up ()
 

Constructor & Destructor Documentation

◆ DefaultContext()

rclcpp::contexts::default_context::DefaultContext::DefaultContext ( )

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