using System.Collections.Generic; namespace Chernobyl.Collections.Generic { /// /// An type for types that are structured /// like the node in a linked list where the type holds an instance of it's /// own type. For example: /// /// public class Foobar : ILinkedEnumerable{Foobar} /// { /// public Foobar NextFoo { get; set; } /// /// public IEnumerator{T} GetLinkedEnumerator() /// { /// return new LinkedEnumerator{Foobar}(this, LinkedNextItem); /// } /// /// public IEnumerator{IResourceProcessor{TResource}} GetEnumerator() /// { /// return GetLinkedEnumerator(); /// } /// /// IEnumerator IEnumerable.GetEnumerator() /// { /// return GetEnumerator(); /// } /// /// static bool LinkedNextItem(T current, out T next) /// { /// next = current.NextFoo; /// return next != null; /// } /// } /// /// This type allows client code to use LINQ operations on linked instances. /// /// The type that contains an instance of it's /// own type (a class that acts as a node in a linked list). public interface ILinkedEnumerable : IEnumerable { /// /// Returns an enumerator that iterates through a linked set of instances. /// /// The that allows iteration over /// a set of linked instance. IEnumerator GetLinkedEnumerator(); } }