LockedModel
- class LockedModel[T]
Description
A SysML v2 model represented using abstract syntax.
Members defined in
LockedModel(13 members)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.
RPaths extracted from URIs of available documents in this model.
RThe model build result.
RURIs of available documents in this model.
An alias for
nodes.Find an owned member at path defined by
segmentsstarting with top-level elements inindex. This excludes imported and inherited members.Iterate over all nodes of the given kind.
Convert this model to
Environmentfor building other dependent models.Unlocks the model, freeing it up for others to lock.
Attributes
- 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 paths: Iterable[pathlib.Path]
Paths extracted from URIs of available documents in this model.
- property result: syside.ExecutionResult | None
The model build result.
- property uris: Iterable[syside.Url]
URIs of available documents in this model.
Methods
- elements(node_kind: type[syside.TElement], include_subtypes: bool = False) Iterable[syside.TElement]
An alias for
nodes.
- indexed_member(*segments: str) syside.Element
Find an owned member at path defined by
segmentsstarting with top-level elements inindex. This excludes imported and inherited members.Note that modifications to top-level elements will not be reflected here.
Raises
KeyErrorif any chain segment is not found.
- nodes(node_kind: type[syside.TElement], include_subtypes: bool = False) Iterable[syside.TElement]
Iterate over all nodes of the given kind.
- Parameters:
node_kind – What kind of nodes to return.
include_subtypes – Whether to consider subtypes.
- to_environment() syside.Environment
Convert this model to
Environmentfor building other dependent models.Using environment to build models requires that documents in it are not modified while build is in progress as no explicit dependency locking is performed otherwise.
Documents in the returned environment are guaranteed to be after documents in this model.
- unlock() T
Unlocks the model, freeing it up for others to lock.
- Raises:
RuntimeError – if used after unlocking