using System; using System.Collections; using System.Collections.Generic; using System.Linq; namespace UnityEngine.Rendering.HighDefinition { /// A collection of frame passes. To build one, public class AOVRequestDataCollection : IEnumerable, IDisposable { // Owned private List m_AOVRequestData; /// Build a new collection from requests. /// Requests to include in the collection. public AOVRequestDataCollection(List aovRequestData) // Transfer ownership of the list => m_AOVRequestData = aovRequestData; /// Enumerate the frame passes. /// The enumerator over the values. public IEnumerator GetEnumerator() => (m_AOVRequestData ?? Enumerable.Empty()).GetEnumerator(); /// Enumerate the frame passes. /// The enumerator over the values. IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); /// /// Dispose the collection. /// public void Dispose() { if (m_AOVRequestData == null) return; ListPool.Release(m_AOVRequestData); m_AOVRequestData = null; } } }