# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NvidiaProprietary # # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual # property and proprietary rights in and to this material, related # documentation and any modifications thereto. Any use, reproduction, # disclosure or distribution of this material and related documentation # without an express license agreement from NVIDIA CORPORATION or # its affiliates is strictly prohibited. """This package defines interfaces of observer pattern.""" from abc import abstractmethod, ABC class Subject(ABC): @abstractmethod def attach(self, observer): return NotImplemented @abstractmethod def detach(self, observer): return NotImplemented @abstractmethod def notify(self): return NotImplemented class Observer(ABC): @abstractmethod def update_data(self, subject) -> None: return NotImplemented