ConcurrentCollector<T> Class
              
              
              Namespace: Stride.Core.Threading
              Assembly: Stride.Core.dll
              
              
              A collector that allows for concurrent adding of items, as well as non-thread-safe clearing and accessing of the underlying colletion.
 
              
              
              
                 System.Object →  
                ConcurrentCollector<T>
              
              
                 Derived from ConcurrentCollector<T>: 
              
              
              
              
              
                public class ConcurrentCollector<T> : IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
               
              
              Type Parameters
              
                
                  
                    | Name | 
                    Description | 
                  
                
                
                  
                    | T | 
                    The element type in the collection. 
 | 
                  
                
              
              
              
              
              
                  
              
                     
              
                
                  |
                  Improve this Doc
                
                
                  View Source
                
              
              
                Constructors
              
                
              
              
              
              
              
              ConcurrentCollector(Int32)
              
              
              
              
              
                public ConcurrentCollector(int capacity = 16)
               
              
              Parameters
              
                
                  
                    | Type | 
                    Name | 
                    Description | 
                  
                
                
                  
                    | System.Int32 | 
                    capacity | 
                     | 
                  
                
              
                     
              
                
                  |
                  Improve this Doc
                
                
                  View Source
                
              
              
                Properties
              
                
              
              
              
              
              
              Count
              
              
              
              
              
                public int Count { get; }
               
              
              Property Value
              
                
                  
                    | Type | 
                    Description | 
                  
                
                
                  
                    | System.Int32 | 
                     | 
                  
                
              
              
              
              
              
              
              Item[Int32]
              
              
              
              
              
                public T this[int index] { get; set; }
               
              
              Parameters
              
                
                  
                    | Type | 
                    Name | 
                    Description | 
                  
                
                
                  
                    | System.Int32 | 
                    index | 
                     | 
                  
                
              
              Property Value
              
              
              
              
              
              
              Items
              
              
              
              
              
                public T[] Items { get; }
               
              
              Property Value
              
                     
              
                
                  |
                  Improve this Doc
                
                
                  View Source
                
              
              
                Methods
              
                
              
              
              
              
              
              Add(T)
              
              
              
              
              
              
              Parameters
              
                
                  
                    | Type | 
                    Name | 
                    Description | 
                  
                
                
                  
                    | T | 
                    item | 
                     | 
                  
                
              
              Returns
              
                
                  
                    | Type | 
                    Description | 
                  
                
                
                  
                    | System.Int32 | 
                     | 
                  
                
              
              
              
              
              
              
              AddRange(IReadOnlyList<T>)
              
              
              
              
              
                public void AddRange(IReadOnlyList<T> collection)
               
              
              Parameters
              
                
                  
                    | Type | 
                    Name | 
                    Description | 
                  
                
                
                  
                    | System.Collections.Generic.IReadOnlyList<T> | 
                    collection | 
                     | 
                  
                
              
              
              
              
              
              
              Clear(Boolean)
              
              
              
              
              
                public void Clear(bool fastClear)
               
              
              Parameters
              
                
                  
                    | Type | 
                    Name | 
                    Description | 
                  
                
                
                  
                    | System.Boolean | 
                    fastClear | 
                     | 
                  
                
              
              
              
              
              
              
              Close()
              
              Consolidates all added items into a single consecutive array. It is an error to access Items after adding elements, but before closing.
 
              
              
              
              
              
              
              
              
              
              GetEnumerator()
              
              
              
              
              
                public ConcurrentCollector<T>.Enumerator GetEnumerator()
               
              
              Returns
              
                     
              
                
                  |
                  Improve this Doc
                
                
                  View Source
                
              
              
                Explicit Interface Implementations
              
                
              
              
              
              
              
              IEnumerable<T>.GetEnumerator()
              
              
              
              
              
                IEnumerator<T> IEnumerable<T>.GetEnumerator()
               
              
              Returns
              
                
                  
                    | Type | 
                    Description | 
                  
                
                
                  
                    | System.Collections.Generic.IEnumerator<T> | 
                     | 
                  
                
              
              
              
              
              
              
              IEnumerable.GetEnumerator()
              
              
              
              
              
                IEnumerator IEnumerable.GetEnumerator()
               
              
              Returns
              
                
                  
                    | Type | 
                    Description | 
                  
                
                
                  
                    | System.Collections.IEnumerator | 
                     | 
                  
                
              
              
              
 
              
               
              
              
              
              
              Extension Methods