# Copyright (c) 2018-2021, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
__all__ = ["AbstractBatchPositionGetter"]

from typing import Any, List, Optional
import weakref
import abc
from .graph_model import GraphModel

class AbstractBatchPositionGetter(abc.ABC):
    """Helper to get the nodes to move at the same time"""

    def __init__(self, model: GraphModel):
        self.model = model

    @property
    def model(self):
        return self.__model()

    @model.setter
    def model(self, value):
        self.__model = weakref.ref(value)

    @abc.abstractmethod
    def __call__(self, drive_item: Any) -> Optional[List[Any]]:
        pass
