NameIndex
- class NameIndex
Description
Elements by name, built once by
build_name_index().Given a
modelthat declarespart def Car;andpart car : Car;inpackage P:index = build_name_index(model) index.by_qualified_name["P::Car"] # P::Car index.by_simple_name["car"] # [P::car]
by_qualified_namemaps a qualified name to the first element in scan order that has it. Elements share a qualified name only when several documents declare a root package of the same name; the members of each keep their own qualified names and are all indexed. Alias memberships are left out, so an alias name is not a key;get_by_path()follows aliases.by_simple_namemaps a simple name to every element that has it, in scan order, memberships included.
Inheritance:
Members defined in
NameIndex(5 members)RWRWRWThe deprecated
library_elementsthe index was built with, elseNone.RWDerived from the scan and left out of equality. Every element rendering each qualified name, in scan order; empty for a deprecated
library_elementsbuild and for a hand-built index, whose lookups readby_qualified_name.by_qualified_namekeeps only the first, which a lookup that excludes library elements cannot use: the first claimant may be a library element shadowing a namesake that is not.RWThe tiers the index was built over;
Nonewhen it was built over the model’s own documents (the default build, a deprecatedlibrary_elementsbuild, or a hand-built index).Attributes
- by_qualified_name: dict[str, syside.Element] = None
- by_simple_name: dict[str, list[syside.Element]] = None
- library_elements: syside.query.LibraryElements | None = None
The deprecated
library_elementsthe index was built with, elseNone.
- qualified_name_claimants: dict[str, list[syside.Element]] = 'field(...)'
Derived from the scan and left out of equality. Every element rendering each qualified name, in scan order; empty for a deprecated
library_elementsbuild and for a hand-built index, whose lookups readby_qualified_name.by_qualified_namekeeps only the first, which a lookup that excludes library elements cannot use: the first claimant may be a library element shadowing a namesake that is not.
- tiers: frozenset[syside.DocumentTier] | None = None
The tiers the index was built over;
Nonewhen it was built over the model’s own documents (the default build, a deprecatedlibrary_elementsbuild, or a hand-built index).
Used by