10#ifndef NROS_RCLCPP_EXECUTOR_HPP
11#define NROS_RCLCPP_EXECUTOR_HPP
21#include "rclcpp/logging.hpp"
22#include "rclcpp/detail/nros_cpp_config_generated.h"
24#include "rclcpp/detail/nros_cpp_ffi.h"
131 return create(
out, locator, domain_id,
"nros_cpp");
153 const char* rmw =
nullptr;
158 out.initialized_ =
true;
179 out.initialized_ =
true;
492 bool ok()
const {
return initialized_; }
560 if (!initialized_)
return false;
568 if (!initialized_)
return false;
576 initialized_ =
false;
584 initialized_ =
false;
590 for (
unsigned i = 0;
i <
sizeof(storage_); ++
i) {
591 storage_[
i] =
other.storage_[
i];
594 other.initialized_ =
false;
598 if (
this != &
other) {
602 for (
unsigned i = 0;
i <
sizeof(storage_); ++
i) {
603 storage_[
i] =
other.storage_[
i];
606 initialized_ =
other.initialized_;
607 other.initialized_ =
false;
Definition client.hpp:129
Definition executor.hpp:116
Result get_service_names_and_types(nros_cpp_names_and_types_visit_fn visit, void *ctx)
Definition executor.hpp:311
Result create_node(::rclcpp::Node &out, const char *name, const char *ns=nullptr)
Definition node.hpp:3084
bool ok() const
Check if the executor is initialized.
Definition executor.hpp:492
Result spin_once()
Definition executor.hpp:255
static Result create(Executor &out, const char *locator=nullptr, uint8_t domain_id=0)
Definition executor.hpp:130
Executor(Executor &&other)
Definition executor.hpp:589
Result spin(int32_t poll_ms=10)
Definition executor.hpp:424
Executor & operator=(Executor &&other)
Definition executor.hpp:597
Result spin_for(uint32_t duration_ms, int32_t poll_ms=10)
Definition executor.hpp:482
bool remove_pre_shutdown_callback(PreShutdownCallbackHandle handle)
Definition executor.hpp:559
Result get_publisher_names_and_types_by_node(const char *node_name, const char *node_namespace, nros_cpp_names_and_types_visit_fn visit, void *ctx)
phase-381 W4 — what one named node PUBLISHES, with the types.
Definition executor.hpp:334
Result count_publishers(const char *topic_name, size_t *out_count)
Definition executor.hpp:321
NodeBuilder node_builder(const char *name)
Definition node.hpp:3186
Result get_topic_names_and_types(nros_cpp_names_and_types_visit_fn visit, void *ctx)
Definition executor.hpp:304
Result add_on_shutdown_callback(ShutdownCallback callback, void *context=nullptr, OnShutdownCallbackHandle *out=nullptr)
Definition executor.hpp:543
Result get_node_names(nros_cpp_node_visit_fn visit, void *ctx)
Definition executor.hpp:293
void * handle()
Definition executor.hpp:500
Result get_subscription_names_and_types_by_node(const char *node_name, const char *node_namespace, nros_cpp_names_and_types_visit_fn visit, void *ctx)
Definition executor.hpp:350
bool remove_on_shutdown_callback(OnShutdownCallbackHandle handle)
Definition executor.hpp:567
Executor()
Default constructor — creates an uninitialized executor.
Definition executor.hpp:119
Result get_subscriptions_info_by_topic(const char *topic_name, nros_cpp_endpoint_info_visit_fn visit, void *ctx)
phase-381 W4 — the subscriptions on topic_name, one visit each.
Definition executor.hpp:389
Result ping(int32_t timeout_ms)
Definition executor.hpp:271
Result cancel()
Definition executor.hpp:448
Result add_pre_shutdown_callback(ShutdownCallback callback, void *context=nullptr, PreShutdownCallbackHandle *out=nullptr)
Definition executor.hpp:525
Result get_publishers_info_by_topic(const char *topic_name, nros_cpp_endpoint_info_visit_fn visit, void *ctx)
Definition executor.hpp:381
Result shutdown()
Shut down the executor and close the middleware connection.
Definition executor.hpp:573
Result spin_once(int32_t timeout_ms)
Definition executor.hpp:228
Result count_subscribers(const char *topic_name, size_t *out_count)
Definition executor.hpp:328
bool is_spinning() const
Definition executor.hpp:470
Result get_client_names_and_types_by_node(const char *node_name, const char *node_namespace, nros_cpp_names_and_types_visit_fn visit, void *ctx)
phase-381 W4 — what services one named node CALLS, with the types.
Definition executor.hpp:368
~Executor()
Destructor — shuts down if still active.
Definition executor.hpp:581
static Result create_with_rmw(Executor &out, const char *rmw, const char *locator=nullptr, uint8_t domain_id=0, const char *session_name="nros_cpp")
Definition executor.hpp:171
static Result create(Executor &out, const char *locator, uint8_t domain_id, const char *session_name)
Definition executor.hpp:140
Result get_service_names_and_types_by_node(const char *node_name, const char *node_namespace, nros_cpp_names_and_types_visit_fn visit, void *ctx)
phase-381 W4 — what services one named node SERVES, with the types.
Definition executor.hpp:360
Definition executor.hpp:88
Definition executor.hpp:81
Definition result.hpp:216
static constexpr ResultOf success()
Named constructors.
Definition result.hpp:238
Definition executor.hpp:53
ShutdownCallbackHandle(nros_cpp_shutdown_callback_handle_t value)
Definition executor.hpp:61
bool valid() const
True when this handle came from a successful registration.
Definition executor.hpp:64
ShutdownCallbackHandle()
Definition executor.hpp:57
nros_cpp_shutdown_callback_handle_t value() const
The raw FFI value, for passing to the C entry points directly.
Definition executor.hpp:67
int nros_cpp_ret_t
Definition future.hpp:21
nros_cpp_ret_t nros_cpp_spin_once(void *handle, int32_t timeout_ms)
ResultOf< void > Result
Definition result.hpp:246
@ Unsupported
Operation not implemented by the active backend.
rclcpp::Result, rclcpp::ErrorCode, and the RCLCPP_TRY macro.