holoscan::LifecycleContext
Provide cold, callback-lifetime lifecycle services.
This facade contains one hidden-state pointer. It exposes immutable phase-bound state and identity binding only; it cannot submit or await a restart, mutate graph topology, or invoke another lifecycle callback. References returned from it expire no later than the callback or lifecycle generation stated by the returned value’s own contract.
Constructors
LifecycleContext
Methods
cancellation
Return the callback-lifetime cooperative cancellation view.
Returns: Borrowed monotonic stop/fatal-shutdown latch. Restart acceptance alone does not set it.
params
Return the complete immutable parameter aggregate selected for this callback phase.
A wrong exact type terminates through the bounded Core contract handler.
Returns: Callback-lifetime reference. Repeated calls return the same address.
Template parameters
params_generation
Return the phase-selected complete parameter generation.
Returns: Generation zero for startup/NoParams or the exact old, candidate, or current value.
transition_phase
Return the transition phase that selected this callback’s state view.
Returns: One non-kNone phase inside a callback; kNone for an inert context.
report_error
Overload 1
Overload 2
Supply bounded explanatory detail for a failed advanced lifecycle callback.
The first report wins. The callback’s returned LifecycleStatus remains authoritative; successful callbacks discard this detail. Reporting never allocates or throws.
Parameters
Original error category.
Borrowed text copied before returning; do not include secrets.
resolve_clock
Resolve a declared clock for this lifecycle generation.
Resolution is cold-only and installs no compute-time lookup.
Returns: Generation-scoped reference or a typed binding/capability error.
Parameters
Owned cold clock identity; the omitted key requests the admitted default.
notification_sender
Return the current generation’s bounded notification capability.
Returns: Generation-bound sender or a typed ownership/stage/binding error.
Parameters
Declared notification source owned by the callback’s Operator.
restart_target
Const (with plan ref)
Const (with path)
Bind an already-authorized plan target to the current run generation.
This operation resolves identity only; it neither submits nor waits for lifecycle work.
Returns: Fixed-size run-bound target or a stale/foreign/unauthorized error.
Parameters
Plan-bound target whose run generation is zero.
bind_nominal_rate
Bind this output’s lifecycle-selected nominal rate for the current candidate.
Any declaration or value validation failure during a forward binding phase permanently rejects the private candidate. A later forward-phase call in that candidate returns the original failure; retrying with a fallback value cannot repair it. Return a lifecycle failure status instead.
Returns: Success, including an identical normalized repeat, or a typed ownership, stage, deadline, conflict, maximum, or capacity error.
Template parameters
Exact published payload type.
Parameters
Exact positive rational nominal average selected for this candidate.
rate
Single item
Const
Return the phase-visible rate view for one owned input.
Call only during the active lifecycle callback and do not retain the context after callback return. The returned PortRateView is a value and may be retained. The query is O(1) and allocation-free.
Returns: Candidate rate view during startup/restart forward or forward rollback; otherwise the current published view, or a typed error without state change.
Template parameters
Exact published payload type.
Parameters