Skip to navigation

holoscan::ParamValue

Beta
View as MarkdownOpen in Claude

Own one supported fixed scalar parameter value.

ParamValue deliberately supports only Boolean, fixed-width signed/unsigned integer, enum underlying, IEC 60559 float/double, and integral-representation duration values in baseline. Durations are checked-converted to signed 64-bit canonical nanoseconds; a source overflow or non-integral nanosecond value produces an empty value that submission rejects. The carrier contains no heap storage, string, container, object address, or C++ type token. Enum identity is not retained beyond its underlying scalar kind and width.

#include <holoscan/parameter_update.hpp>

Constructors

ParamValue

holoscan::ParamValue::ParamValue() noexcept = default

Construct an empty value.

An empty value is not a valid patch payload and is rejected as a type mismatch.


Methods

as

template <typename T>
expected<T, Error> holoscan::ParamValue::as() const noexcept

Decode the value into an exactly compatible scalar family and width.

Enum decoding checks the underlying scalar family and width; this carrier does not retain or prove the original C++ enum type identity.

Returns: Decoded value, or ErrorCode::kIncompatible when kind or width differs.

Template parameters

T
typename

Supported target scalar or integral-representation duration type.

scalar

ParamScalarValue holoscan::ParamValue::scalar() const noexcept

Return the low-level stable scalar carrier.

Returns: Kind, bit width, and raw value bits owned by this value.

kind

ParamScalarKind holoscan::ParamValue::kind() const noexcept

Return the stable scalar family.

Returns: kNone for an empty value, otherwise the encoded scalar kind.

bit_width

std::uint8_t holoscan::ParamValue::bit_width() const noexcept

Return the semantic scalar width.

Returns: One for Boolean, 8/16/32/64 for integers, 32/64 for floating point, 64 for a canonical duration nanosecond count, or zero when empty.

raw_bits

std::uint64_t holoscan::ParamValue::raw_bits() const noexcept

Return the exact right-aligned scalar bits.

Returns: Owned raw bits interpreted only together with the kind and bit-width accessors.


Static methods

from

template <typename T>
static constexpr ParamValue holoscan::ParamValue::from(
T value
) noexcept

Own one supported scalar value.

A duration that cannot be represented as an exact signed 64-bit nanosecond count returns an empty value; a later submission rejects that empty payload as a type mismatch.

Returns: Allocation-free owning parameter value.

Template parameters

T
typename

Boolean, fixed-width signed/unsigned integer, enum with a supported underlying type, IEC 60559 float/double, or an integral-representation duration.

Parameters

value
T

Value copied into the fixed scalar carrier.


Member variables

NameTypeDescription
scalar_ParamScalarValue