DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.17.0" />

 ConcurrentTypeMap

Represents thread-safe implementation of ITypeMap interface.
public struct Enumerator : IEnumerator<Enumerator, object>

Represents an enumerator over values stored in the map.

public ConcurrentTypeMap(int capacity)

Initializes a new empty set.

Initializes a new empty set.

public bool AddOrUpdate<T>(T value)

Adds a new value or updates existing one, atomically.

public void Clear()

public bool Contains<T>()

Gets an enumerator over values in this map.

public T GetOrAdd<T>(T value, out bool added)

Attempts to add a new value or returns existing value, atomitcally.

public bool Remove<T>()

public bool Remove<T>(out T value)

public void Set<T>(T value)

public bool Set<T>(T newValue, out T oldValue)

public bool TryAdd<T>(T value)

Attempts to add a new value to this set.

public bool TryGetValue<T>(out T value)