pycyphal.application.register.backend package


Module contents


alias of Value_1_0

class pycyphal.application.register.backend.Backend[source]

Bases: MutableMapping[str, Entry]

Register backend interface implementing the MutableMapping interface. The registers are ordered lexicographically by name.

abstract property location: str[source]

The physical storage location for the data (e.g., file name).

abstract property persistent: bool[source]

An in-memory DB is reported as non-persistent.

abstract close() None[source]
abstract index(index: int) str | None[source]

Name of the register at the specified index or None if the index is out of range. See ordering requirements in the class docs.

abstract __setitem__(key: str, value: Entry | Value_1_0) None[source]

If the register does not exist, it is either created or nothing is done, depending on the implementation. If exists, it will be overwritten unconditionally with the specified value. Observe that the method accepts either Entry or Value.

The value shall be of the same type as the register, the caller is responsible to ensure that (implementations may lift this restriction if the type can be changed).

The mutability flag is ignored (it is intended mostly for the Cyphal Register Interface, not for local use).

__repr__() str[source]
class pycyphal.application.register.backend.Entry(value: 'Value', mutable: 'bool')[source]

Bases: object

value: Value_1_0
mutable: bool
__init__(value: Value_1_0, mutable: bool) None[source]
__match_args__ = ('value', 'mutable')
__setattr__(name, value)[source]
exception pycyphal.application.register.backend.BackendError[source]

Bases: RuntimeError

Unsuccessful storage transaction. This is a very low-level error representing a system configuration issue.