Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent collection API #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// 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;
using System.Diagnostics.CodeAnalysis;

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([MaybeNullWhen(false)] out T result) => throw null!;

public bool TryTake([MaybeNullWhen(false)] out T result) => throw null!;

void ICollection.CopyTo(Array array, int index) => throw null!;

bool IProducerConsumerCollection<T>.TryAdd(T item) => throw null!;
}
}
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!;
}
}
}
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!;
}
}
}
}
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();
}
}
}
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!;
}
}
}
}
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();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
// 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.Diagnostics.CodeAnalysis;

public partial class ConcurrentTreeDictionary<TKey, TValue>
: IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>, IDictionary
where TKey : notnull
{
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, [MaybeNullWhen(false)] out TValue value) => throw null!;

public bool TryRemove(TKey key, [MaybeNullWhen(false)] 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!;
}
}
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!;
}
}
}
Loading