Table of Contents

Class ConcurrentSet<T>

Namespace
DxFeed.Graal.Net.Utils
Assembly
DxFeed.Graal.Net.dll

This is a simple wrapper over ConcurrentDictionary<TKey, TValue>, to provide an interface as a Set (.NET does not provide a built-in concurrent hashset type) for more consistent.

public class ConcurrentSet<T> : ICollection<T>, IEnumerable<T>, IEnumerable where T : notnull

Type Parameters

T

The type of elements in the set.

Inheritance
ConcurrentSet<T>
Implements
Inherited Members

Constructors

ConcurrentSet()

Initializes a new instance of the ConcurrentSet<T> class.

public ConcurrentSet()

Properties

Count

public int Count { get; }

Property Value

int

IsReadOnly

public bool IsReadOnly { get; }

Property Value

bool

Methods

Add(T)

Adds the specified element to a set.

public bool Add(T item)

Parameters

item T

The element to add to the set.

Returns

bool

true if the element is added to the ConcurrentSet<T> object; false if the element is already present.

Clear()

public void Clear()

Contains(T)

public bool Contains(T item)

Parameters

item T

Returns

bool

CopyTo(T[], int)

public void CopyTo(T[] array, int arrayIndex)

Parameters

array T[]
arrayIndex int

GetEnumerator()

public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

Remove(T)

public bool Remove(T item)

Parameters

item T

Returns

bool