gflow-sink.vala 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /********************************************************************
  2. # Copyright 2014-2022 Daniel 'grindhold' Brendle, 2015 Daniel Espinosa <esodan@gmail.com>
  3. #
  4. # This file is part of libgtkflow.
  5. #
  6. # libgtkflow is free software: you can redistribute it and/or
  7. # modify it under the terms of the GNU Lesser General Public License
  8. # as published by the Free Software Foundation, either
  9. # version 3 of the License, or (at your option) any later
  10. # version.
  11. #
  12. # libgtkflow is distributed in the hope that it will be
  13. # useful, but WITHOUT ANY WARRANTY; without even the implied
  14. # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. # PURPOSE. See the GNU Lesser General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Lesser General Public
  18. # License along with libgtkflow.
  19. # If not, see http://www.gnu.org/licenses/.
  20. *********************************************************************/
  21. namespace GFlow {
  22. /**
  23. * A Sink is a special Type of Dock that receives data from
  24. * a source in order to let it either
  25. */
  26. public interface Sink : Object, Dock {
  27. /**
  28. * Returns the sinks that this source is connected to
  29. */
  30. public abstract List<Source> sources { get; }
  31. /**
  32. * Disconnects the Sink from all {@link Source}s that supply
  33. * it with data.
  34. */
  35. public virtual void unlink_all () throws GLib.Error
  36. {
  37. foreach (Source s in this.sources)
  38. if (s != null)
  39. this.unlink (s);
  40. }
  41. }
  42. }