pycyphal.application.register.backend package


Module contents


alias of uavcan.register.Value_1_0.Value_1_0

class pycyphal.application.register.backend.Backend(*args, **kwds)[source]

Bases: MutableMapping[str, pycyphal.application.register.backend.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) Optional[str][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: Union[pycyphal.application.register.backend.Entry, uavcan.register.Value_1_0.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: uavcan.register.Value_1_0.Value_1_0
mutable: bool
__init__(value: uavcan.register.Value_1_0.Value_1_0, mutable: bool) None[source]
__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.