class documentation

class ProjectionRegistry:

View In Hierarchy

The ordered entries a Component renders its types through.

The first entry that matches wins, so an entry placed ahead of another shadows it, and the generic walk sits last because it matches everything. A registry is grown with extended and its entries are never edited, so one Machine's default can start several Components. Only element_structures, a memo, changes.

Method extended Return this registry with entries ahead of it, refusing an unannounced duplicate.
Method find Return the first entry answering for a ROS2 type.
Class Variable element_structures The structure each repeated element type renders as, by type and qualifier.
Class Variable entries Undocumented
def extended(self, entries: Iterable[Projection]) -> ProjectionRegistry:

Return this registry with entries ahead of it, refusing an unannounced duplicate.

Ahead, so a Component's entry is found before the Machine's, and the Machine's before the shipped one.

Raises
DuplicateProjectionErrorWhen an entry covers a type another already covers and does not say override=True.
def find(self, type_name: str) -> Projection:

Return the first entry answering for a ROS2 type.

Raises
DeclarationErrorWhen no entry does, which means the registry was assembled without the entry that matches last.
element_structures: dict[tuple[type[Message], str], type] =

The structure each repeated element type renders as, by type and qualifier.

A memo, on the registry because the shipped registry is shared by several Components: a global cache keyed on the type alone would hand one Component another's enumeration names.

entries: tuple[Projection, ...] =

Undocumented