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

#include <default_context.hpp>

Inheritance diagram for rclcpp::contexts::DefaultContext:
Inheritance graph
[legend]
Collaboration diagram for rclcpp::contexts::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...
 
size_t get_domain_id () const
 Return actual domain id. More...
 
std::string shutdown_reason () const
 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...
 
virtual OnShutdownCallbackHandle add_on_shutdown_callback (OnShutdownCallback callback)
 Add a on_shutdown callback to be called when shutdown is called for this context. More...
 
virtual bool remove_on_shutdown_callback (const OnShutdownCallbackHandle &callback_handle)
 Remove an registered on_shutdown callbacks. More...
 
std::vector< OnShutdownCallbackget_on_shutdown_callbacks () const
 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...
 
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 = OnShutdownCallbackHandle::OnShutdownCallbackType
 
- Protected Member Functions inherited from rclcpp::Context
virtual void clean_up ()
 

Constructor & Destructor Documentation

◆ DefaultContext()

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

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