Document

class Document

KerML and SysML specific document type

%3 Document Document syside.Document BasicDocument BasicDocument syside.BasicDocument BasicDocument->Document
Members defined in Document (7 members)

root_node

R

The root namespace of this document

all_nodes

Returns the iterator to all nodes in this document that are instances of kind, including all subtypes.

create_mt

Create a document for multi-threaded applications.

create_st

Create a document for single-threaded applications.

nodes

Returns the iterator to nodes in this documents that are exact instances of kind, excluding any subtypes.

parse_string_mt

Parse a document from string for multi-threaded applications without resolving references.

parse_string_st

Parse a document from string for single-threaded applications without resolving references.

Members inherited from BasicDocument (11 members)

build_state

RW

The current build state of this document.

document_state

R

The current state of this document inside a pipeline.

document_tier

R

The tier of this document.

language

R

Language identifier of this document

mutex

R

Retrieve the mutex associated with this document

text_document

RW

The source text document associated with this document.

url

RW

Location of this document.

version

R

The version of the last build.

__hash__

Identity based hash of this document.

change_document_tier

Set document_tier to another value.

increment_version

Increment sema version.

Attributes

property root_node: syside.Namespace

The root namespace of this document

Methods

all_nodes(kind: type[syside.TElement]) Iterable[syside.TElement]

Returns the iterator to all nodes in this document that are instances of kind, including all subtypes.

static create_mt() syside.SharedMutex[syside.Document]

Create a document for multi-threaded applications.

This allows the Executor to release GIL during execution allowing other Python threads to execute in the meantime but only if all the other documents were also created with create_mt.

static create_mt(arg: syside.DocumentOptions, /) syside.SharedMutex[syside.Document]
static create_mt(url: syside.Url, language: syside.ModelLanguage, tier: syside.DocumentTier = DocumentTier.Project, document_id: syside.DocumentID | None = None, owning_library: syside.LibraryID | None = None) syside.SharedMutex[syside.Document]
static create_st() syside.SharedMutex[syside.Document]

Create a document for single-threaded applications.

Note that this disables GIL optimization during Executor.run using this document.

static create_st(arg: syside.DocumentOptions, /) syside.SharedMutex[syside.Document]
static create_st(url: syside.Url, language: syside.ModelLanguage, tier: syside.DocumentTier = DocumentTier.Project, document_id: syside.DocumentID | None = None, owning_library: syside.LibraryID | None = None) syside.SharedMutex[syside.Document]
nodes(kind: type[syside.TElement]) Iterable[syside.TElement]

Returns the iterator to nodes in this documents that are exact instances of kind, excluding any subtypes.

static parse_string_mt(source: str, language: syside.ModelLanguage) tuple[syside.SharedMutex[syside.Document], list[syside.Diagnostic]]

Parse a document from string for multi-threaded applications without resolving references.

This allows the Executor to release GIL during execution allowing other Python threads to execute in the meantime but only if all the other documents were also created with create_mt.

static parse_string_st(source: str, language: syside.ModelLanguage) tuple[syside.SharedMutex[syside.Document], list[syside.Diagnostic]]

Parse a document from string for single-threaded applications without resolving references.

Note that this disables GIL optimization during Executor.run using this document.

Used in