holoscan::config::Document
holoscan::config::Document
Own an immutable backend-neutral configuration document.
Copies share immutable state and are safe for concurrent reads. Every successful edit publishes a distinct Document; no operation mutates the baseline. Documents created by config_io may also retain original-source identity and an internal lossless scalar-span sidecar.
Constructors
Document
Methods
root
Return a shareable view of the root value.
at
Const (1)
Const (2)
Return the value at an owned path.
Returns: A shareable view.
Throws: ConfigException with CONFIG_PATH_NOT_FOUND or CONFIG_TYPE_MISMATCH on lookup failure.
Parameters
Root-relative RFC 6901 path.
try_at
Const (1)
Const (2)
Try to return the value at an owned path.
Returns: A shareable view or CONFIG_PATH_NOT_FOUND/CONFIG_TYPE_MISMATCH.
Parameters
Root-relative RFC 6901 path.
find
Const (1)
Const (2)
Find a value without treating absence as failure.
Returns: The optional shareable view; absence is not an error.
Throws: ConfigException on a traversal/type failure.
Parameters
Root-relative RFC 6901 path.
try_find
Const (1)
Const (2)
Try to find a value without treating absence as failure.
Returns: The optional shareable view, or a traversal/type failure.
Parameters
Root-relative RFC 6901 path.
get
Const (1)
Const (2)
Decode one addressed value through the explicit ConfigCodec specialization.
Returns: The decoded value.
Throws: ConfigException on a path or codec failure.
Template parameters
Owning destination type satisfying ConfigCodable.
Parameters
Root-relative path.
Immutable typed-decoding policy.
try_get
Const (1)
Const (2)
Try to decode one addressed value through the explicit ConfigCodec specialization.
Returns: The decoded value or a structured path/codec failure.
Template parameters
Owning destination type satisfying ConfigCodable.
Parameters
Root-relative path.
Immutable typed-decoding policy.
patch
Apply an object-valued configuration patch to a typed baseline transactionally.
The baseline is encoded, recursively merged with the addressed object, and decoded into one successor. Neither baseline nor this document is modified on success or failure.
Returns: The typed successor.
Throws: ConfigException on a path, type, or codec failure.
Template parameters
Owning type satisfying ConfigCodable.
Parameters
Path to an object-valued patch.
Baseline value copied into the transaction.
Immutable decoding policy for the successor.
try_patch
Try to apply an object-valued configuration patch to a typed baseline.
Returns: The typed successor or a structured path/type/codec failure.
Template parameters
Owning type satisfying ConfigCodable.
Parameters
Path to an object-valued patch.
Baseline value copied into the transaction.
Immutable decoding policy for the successor.
replace
Const (1)
Const (2)
Encode a typed value and transactionally replace an existing path.
Returns: A successor document.
Throws: ConfigException on a codec or edit failure.
Template parameters
Type satisfying ConfigCodable after cv/ref removal.
Parameters
Existing destination path.
Typed replacement value; the caller retains ownership.
try_replace
Const (1)
Const (2)
Try to encode a typed value and replace an existing path transactionally.
Returns: A successor document or a structured codec/edit failure.
Template parameters
Type satisfying ConfigCodable after cv/ref removal.
Parameters
Existing destination path.
Typed replacement value; the caller retains ownership.
patched
Const (with edits)
Const (with edit)
Apply a non-overlapping batch of immutable edits transactionally.
In lossless mode, only existing non-root scalar replacements that retain semantic kind and source style are admitted; every byte outside the replaced scalar tokens is preserved. A lossless document parsed from alias-bearing YAML rejects every edit; parse it with Preservation::kSemanticOnly when edits are required. Structural edits clear source-byte preservation authority in semantic-only documents.
Returns: A successor document.
Throws: ConfigException on failure, with this document unchanged.
Parameters
Complete transaction. Duplicate or ancestor/descendant paths conflict.
try_patched
Const (with edits)
Const (with edit)
Try to apply a non-overlapping batch of immutable edits transactionally.
Returns: A successor document, or a structured failure with this document unchanged.
Parameters
Complete transaction. Duplicate or ancestor/descendant paths conflict.
digest
Return immutable semantic identity and optional original-source provenance.
Static methods
from_value
Create a document and compute its semantic identity.
Returns: The immutable document.
Throws: ConfigException on allocation or semantic encoding failure.
Parameters
Root value to share with the document.
try_from_value
Try to create a document and compute its semantic identity.
Returns: The immutable document or a structured allocation/encoding failure.
Parameters
Root value to share with the document.