18#include "nros_cpp_ffi.h"
20#include "nros/log.hpp"
28#include "nros/duration.hpp"
29#include "nros/time.hpp"
30#include "nros/clock.hpp"
32#include "nros/options.hpp"
48#include "nros/polling_action_server.hpp"
49#include "nros/polling_action_client.hpp"
50#include "nros/polling_subscription.hpp"
51#include "nros/parameter.hpp"
52#include "nros/tick_ctx.hpp"
53#include "nros/lifecycle.hpp"
64 if (!Node::global_initialized())
return nullptr;
65 return Node::global_storage();
76 if (!Node::global_initialized()) {
105 if (executor ==
nullptr) {
108 nros_cpp_shutdown_callback_handle_t raw = NROS_CPP_SHUTDOWN_CALLBACK_HANDLE_INVALID;
109 nros_cpp_ret_t ret = nros_cpp_add_pre_shutdown_callback(executor, callback, context, &raw);
124 if (executor ==
nullptr) {
127 nros_cpp_shutdown_callback_handle_t raw = NROS_CPP_SHUTDOWN_CALLBACK_HANDLE_INVALID;
128 nros_cpp_ret_t ret = nros_cpp_add_on_shutdown_callback(executor, callback, context, &raw);
137 if (executor ==
nullptr)
return false;
138 return nros_cpp_remove_pre_shutdown_callback(executor, handle.
value()) == 0;
145 if (executor ==
nullptr)
return false;
146 return nros_cpp_remove_on_shutdown_callback(executor, handle.
value()) == 0;
158 if (!Node::global_initialized()) {
164 if (!last.
ok())
return last;
177inline Result spin(uint32_t duration_ms, int32_t poll_ms = 10) {
178 if (!Node::global_initialized()) {
186 return Result(nros_cpp_spin_for(Node::global_storage(), duration_ms, poll_ms));
nros::ActionClient<A> — typed action client.
nros::ActionServer<A> — typed action server.
Definition executor.hpp:78
Definition executor.hpp:71
static constexpr Result success()
Named constructors.
Definition result.hpp:112
bool ok() const
Returns true if the operation succeeded.
Definition result.hpp:100
nros_cpp_shutdown_callback_handle_t value() const
The raw FFI value, for passing to the C entry points directly.
Definition executor.hpp:57
nros::Client<S> — typed service client.
nros::Future<T> — single-shot deferred result.
int nros_cpp_ret_t
Definition future.hpp:21
nros_cpp_ret_t nros_cpp_spin_once(void *handle, int32_t timeout_ms)
Result spin()
Definition nros.hpp:157
bool remove_on_shutdown_callback(OnShutdownCallbackHandle handle)
Definition nros.hpp:143
Result spin_once(int32_t timeout_ms=10)
Definition nros.hpp:75
Result pre_shutdown(ShutdownCallback callback, void *context=nullptr, PreShutdownCallbackHandle *out=nullptr)
Definition nros.hpp:102
bool remove_pre_shutdown_callback(PreShutdownCallbackHandle handle)
Definition nros.hpp:135
bool ok()
Check if the nros session is initialized.
Definition node.hpp:997
void(*)(void *context) ShutdownCallback
Definition executor.hpp:34
void * global_handle()
Definition nros.hpp:63
Result on_shutdown(ShutdownCallback callback, void *context=nullptr, OnShutdownCallbackHandle *out=nullptr)
Definition nros.hpp:121
nros::Node and global session helpers.
nros::Publisher<M> — typed topic publisher.
nros::QoS — full DDS-shaped QoS settings (Phase 108.B.7).
nros::Result, nros::ErrorCode, and the NROS_TRY macro.
nros::Service<S> — typed service server.
NROS_CPP_STD opt-in conveniences — std::function, std::string, std::chrono overloads.
nros::Stream<T> — multi-shot message receiver.
nros::Subscription<M> — typed topic subscriber.