-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the public API for concurrent collections
These collections are based on types already present in System.Collections.Concurrent, and the APIs are intended to support seamless transition between the two in applications.
- Loading branch information
Showing
13 changed files
with
615 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
TunnelVisionLabs.Collections.Trees.Experimental/Concurrent/ConcurrentTreeBag`1+Enumerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace TunnelVisionLabs.Collections.Trees.Concurrent | ||
{ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
public partial class ConcurrentTreeBag<T> | ||
{ | ||
public struct Enumerator : IEnumerator<T> | ||
{ | ||
public T Current => throw null; | ||
|
||
object IEnumerator.Current => throw null; | ||
|
||
public void Dispose() => throw null; | ||
|
||
public bool MoveNext() => throw null; | ||
|
||
public void Reset() => throw null; | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
TunnelVisionLabs.Collections.Trees.Experimental/Concurrent/ConcurrentTreeBag`1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace TunnelVisionLabs.Collections.Trees.Concurrent | ||
{ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Concurrent; | ||
using System.Collections.Generic; | ||
|
||
public partial class ConcurrentTreeBag<T> : IProducerConsumerCollection<T>, IReadOnlyCollection<T> | ||
{ | ||
public ConcurrentTreeBag() => throw null; | ||
|
||
public ConcurrentTreeBag(IEnumerable<T> collection) => throw null; | ||
|
||
public int Count => throw null; | ||
|
||
public bool IsEmpty => throw null; | ||
|
||
bool ICollection.IsSynchronized => throw null; | ||
|
||
object ICollection.SyncRoot => throw null; | ||
|
||
public void Add(T item) => throw null; | ||
|
||
public void Clear() => throw null; | ||
|
||
public void CopyTo(T[] array, int index) => throw null; | ||
|
||
public Enumerator GetEnumerator() => throw null; | ||
|
||
IEnumerator<T> IEnumerable<T>.GetEnumerator() => throw null; | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => throw null; | ||
|
||
public T[] ToArray() => throw null; | ||
|
||
public bool TryPeek(out T result) => throw null; | ||
|
||
public bool TryTake(out T result) => throw null; | ||
|
||
void ICollection.CopyTo(Array array, int index) => throw null; | ||
|
||
bool IProducerConsumerCollection<T>.TryAdd(T item) => throw null; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...onLabs.Collections.Trees.Experimental/Concurrent/ConcurrentTreeDictionary`2+Enumerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace TunnelVisionLabs.Collections.Trees.Concurrent | ||
{ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
public partial class ConcurrentTreeDictionary<TKey, TValue> | ||
{ | ||
public struct Enumerator : IEnumerator<KeyValuePair<TKey, TValue>> | ||
{ | ||
public KeyValuePair<TKey, TValue> Current => throw null; | ||
|
||
object IEnumerator.Current => throw null; | ||
|
||
public void Dispose() => throw null; | ||
|
||
public bool MoveNext() => throw null; | ||
|
||
public void Reset() => throw null; | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...ions.Trees.Experimental/Concurrent/ConcurrentTreeDictionary`2+KeyCollection+Enumerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace TunnelVisionLabs.Collections.Trees.Concurrent | ||
{ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
public partial class ConcurrentTreeDictionary<TKey, TValue> | ||
{ | ||
public partial struct KeyCollection | ||
{ | ||
public struct Enumerator : IEnumerator<TKey> | ||
{ | ||
public TKey Current => throw null; | ||
|
||
object IEnumerator.Current => throw null; | ||
|
||
public void Dispose() => throw null; | ||
|
||
public bool MoveNext() => throw null; | ||
|
||
public void Reset() => throw null; | ||
} | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...abs.Collections.Trees.Experimental/Concurrent/ConcurrentTreeDictionary`2+KeyCollection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace TunnelVisionLabs.Collections.Trees.Concurrent | ||
{ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
public partial class ConcurrentTreeDictionary<TKey, TValue> | ||
{ | ||
public partial struct KeyCollection : IReadOnlyCollection<TKey>, ICollection<TKey> | ||
{ | ||
public int Count => throw null; | ||
|
||
bool ICollection<TKey>.IsReadOnly => throw null; | ||
|
||
public Enumerator GetEnumerator() => throw null; | ||
|
||
public bool Contains(TKey item) => throw null; | ||
|
||
public void Clear() => throw new NotSupportedException(); | ||
|
||
public bool Remove(TKey item) => throw new NotSupportedException(); | ||
|
||
IEnumerator<TKey> IEnumerable<TKey>.GetEnumerator() => throw null; | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => throw null; | ||
|
||
void ICollection<TKey>.CopyTo(TKey[] array, int arrayIndex) => throw null; | ||
|
||
void ICollection<TKey>.Add(TKey item) => throw new NotSupportedException(); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...ns.Trees.Experimental/Concurrent/ConcurrentTreeDictionary`2+ValueCollection+Enumerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace TunnelVisionLabs.Collections.Trees.Concurrent | ||
{ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
public partial class ConcurrentTreeDictionary<TKey, TValue> | ||
{ | ||
public partial struct ValueCollection | ||
{ | ||
public struct Enumerator : IEnumerator<TValue> | ||
{ | ||
public TValue Current => throw null; | ||
|
||
object IEnumerator.Current => throw null; | ||
|
||
public void Dispose() => throw null; | ||
|
||
public bool MoveNext() => throw null; | ||
|
||
public void Reset() => throw null; | ||
} | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...s.Collections.Trees.Experimental/Concurrent/ConcurrentTreeDictionary`2+ValueCollection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace TunnelVisionLabs.Collections.Trees.Concurrent | ||
{ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
public partial class ConcurrentTreeDictionary<TKey, TValue> | ||
{ | ||
public partial struct ValueCollection : IReadOnlyCollection<TValue>, ICollection<TValue> | ||
{ | ||
public int Count => throw null; | ||
|
||
bool ICollection<TValue>.IsReadOnly => throw null; | ||
|
||
public Enumerator GetEnumerator() => throw null; | ||
|
||
public bool Contains(TValue item) => throw null; | ||
|
||
IEnumerator<TValue> IEnumerable<TValue>.GetEnumerator() => throw null; | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => throw null; | ||
|
||
void ICollection<TValue>.CopyTo(TValue[] array, int arrayIndex) => throw null; | ||
|
||
void ICollection<TValue>.Add(TValue item) => throw new NotSupportedException(); | ||
|
||
void ICollection<TValue>.Clear() => throw new NotSupportedException(); | ||
|
||
bool ICollection<TValue>.Remove(TValue item) => throw new NotSupportedException(); | ||
} | ||
} | ||
} |
126 changes: 126 additions & 0 deletions
126
TunnelVisionLabs.Collections.Trees.Experimental/Concurrent/ConcurrentTreeDictionary`2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace TunnelVisionLabs.Collections.Trees.Concurrent | ||
{ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
public partial class ConcurrentTreeDictionary<TKey, TValue> | ||
: IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>, IDictionary | ||
{ | ||
public ConcurrentTreeDictionary() => throw null; | ||
|
||
public ConcurrentTreeDictionary(IEnumerable<KeyValuePair<TKey, TValue>> collection) => throw null; | ||
|
||
public ConcurrentTreeDictionary(IEqualityComparer<TKey> comparer) => throw null; | ||
|
||
public ConcurrentTreeDictionary(IEnumerable<KeyValuePair<TKey, TValue>> collection, IEqualityComparer<TKey> comparer) => throw null; | ||
|
||
public ConcurrentTreeDictionary(int concurrencyLevel, int capacity) => throw null; | ||
|
||
public ConcurrentTreeDictionary(int concurrencyLevel, IEnumerable<KeyValuePair<TKey, TValue>> collection, IEqualityComparer<TKey> comparer) => throw null; | ||
|
||
public ConcurrentTreeDictionary(int concurrencyLevel, int capacity, IEqualityComparer<TKey> comparer) => throw null; | ||
|
||
public int Count => throw null; | ||
|
||
public bool IsEmpty => throw null; | ||
|
||
public KeyCollection Keys => throw null; | ||
|
||
public ValueCollection Values => throw null; | ||
|
||
bool ICollection.IsSynchronized => throw null; | ||
|
||
object ICollection.SyncRoot => throw null; | ||
|
||
bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly => throw null; | ||
|
||
bool IDictionary.IsFixedSize => throw null; | ||
|
||
bool IDictionary.IsReadOnly => throw null; | ||
|
||
ICollection IDictionary.Keys => throw null; | ||
|
||
ICollection IDictionary.Values => throw null; | ||
|
||
ICollection<TKey> IDictionary<TKey, TValue>.Keys => throw null; | ||
|
||
ICollection<TValue> IDictionary<TKey, TValue>.Values => throw null; | ||
|
||
IEnumerable<TKey> IReadOnlyDictionary<TKey, TValue>.Keys => throw null; | ||
|
||
IEnumerable<TValue> IReadOnlyDictionary<TKey, TValue>.Values => throw null; | ||
|
||
public TValue this[TKey key] | ||
{ | ||
get => throw null; | ||
set => throw null; | ||
} | ||
|
||
object IDictionary.this[object key] | ||
{ | ||
get => throw null; | ||
set => throw null; | ||
} | ||
|
||
public TValue AddOrUpdate(TKey key, Func<TKey, TValue> addValueFactory, Func<TKey, TValue, TValue> updateValueFactory) => throw null; | ||
|
||
public TValue AddOrUpdate(TKey key, TValue addValue, Func<TKey, TValue, TValue> updateValueFactory) => throw null; | ||
|
||
public TValue AddOrUpdate<TArg>(TKey key, Func<TKey, TArg, TValue> addValueFactory, Func<TKey, TValue, TArg, TValue> updateValueFactory, TArg factoryArgument) => throw null; | ||
|
||
public void Clear() => throw null; | ||
|
||
public bool ContainsKey(TKey key) => throw null; | ||
|
||
public Enumerator GetEnumerator() => throw null; | ||
|
||
public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) => throw null; | ||
|
||
public TValue GetOrAdd(TKey key, TValue value) => throw null; | ||
|
||
public TValue GetOrAdd<TArg>(TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) => throw null; | ||
|
||
public KeyValuePair<TKey, TValue>[] ToArray() => throw null; | ||
|
||
public bool TryAdd(TKey key, TValue value) => throw null; | ||
|
||
public bool TryGetValue(TKey key, out TValue value) => throw null; | ||
|
||
public bool TryRemove(TKey key, out TValue value) => throw null; | ||
|
||
public bool TryUpdate(TKey key, TValue newValue, TValue comparisonValue) => throw null; | ||
|
||
void ICollection.CopyTo(Array array, int index) => throw null; | ||
|
||
void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> item) => throw null; | ||
|
||
bool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> item) => throw null; | ||
|
||
void ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex) => throw null; | ||
|
||
bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> item) => throw null; | ||
|
||
void IDictionary.Add(object key, object value) => throw null; | ||
|
||
bool IDictionary.Contains(object key) => throw null; | ||
|
||
IDictionaryEnumerator IDictionary.GetEnumerator() => throw null; | ||
|
||
void IDictionary.Remove(object key) => throw null; | ||
|
||
void IDictionary<TKey, TValue>.Add(TKey key, TValue value) => throw null; | ||
|
||
bool IDictionary<TKey, TValue>.Remove(TKey key) => throw null; | ||
|
||
IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator() => throw null; | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => throw null; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...lVisionLabs.Collections.Trees.Experimental/Concurrent/ConcurrentTreeQueue`1+Enumerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace TunnelVisionLabs.Collections.Trees.Concurrent | ||
{ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
|
||
public partial class ConcurrentTreeQueue<T> | ||
{ | ||
public struct Enumerator : IEnumerator<T> | ||
{ | ||
public T Current => throw null; | ||
|
||
object IEnumerator.Current => throw null; | ||
|
||
public void Dispose() => throw null; | ||
|
||
public bool MoveNext() => throw null; | ||
|
||
public void Reset() => throw null; | ||
} | ||
} | ||
} |
Oops, something went wrong.