Skip to navigation

holoscan::essential::CallbackRegistration

Beta
View as MarkdownOpen in Claude

Own a native subscription’s disconnect-then-drain obligation.

#include <holoscan/essential/callback_readiness.hpp>

A supported backend prevents new entry at disconnect and waits for every entered callback at drain. Destruction releases its native owner only after both operations return. This move-only owner requires external synchronization for move, assignment and destruction; those operations may wait for backend drain and must not run on an entered callback itself.


Constructors

CallbackRegistration

holoscan::essential::CallbackRegistration::CallbackRegistration() noexcept = default

Destructor

~CallbackRegistration


Assignment operators

operator=

CallbackRegistration & holoscan::essential::CallbackRegistration::operator=(
) noexcept

Methods

reset

void holoscan::essential::CallbackRegistration::reset() noexcept

Static methods

own

template <typename T>
static CallbackRegistration holoscan::essential::CallbackRegistration::own(
std::shared_ptr<T> backend
)

Take ownership of a typed native backend implementing the reliable drain contract.

Returns: A move-only registration whose destructor disconnects and drains once.

Throws: RuntimeError with ErrorCode::kInvalidArgument if backend is empty.

Parameters

backend
std::shared_ptr<T>

Native subscription. An empty owner is rejected.


Member variables

NameTypeDescription
owner_std::shared_ptr< void >
disconnect_void(*
drain_void(*