StaticIndex
- class StaticIndex
A static thread-safe index that allows multiple entries using the same name
Members defined in
StaticIndex(11 members)
RReturns
Trueif this index contains no indexed symbols.
Returns
Trueif this index is not empty.
The number of different symbols name in this index.
Clear this index.
Clone this index. Modifications to one or the other index does not affect the other.
Remove all symbols exported by
documentfrom this index. Returns the number of symbols erased.
Add all symbols exported by
documentfrom this index. Returns the number of symbols added.
Reserve memory for this index. This can reduce the number of allocations performed when adding new symbols to this index.
Visit all symbols with the provided name.
Visit all symbols with the provided name until visitor returns
False. Attributes
- property empty: bool
Returns
Trueif this index contains no indexed symbols.
Methods
- __bool__() bool
Returns
Trueif this index is not empty.
- __init__() None
- __len__() int
The number of different symbols name in this index.
- clear() None
Clear this index.
- clone() syside.StaticIndex
Clone this index. Modifications to one or the other index does not affect the other.
- erase(document: syside.Document) int
Remove all symbols exported by
documentfrom this index. Returns the number of symbols erased.NOTE: exported symbols must first be collected into the
document, and only symbols currently exported bydocumentwill be erased.
- insert(document: syside.Document) int
Add all symbols exported by
documentfrom this index. Returns the number of symbols added.NOTE: exported symbols must first be collected into the
document.
- reserve(arg: int, /) None
Reserve memory for this index. This can reduce the number of allocations performed when adding new symbols to this index.
- visit(arg0: str, arg1: Callable[[syside.IndexedSymbol], None], /) None
Visit all symbols with the provided name.
symbol: IndexedSymbol | None = None def visitor(value: IndexedSymbol) -> None: nonlocal symbol symbol = value ... index.visit("mySymbol", visitor)
- visit(arg0: Sequence[str], arg1: Callable[[str, syside.IndexedSymbol], None], /) None
Bulk visit all symbols with the provided names.
symbol: IndexedSymbol | None = None def visitor(value: IndexedSymbol) -> None: nonlocal symbol symbol = value ... index.visit(("mySymbol0", "mySymbol1"), visitor)
- visit_while(arg0: str, arg1: Callable[[syside.IndexedSymbol], bool], /) None
Visit all symbols with the provided name until visitor returns
False.symbol: IndexedSymbol | None = None def visitor(value: IndexedSymbol) -> bool: nonlocal symbol symbol = value ... return False index.visit_while("mySymbol", visitor)
- visit_while(arg0: Sequence[str], arg1: Callable[[str, syside.IndexedSymbol], bool], /) None
Bulk visit all symbols with the provided names until visitor returns
False.symbol: IndexedSymbol | None = None def visitor(value: IndexedSymbol) -> bool: nonlocal symbol symbol = value ... return False index.visit_while(("mySymbol0", "mySymbol1"), visitor)