Skip to navigation

holoscan::ForeignOperatorResult

Beta
View as MarkdownOpen in Claude

Return one allocation-free result across a foreign Operator callback boundary.

The callback retains ownership of message. For a failure result, its storage must remain valid until the invoking ForeignOperatorCore method returns. Core copies at most kForeignOperatorMessageCapacity bytes after the callback returns and never reads the pointer for a successful result. message_size must not exceed the readable storage beginning at message; the capacity clamp is not pointer validation.

#include <holoscan/foreign_operator.hpp>

Static methods

success

static constexpr ForeignOperatorResult holoscan::ForeignOperatorResult::success() noexcept

Construct a successful callback result.

Returns: The allocation-free success record.

failure

static constexpr ForeignOperatorResult holoscan::ForeignOperatorResult::failure(
ErrorCode error_code,
const char *detail,
std::size_t detail_size
) noexcept

Construct one borrowed failure record.

Returns: Failure record whose message is clamped when Core consumes it.

Parameters

error_code
ErrorCode

Non-success Core error category.

detail
const char *

Callback-owned bytes valid until the invoking ForeignOperatorCore method returns.

detail_size
std::size_t

Number of readable bytes beginning at detail.


Member variables

NameTypeDescription
codeErrorCodeCallback outcome.
messageconst char *Optional callback-owned message bytes.
message_sizestd::size_tAvailable bytes beginning at message.