holoscan::config::ConfigView
holoscan::config::ConfigView
Borrow an immutable semantic value for inspection and codec traversal.
A view shares ownership of its immutable node; values returned from a Document or ConfigValue remain usable after the originating object is destroyed. A default-constructed view is invalid. Concurrent reads of valid views are safe.
Constructors
ConfigView
Default
Overload 2
Create an invalid sentinel view.
Methods
valid
Return whether this view addresses a semantic value.
kind
Return the semantic alternative, or kNull for an invalid view.
size
Return the immediate child count for an array or object.
Returns: Zero for a scalar or invalid view.
as_bool
Return the Boolean value.
Returns: The stored Boolean.
Throws: ConfigException with CONFIG_TYPE_MISMATCH when this is not Boolean.
try_as_bool
Try to return the Boolean value.
Returns: The stored Boolean or CONFIG_TYPE_MISMATCH.
as_signed_integer
Return the signed 64-bit integer value.
Returns: The stored integer.
Throws: ConfigException with CONFIG_TYPE_MISMATCH when the kind differs.
try_as_signed_integer
Try to return the signed 64-bit integer value.
Returns: The stored integer or CONFIG_TYPE_MISMATCH.
as_unsigned_integer
Return the unsigned 64-bit integer value.
Returns: The stored integer.
Throws: ConfigException with CONFIG_TYPE_MISMATCH when the kind differs.
try_as_unsigned_integer
Try to return the unsigned 64-bit integer value.
Returns: The stored integer or CONFIG_TYPE_MISMATCH.
as_floating
Return the finite binary64 value.
Returns: The stored number.
Throws: ConfigException with CONFIG_TYPE_MISMATCH when the kind differs.
try_as_floating
Try to return the finite binary64 value.
Returns: The stored number or CONFIG_TYPE_MISMATCH.
as_string
Borrow the UTF-8 string bytes.
Do not retain the returned view from a temporary unless another object owns the node.
Returns: A view valid while this ConfigView remains alive.
Throws: ConfigException with CONFIG_TYPE_MISMATCH when the kind differs.
try_as_string
Try to borrow the UTF-8 string bytes.
Do not retain the returned view from a temporary unless another object owns the node.
Returns: A borrowed view or CONFIG_TYPE_MISMATCH.
element
Return one array element or object value by insertion index.
Returns: A shareable child view.
Throws: ConfigException with CONFIG_PATH_NOT_FOUND or CONFIG_TYPE_MISMATCH.
Parameters
Zero-based child index.
try_element
Try to return one child by insertion index.
Returns: A shareable child view or a structured kind/index failure.
Parameters
Zero-based child index.
key
Borrow one object key by insertion index.
Do not retain the returned view from a temporary unless another object owns the node.
Returns: UTF-8 key bytes valid while this view remains alive.
Throws: ConfigException on an invalid kind or index.
Parameters
Zero-based object entry index.
try_key
Try to borrow one object key by insertion index.
Do not retain the returned view from a temporary unless another object owns the node.
Returns: A borrowed key or a structured kind/index failure.
Parameters
Zero-based object entry index.
member
Return a required object member.
Returns: A shareable child view.
Throws: ConfigException with CONFIG_PATH_NOT_FOUND or CONFIG_TYPE_MISMATCH.
Parameters
Exact UTF-8 key bytes.
try_member
Try to return a required object member.
Returns: A shareable child view or a structured kind/missing-member failure.
Parameters
Exact UTF-8 key bytes.
find_member
Find an object member without treating absence as failure.
Returns: An optional child view; absence is not an error.
Throws: ConfigException with CONFIG_TYPE_MISMATCH for a non-object or invalid view.
Parameters
Exact UTF-8 key bytes.
try_find_member
Try to find an object member without treating absence as failure.
Returns: An optional child view or CONFIG_TYPE_MISMATCH.
Parameters
Exact UTF-8 key bytes.
to_value
Convert this view into a value sharing the same immutable node.
Returns: The shareable owning value. An invalid view produces a null value.