"""
Legalese
--------
Copyright (c) 2015, 2016 Genome Research Ltd.

Author: Colin Nolan <cn13@sanger.ac.uk>

This file is part of HGI's common Python library

This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from abc import ABCMeta,abstractmethod
from typing import Generic, Sequence, TypeVar

DataSourceType = TypeVar("DataSourceType")


class DataSource(Generic[DataSourceType]):
    """
    A source of instances of `DataSourceType`.
    """
    __metaclass__ = ABCMeta

    @abstractmethod
    def get_all(self) -> Sequence[DataSourceType]:
        """
        Gets the data at the source.
        :return: instances of `DataSourceType`
        """
