holoscan::config::EncodeContext
holoscan::config::EncodeContext
Carry package-owned monotonic state for one encode call tree.
Applications receive this non-copyable object only inside ConfigCodec callbacks. A context and its children borrow top-level call state and must not escape the callback. It is not thread-safe; one top-level encode owns one independent context tree.
Constructors
EncodeContext
Overload 2
Copy (deleted)
Disable copying because the context borrows one call’s budget state.
Assignment operators
operator=
Disable copy assignment because the context borrows one call’s budget state.
Methods
path
Return the owned RFC 6901 path for the value currently being encoded.
encode_child
Encode one nested value under an owned child path.
Returns: The owning encoded semantic child or its structured failure.
Template parameters
Nested owning type with a visible complete codec specialization.
Parameters
Unescaped object key or decimal array index for the child.
Borrowed typed child value.
Immutable policy shared by the top-level invocation.
charge_allocation
Charge an owning result allocation against this call tree before allocating it.
Returns: Success or CONFIG_LIMIT_EXCEEDED without changing the budget on failure.
Parameters
Number of bytes the codec is about to allocate.
charge_string
Validate one string and charge its owning result bytes before allocating it.
Returns: Success or CONFIG_LIMIT_EXCEEDED.
Parameters
UTF-8 bytes the codec is about to copy.
charge_container
Validate one container and charge its element storage before allocating it.
Returns: Success or CONFIG_LIMIT_EXCEEDED, including multiplication overflow.
Parameters
Number of immediate elements.
Owning storage bytes charged per element.