UnlockedModel
- class UnlockedModel
Description
A SysML v2 and KerML model that needs to be locked before access.
Note that
UnlockedModelis generally not intended to be instantiated directly. Ideally, useload_model_unlockedorLockedModel.unlockon a previously acquiredLockedModel.model : UnlockedModel = load_model_unlocked("file.sysml") # Alternatively locked_model : LockedModel = load_model("file.sysml") ... model = locked_model.unlock()
Members defined in
UnlockedModel(9 members)RDocuments as part of this model including the environment.
RDiagnostics emitted while building this model.
RDocuments as part of this model.
RThe environment this model was built in.
RIndex of exported symbols.
RStandard library cache.
RThe model build result.
Locks the model, allowing access to the contained documents.
Convert this model to
Environmentfor building other dependent models.Attributes
- property all_documents: Generator[syside.SharedMutex[syside.Document], None, None]
Documents as part of this model including the environment.
Environment documents are guaranteed to be after documents in this model.
- property diagnostics: syside.Diagnostics
Diagnostics emitted while building this model.
- property documents: list[T]
Documents as part of this model.
- property environment: syside.Environment
The environment this model was built in.
- property index: syside.StaticIndex
Index of exported symbols.
- property lib: syside.Stdlib
Standard library cache.
- property result: syside.ExecutionResult | None
The model build result.
Methods
- lock(with_environment: bool = False) syside.Model
Locks the model, allowing access to the contained documents.
Order of documents is preserved. Call
unlockon the returned model once done, or use awithstatement:with unlocked_model.lock() as model: ...
- Parameters:
with_environment – If true, the returned model will additionally lock all documents from the environment. Environment documents are guaranteed to be after documents in this model.
- Returns:
A
Modelthat gives access to all model documents and elements.
- to_environment() syside.Environment
Convert this model to
Environmentfor building other dependent models.The returned environment contains the union of documents from this model and its environment, in this order.