maxon.Registry

Description

Registries are used to register specific implementations of a given interface.
An implementation that is registered in such a registry can then be accessed with a specific ID from anywhere in the application.

Methods Signature

Get(eid)

Retrieves the object stored with the given maxon.Id within the current registry.

GetEntries()

Retrieve a RegistryIterator that can be iterate with a for loop.

GetId()

Return the identifier of this registry.

Insert(eid, object)

Inserts a new entry into the current registry.

__getitem__(item)

Retrieves an entry in the registry.

__iter__()

Iterates over all elements available in the registry.

__len__()

Returns the number of entries in the registry.

Methods Definition

classmethod Registry.Get(eid)

Retrieves the object stored with the given maxon.Id within the current registry.

Parameters

eid (maxon.Id) – The object identifier to access into the registry.

Returns

The object stored in the current registry matching the maxon.Id.

Return type

Any

Raises

LookupError – If value not inside the registry.

classmethod Registry.GetEntries()

Retrieve a RegistryIterator that can be iterate with a for loop.

Returns

an iterator.

classmethod Registry.GetId()

Return the identifier of this registry.

Returns

The identifier of this registry.

Return type

maxon.Id

classmethod Registry.Insert(eid, object)

Inserts a new entry into the current registry.

Parameters
  • eid (maxon.Id) – The identifier of the object.

  • object (Any) – The object to store into the registry.

Returns

Registry.__getitem__(item)

Retrieves an entry in the registry.

Parameters

item (maxon.InternedId) – The identifier of the registry entry you want to retrieve.

Registry.__iter__()

Iterates over all elements available in the registry.

Registry.__len__()

Returns the number of entries in the registry.

Returns

Number of entries in the registry.

Return type

int