|
nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
|
#include <rclcpp.hpp>
Public Types | |
| using | SharedPtr = Context |
Public Member Functions | |
| Result | add_on_shutdown_callback (ShutdownCallback callback, void *context, OnShutdownCallbackHandle *out=nullptr) |
| Result | add_pre_shutdown_callback (ShutdownCallback callback, void *context, PreShutdownCallbackHandle *out=nullptr) |
| The C-callback forms, on every target. See rclcpp::pre_shutdown. | |
| Context () | |
| Context (void *executor) | |
| void * | executor_handle () const |
| The executor handle this context names; null for an empty one. | |
| bool | is_valid () const |
| Context::is_valid() — named, and not yet shut down. | |
| Context * | operator-> () |
| const Context * | operator-> () const |
| bool | remove_on_shutdown_callback (const OnShutdownCallbackHandle &handle) |
| bool | remove_pre_shutdown_callback (const PreShutdownCallbackHandle &handle) |
| true when handle named a live callback. | |
rclcpp::Context (phase-488) — a VIEW of one executor's lifetime: its pre- and on-shutdown hooks (issue 0790) and whether it is still running.
Upstream's context owns the rcl init state and is reached through a shared_ptr. nano-ros's executor owns that state, so this names one by its handle: SharedPtr is the view itself and -> reaches it, so rclcpp::Context::SharedPtr c = node->get_node_base_interface()->get_context(); c->add_pre_shutdown_callback(cb) spells as upstream's does. The hooks share the executor's fixed table (NROS_EXECUTOR_MAX_SHUTDOWN_CBS, default 2): a full table returns an INVALID handle on the std surface, where upstream would allocate.
| using rclcpp::Context::SharedPtr = Context |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
The C-callback forms, on every target. See rclcpp::pre_shutdown.
|
inline |
The executor handle this context names; null for an empty one.
|
inline |
Context::is_valid() — named, and not yet shut down.
|
inline |
|
inline |
|
inline |
|
inline |
true when handle named a live callback.