Function simics::api::base::conf_object::require_object
source · pub fn require_object(obj: *mut ConfObject) -> Result<()>
Expand description
If obj has not yet been set as configured, then that object’s finalize method (post_init in DML) is run; otherwise, nothing happens. After completion of that method, obj will be set as configured.
Each object will have its finalize method called automatically, usually in
hierarchical order, during object creation. Since it is only permitted to call
methods on objects that have been configured, require_object
is a way to allow
such calls during finalisation by ensuring that those objects are correctly set up.
A better way to call methods on other objects during finalization is to defer such
calls to the objects_finalized method.
require_object
may only be called from the finalize method of another object.
Finalisation cycles can occur if two or more objects call require_object
on each
other. Such cycles are treated as errors. To avoid them, call
set_object_configured
as soon as the object has reached a consistent state.
§Arguments
obj
- The object to require finalization for
§Context
Global Context