NanoByte.Common  2.9.0
NanoByte.Common.Collections.ConcurrentSet< T > Class Template Reference

Represents a thread-safe set of values. More...

Inheritance diagram for NanoByte.Common.Collections.ConcurrentSet< T >:

Public Member Functions

 ConcurrentSet ()
 Creates a new concurrent set. More...
 
 ConcurrentSet (int concurrencyLevel, int capacity)
 Creates a new concurrent set. More...
 
 ConcurrentSet (IEqualityComparer< T > comparer)
 Creates a new concurrent set. More...
 
 ConcurrentSet (IEnumerable< T > collection)
 Creates a new concurrent set. More...
 
 ConcurrentSet (IEnumerable< T > collection, IEqualityComparer< T > comparer)
 Creates a new concurrent set. More...
 
 ConcurrentSet (int concurrencyLevel, IEnumerable< T > collection, IEqualityComparer< T > comparer)
 Creates a new concurrent set. More...
 
IEnumerator GetEnumerator ()
 
void Add (T item)
 
void Clear ()
 
bool Contains (T item)
 
void CopyTo (T[] array, int arrayIndex)
 
bool Remove (T item)
 

Properties

int Count [get]
 
bool IsReadOnly [get]
 

Detailed Description

Represents a thread-safe set of values.

Template Parameters
TThe type of the values in the set.

This class is thread-safe.

Type Constraints
T :notnull 

Constructor & Destructor Documentation

◆ ConcurrentSet() [1/6]

Creates a new concurrent set.

◆ ConcurrentSet() [2/6]

NanoByte.Common.Collections.ConcurrentSet< T >.ConcurrentSet ( int  concurrencyLevel,
int  capacity 
)
inline

Creates a new concurrent set.

Parameters
concurrencyLevelThe estimated number of threads that will update the set concurrently
capacityThe initial number of elements that the set can contain.

◆ ConcurrentSet() [3/6]

NanoByte.Common.Collections.ConcurrentSet< T >.ConcurrentSet ( IEqualityComparer< T >  comparer)
inline

Creates a new concurrent set.

Parameters
comparerThe IEqualityComparer<T> implementation to use when comparing elements.

◆ ConcurrentSet() [4/6]

NanoByte.Common.Collections.ConcurrentSet< T >.ConcurrentSet ( IEnumerable< T >  collection)
inline

Creates a new concurrent set.

Parameters
collectionElements to be copied to the new set.

◆ ConcurrentSet() [5/6]

NanoByte.Common.Collections.ConcurrentSet< T >.ConcurrentSet ( IEnumerable< T >  collection,
IEqualityComparer< T >  comparer 
)
inline

Creates a new concurrent set.

Parameters
collectionElements to be copied to the new set.
comparerThe IEqualityComparer<T> implementation to use when comparing elements.

◆ ConcurrentSet() [6/6]

NanoByte.Common.Collections.ConcurrentSet< T >.ConcurrentSet ( int  concurrencyLevel,
IEnumerable< T >  collection,
IEqualityComparer< T >  comparer 
)
inline

Creates a new concurrent set.

Parameters
concurrencyLevelThe estimated number of threads that will update the set concurrently
collectionElements to be copied to the new set.
comparerThe IEqualityComparer<T> implementation to use when comparing values.

The documentation for this class was generated from the following file: