10#ifndef NROS_CPP_STREAM_HPP
11#define NROS_CPP_STREAM_HPP
105 bool is_valid()
const {
return try_recv_fn_ !=
nullptr; }
109 other.storage_ =
nullptr;
110 other.try_recv_fn_ =
nullptr;
114 if (
this != &
other) {
115 storage_ =
other.storage_;
116 try_recv_fn_ =
other.try_recv_fn_;
117 other.storage_ =
nullptr;
118 other.try_recv_fn_ =
nullptr;
137 void bind(
void* storage, TryRecvFn
fn) {
143 TryRecvFn try_recv_fn_;
Definition action_client.hpp:67
static constexpr Result success()
Named constructors.
Definition result.hpp:74
Result wait_next(void *executor_handle, uint32_t timeout_ms, T &out, uint32_t poll_ms=10)
Definition stream.hpp:73
bool is_valid() const
Check if the stream is connected to a valid source.
Definition stream.hpp:105
Stream(Stream &&other) noexcept
Definition stream.hpp:108
Stream & operator=(Stream &&other) noexcept
Definition stream.hpp:113
Stream()
Default constructor – creates an unbound stream.
Definition stream.hpp:124
Result try_next(T &out)
Definition stream.hpp:52
Definition subscription.hpp:76
int nros_cpp_ret_t
Definition future.hpp:20
nros_cpp_ret_t nros_cpp_spin_once(void *handle, int32_t timeout_ms)
uint64_t nros_cpp_time_ns(void)
@ 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.
nros::Result, nros::ErrorCode, and the NROS_TRY macro.
int nros_cpp_ret_t
Definition stream.hpp:20
nros_cpp_ret_t nros_cpp_spin_once(void *handle, int32_t timeout_ms)
uint64_t nros_cpp_time_ns(void)