akkudoktoreos.core.coreabc.get_resource_registry

akkudoktoreos.core.coreabc.get_resource_registry(init: bool = False) ResourceRegistry

Retrieve the singleton EOS Resource Registry instance.

This function provides access to the global EOS ResourceRegistry instance. The instance is created on first access if init is True. If the instance is accessed before initialization and init is False, a RuntimeError is raised.

Parameters:

init (bool) – If True, create the ResourceRegistry instance if it does not exist. Default is False.

Returns:

The global EOS Resource Registry instance.

Return type:

ResourceRegistry

Raises:

RuntimeError – If accessed before initialization with init=False.

Usage:
registry = get_resource_registry(init=True)  # Initialize and retrieve
registry.register_device(my_device)