14 instantiations of ImmutableSegmentedList
Microsoft.CodeAnalysis (14)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (6)
76public static readonly ImmutableSegmentedList<T> Empty = new(new SegmentedList<T>()); 148return new ImmutableSegmentedList<T>(list); 177return new ImmutableSegmentedList<T>(list); 209=> new ImmutableSegmentedList<TOutput>(_list.ConvertAll(converter)); 232=> new ImmutableSegmentedList<T>(_list.FindAll(match)); 300return new ImmutableSegmentedList<T>(self._list.GetRange(index, count));
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (4)
26return new ImmutableSegmentedList<T>(list); 35return new ImmutableSegmentedList<T>(list); 44return new ImmutableSegmentedList<T>(list); 49=> list is not null ? new ImmutableSegmentedList<T>(list) : default;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (4)
126=> new ImmutableSegmentedList<TOutput>(ReadOnlyList.ConvertAll(converter)); 144=> new ImmutableSegmentedList<T>(ReadOnlyList.FindAll(match)); 196return new ImmutableSegmentedList<T>(ReadOnlyList.GetRange(index, count)); 327_list = new ImmutableSegmentedList<T>(ReadOnlyList);
172 references to ImmutableSegmentedList
Microsoft.CodeAnalysis (151)
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (1)
1350internal static int BinarySearch<TElement, TValue>(this ImmutableSegmentedList<TElement> array, TValue value, Func<TElement, TValue, int> comparer)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (26)
33public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer) 38var oldValue = ImmutableSegmentedList<T>.PrivateMarshal.VolatileRead(in location); 41var newValue = transformer(oldValue); 48var interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue); 74public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 79var oldValue = ImmutableSegmentedList<T>.PrivateMarshal.VolatileRead(in location); 82var newValue = transformer(oldValue, transformerArgument); 89var interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue); 105public static ImmutableSegmentedList<T> InterlockedExchange<T>(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value) 107return ImmutableSegmentedList<T>.PrivateMarshal.InterlockedExchange(ref location, value); 119public static ImmutableSegmentedList<T> InterlockedCompareExchange<T>(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value, ImmutableSegmentedList<T> comparand) 121return ImmutableSegmentedList<T>.PrivateMarshal.InterlockedCompareExchange(ref location, value, comparand); 133public static bool InterlockedInitialize<T>(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value) 135return InterlockedCompareExchange(ref location, value, default(ImmutableSegmentedList<T>)).IsDefault;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList.cs (15)
16public static ImmutableSegmentedList<T> Create<T>() 17=> ImmutableSegmentedList<T>.Empty; 20public static ImmutableSegmentedList<T> Create<T>(T item) 21=> ImmutableSegmentedList<T>.Empty.Add(item); 24public static ImmutableSegmentedList<T> Create<T>(params T[] items) 25=> ImmutableSegmentedList<T>.Empty.AddRange(items); 28public static ImmutableSegmentedList<T>.Builder CreateBuilder<T>() 29=> ImmutableSegmentedList<T>.Empty.ToBuilder(); 32public static ImmutableSegmentedList<T> CreateRange<T>(IEnumerable<T> items) 33=> ImmutableSegmentedList<T>.Empty.AddRange(items); 36public static ImmutableSegmentedList<T> ToImmutableSegmentedList<T>(this IEnumerable<T> source) 38if (source is ImmutableSegmentedList<T> existingList) 41return ImmutableSegmentedList<T>.Empty.AddRange(source); 45public static ImmutableSegmentedList<T> ToImmutableSegmentedList<T>(this ImmutableSegmentedList<T>.Builder builder)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (61)
20/// <para>There are different scenarios best for <see cref="ImmutableSegmentedList{T}"/> and others 24/// <see cref="ImmutableSegmentedList{T}"/>:</para> 29/// <description><see cref="ImmutableSegmentedList{T}"/> Complexity</description> 73internal readonly partial struct ImmutableSegmentedList<T> : IImmutableList<T>, IReadOnlyList<T>, IList<T>, IList, IEquatable<ImmutableSegmentedList<T>> 76public static readonly ImmutableSegmentedList<T> Empty = new(new SegmentedList<T>()); 114public static bool operator ==(ImmutableSegmentedList<T> left, ImmutableSegmentedList<T> right) 117public static bool operator !=(ImmutableSegmentedList<T> left, ImmutableSegmentedList<T> right) 120public static bool operator ==(ImmutableSegmentedList<T>? left, ImmutableSegmentedList<T>? right) 123public static bool operator !=(ImmutableSegmentedList<T>? left, ImmutableSegmentedList<T>? right) 129var self = this; 141public ImmutableSegmentedList<T> Add(T value) 143var self = this; 161public ImmutableSegmentedList<T> AddRange(IEnumerable<T> items) 163var self = this; 171if (items is ImmutableSegmentedList<T> immutableList) 173else if (items is ImmutableSegmentedList<T>.Builder builder) 201public ImmutableSegmentedList<T> Clear() 208public ImmutableSegmentedList<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter) 231public ImmutableSegmentedList<T> FindAll(Predicate<T> match) 257var self = this; 272var self = this; 293public ImmutableSegmentedList<T> GetRange(int index, int count) 295var self = this; 310public ImmutableSegmentedList<T> Insert(int index, T item) 312var self = this; 325public ImmutableSegmentedList<T> InsertRange(int index, IEnumerable<T> items) 327var self = this; 341var self = this; 361public ImmutableSegmentedList<T> Remove(T value) 363var self = this; 373public ImmutableSegmentedList<T> Remove(T value, IEqualityComparer<T>? equalityComparer) 375var self = this; 385public ImmutableSegmentedList<T> RemoveAll(Predicate<T> match) 395public ImmutableSegmentedList<T> RemoveAt(int index) 404public ImmutableSegmentedList<T> RemoveRange(IEnumerable<T> items) 409var self = this; 428public ImmutableSegmentedList<T> RemoveRange(IEnumerable<T> items, IEqualityComparer<T>? equalityComparer) 433var self = this; 452public ImmutableSegmentedList<T> RemoveRange(int index, int count) 454var self = this; 468public ImmutableSegmentedList<T> Replace(T oldValue, T newValue) 470var self = this; 482public ImmutableSegmentedList<T> Replace(T oldValue, T newValue, IEqualityComparer<T>? equalityComparer) 484var self = this; 496public ImmutableSegmentedList<T> Reverse() 498var self = this; 508public ImmutableSegmentedList<T> Reverse(int index, int count) 516public ImmutableSegmentedList<T> SetItem(int index, T value) 525public ImmutableSegmentedList<T> Sort() 527var self = this; 539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer) 541var self = this; 553public ImmutableSegmentedList<T> Sort(Comparison<T> comparison) 560var self = this; 572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer) 592return obj is ImmutableSegmentedList<T> other 596public bool Equals(ImmutableSegmentedList<T> other)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (5)
23internal Builder(ImmutableSegmentedList<T> list) 80public ImmutableSegmentedList<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter) 103public ImmutableSegmentedList<T> FindAll(Predicate<T> match) 143public ImmutableSegmentedList<T> GetRange(int index, int count) 219public ImmutableSegmentedList<T> ToImmutable()
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (12)
20internal static ImmutableSegmentedList<T> VolatileRead(in ImmutableSegmentedList<T> location) 29internal static ImmutableSegmentedList<T> InterlockedExchange(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value) 38internal static ImmutableSegmentedList<T> InterlockedCompareExchange(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value, ImmutableSegmentedList<T> comparand) 48internal static ImmutableSegmentedList<T> AsImmutableSegmentedList(SegmentedList<T>? list) 51/// <inheritdoc cref="SegmentedCollectionsMarshal.AsSegmentedList{T}(ImmutableSegmentedList{T})"/> 52internal static SegmentedList<T>? AsSegmentedList(ImmutableSegmentedList<T> list)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (7)
21private ImmutableSegmentedList<T> _list; 29internal ValueBuilder(ImmutableSegmentedList<T> list) 76var originalList = RoslynImmutableInterlocked.InterlockedExchange(ref _list, default); 125public readonly ImmutableSegmentedList<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter) 143public readonly ImmutableSegmentedList<T> FindAll(Predicate<T> match) 191public ImmutableSegmentedList<T> GetRange(int index, int count) 325public ImmutableSegmentedList<T> ToImmutable()
src\Dependencies\Collections\Segmented\ImmutableSegmentedListExtensions.cs (8)
17public static bool All<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 33public static bool Any<T>(this ImmutableSegmentedList<T> immutableList) 41public static bool Any<T>(this ImmutableSegmentedList<T>.Builder builder) 49public static bool Any<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 65public static T Last<T>(this ImmutableSegmentedList<T> immutableList) 74public static T Last<T>(this ImmutableSegmentedList<T>.Builder builder) 86public static T Last<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 103public static IEnumerable<TResult> Select<T, TResult>(this ImmutableSegmentedList<T> immutableList, Func<T, TResult> selector)
src\Dependencies\Collections\Segmented\SegmentedCollectionsMarshal.cs (16)
98/// Gets an <see cref="ImmutableSegmentedList{T}"/> value wrapping the input <see cref="SegmentedList{T}"/>. 101/// <param name="list">The input segmented list to wrap in the returned <see cref="ImmutableSegmentedList{T}"/> value.</param> 102/// <returns>An <see cref="ImmutableSegmentedList{T}"/> value wrapping <paramref name="list"/>.</returns> 106/// list, and that it won't be modified once the returned <see cref="ImmutableSegmentedList{T}"/> value starts 108/// <see cref="ImmutableSegmentedList{T}"/> values to change after its creation. 111/// If <paramref name="list"/> is <see langword="null"/>, the returned <see cref="ImmutableSegmentedList{T}"/> value 112/// will be uninitialized (i.e. its <see cref="ImmutableSegmentedList{T}.IsDefault"/> property will be 116public static ImmutableSegmentedList<T> AsImmutableSegmentedList<T>(SegmentedList<T>? list) 117=> ImmutableSegmentedList<T>.PrivateMarshal.AsImmutableSegmentedList(list); 120/// Gets the underlying <see cref="SegmentedList{T}"/> for an input <see cref="ImmutableSegmentedList{T}"/> value. 122/// <typeparam name="T">The type of elements in the input <see cref="ImmutableSegmentedList{T}"/> value.</typeparam> 123/// <param name="list">The input <see cref="ImmutableSegmentedList{T}"/> value to get the underlying <see cref="SegmentedList{T}"/> from.</param> 129/// don't expect the contents of the <see cref="ImmutableSegmentedList{T}"/> value to change. 132/// If <paramref name="list"/> is uninitialized (i.e. its <see cref="ImmutableSegmentedList{T}.IsDefault"/> property is 136public static SegmentedList<T>? AsSegmentedList<T>(ImmutableSegmentedList<T> list) 137=> ImmutableSegmentedList<T>.PrivateMarshal.AsSegmentedList(list);
Microsoft.CodeAnalysis.UnitTests (21)
Collections\ImmutableListTestBase.cs (2)
546/// Asserts that the <see cref="ImmutableSegmentedList{T}"/> or <see cref="ImmutableSegmentedList{T}.Builder"/>'s
Collections\ImmutableSegmentedListBuilderTest.cs (2)
56var list = ImmutableSegmentedList<int>.Empty.Add(1); 118var collection = ImmutableSegmentedList<int>.Empty.Add(1);
Collections\ImmutableSegmentedListTest.cs (17)
43var actual = ImmutableSegmentedList<int>.Empty; 107var empty = ImmutableSegmentedList<GenericParameterHelper?>.Empty; 126var list = ImmutableSegmentedList<int>.Empty; 146var list = ImmutableSegmentedList<int>.Empty; 158var list = ImmutableSegmentedList<int>.Empty; 193var list = ImmutableSegmentedList<int>.Empty; 245var list = ImmutableSegmentedList<int>.Empty; 278var list = ImmutableSegmentedList<int>.Empty; 294var list = ImmutableSegmentedList<int>.Empty; 312var list = ImmutableSegmentedList<GenericParameterHelper?>.Empty; 396var list = ImmutableSegmentedList<int>.Empty; 415var list = ImmutableSegmentedList<int>.Empty; 422var list = ImmutableSegmentedList<int>.Empty; 450var list = ImmutableSegmentedList<string>.Empty; 473var list = ImmutableSegmentedList.CreateRange(Enumerable.Range(1, 3)); 525var list = ImmutableSegmentedList<int>.Empty.Add(3).Add(5).Add(8); 844var actual = list.RemoveAll(test);