10#ifndef NROS_RCLCPP_STREAM_HPP
11#define NROS_RCLCPP_STREAM_HPP
17#include "rclcpp/size_bound.hpp"
34template <
typename S>
class Client;
41template <
typename M>
class PollSubscription;
45template <
typename A>
class Client;
104 template <
size_t Cap>
138 bool is_valid()
const {
return take_fn_ !=
nullptr; }
142 other.storage_ =
nullptr;
143 other.take_fn_ =
nullptr;
147 if (
this != &
other) {
148 storage_ =
other.storage_;
149 take_fn_ =
other.take_fn_;
150 other.storage_ =
nullptr;
151 other.take_fn_ =
nullptr;
163 template <
typename M>
friend class ::rclcpp::PollSubscription;
164 template <
typename A>
friend class ::rclcpp_action::Client;
170 void bind(
void* storage, TakeFn
fn) {
Definition client.hpp:129
Definition result.hpp:216
static constexpr ResultOf success()
Named constructors.
Definition result.hpp:238
Stream()
Default constructor – creates an unbound stream.
Definition stream.hpp:157
Stream(Stream &&other) noexcept
Definition stream.hpp:141
Result wait_next_sized(void *executor_handle, uint32_t timeout_ms, T &out, uint32_t poll_ms=10)
Definition stream.hpp:105
bool is_valid() const
Check if the stream is connected to a valid source.
Definition stream.hpp:138
Stream & operator=(Stream &&other) noexcept
Definition stream.hpp:146
friend class ::rclcpp_action::Client
Definition stream.hpp:164
Result try_next(T &out)
Definition stream.hpp:72
Result try_next_sized(T &out)
Definition stream.hpp:76
Result wait_next(void *executor_handle, uint32_t timeout_ms, T &out, uint32_t poll_ms=10)
Definition stream.hpp:97
int nros_cpp_ret_t
Definition future.hpp:21
nros_cpp_ret_t nros_cpp_spin_once(void *handle, int32_t timeout_ms)
uint64_t nros_cpp_time_ns(void)
ResultOf< void > Result
Definition result.hpp:246
@ Error
Generic failure not covered by a more specific code.
@ Timeout
Operation deadline elapsed before completion.
@ TryAgain
Transient — no data ready yet (non-blocking take). Retry later.
rclcpp::Result, rclcpp::ErrorCode, and the RCLCPP_TRY macro.
int nros_cpp_ret_t
Definition stream.hpp:21
nros_cpp_ret_t nros_cpp_spin_once(void *handle, int32_t timeout_ms)
uint64_t nros_cpp_time_ns(void)