Source code for qmmm_pme.records.record

#! /usr/bin/env python3
"""A module defining the :class:`Record` and :class:`Variable` classes.
"""
from __future__ import annotations

from typing import Any
from typing import Callable


[docs]class Variable: """A base class for wrapping a variable belonging to a :class:`Record`. """ def __init__(self) -> None: self._notifiers: list[Callable[[Any], None]] = []
[docs] def register_notifier(self, notifier: Callable[..., None]) -> None: """Add a notifier to the :class:`Variable`, which will be called whenever the :class:`Variable` is changed. :param notifier: The method which will be called when the :class:`Variable` is changed. """ self._notifiers.append(notifier)
[docs]class Record: """A base class for defining records. .. warning:: This class currently has no implementation. """ ...