Lean  $LEAN_TAG$
QuantConnect.Util.ConcurrentSet< T > Class Template Reference

Provides a thread-safe set collection that mimics the behavior of HashSet<T> and will be keep insertion order More...

Inheritance diagram for QuantConnect.Util.ConcurrentSet< T >:
[legend]

Public Member Functions

void UnionWith (IEnumerable< T > other)
 Modifies the current set so that it contains all elements that are present in either the current set or the specified collection. More...
 
void IntersectWith (IEnumerable< T > other)
 Modifies the current set so that it contains only elements that are also in a specified collection. More...
 
void ExceptWith (IEnumerable< T > other)
 Removes all elements in the specified collection from the current set. More...
 
void SymmetricExceptWith (IEnumerable< T > other)
 Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. More...
 
bool IsSubsetOf (IEnumerable< T > other)
 Determines whether a set is a subset of a specified collection. More...
 
bool IsSupersetOf (IEnumerable< T > other)
 Determines whether the current set is a superset of a specified collection. More...
 
bool IsProperSupersetOf (IEnumerable< T > other)
 Determines whether the current set is a proper (strict) superset of a specified collection. More...
 
bool IsProperSubsetOf (IEnumerable< T > other)
 Determines whether the current set is a proper (strict) subset of a specified collection. More...
 
bool Overlaps (IEnumerable< T > other)
 Determines whether the current set overlaps with the specified collection. More...
 
bool SetEquals (IEnumerable< T > other)
 Determines whether the current set and the specified collection contain the same elements. More...
 
bool Add (T item)
 Adds an element to the current set and returns a value to indicate if the element was successfully added. More...
 
void Clear ()
 Removes all items from the T:System.Collections.Generic.ICollection`1. More...
 
bool Contains (T item)
 Determines whether the T:System.Collections.Generic.ICollection`1 contains a specific value. More...
 
void CopyTo (T[] array, int arrayIndex)
 Copies the elements of the T:System.Collections.Generic.ICollection`1 to an T:System.Array, starting at a particular T:System.Array index. More...
 
bool Remove (T item)
 Removes the first occurrence of a specific object from the T:System.Collections.Generic.ICollection`1. More...
 
IEnumerator< T > GetEnumerator ()
 Returns an enumerator that iterates through the collection. More...
 

Public Attributes

bool IsReadOnly => false
 Gets a value indicating whether the T:System.Collections.Generic.ICollection`1 is read-only. More...
 

Properties

int Count [get]
 Gets the number of elements contained in the T:System.Collections.Generic.ICollection`1. More...
 

Detailed Description

Provides a thread-safe set collection that mimics the behavior of HashSet<T> and will be keep insertion order

Template Parameters
TThe item type

Definition at line 29 of file ConcurrentSet.cs.

Member Function Documentation

◆ UnionWith()

void QuantConnect.Util.ConcurrentSet< T >.UnionWith ( IEnumerable< T >  other)

Modifies the current set so that it contains all elements that are present in either the current set or the specified collection.

Parameters
otherThe collection to compare to the current set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 74 of file ConcurrentSet.cs.

◆ IntersectWith()

void QuantConnect.Util.ConcurrentSet< T >.IntersectWith ( IEnumerable< T >  other)

Modifies the current set so that it contains only elements that are also in a specified collection.

Parameters
otherThe collection to compare to the current set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 92 of file ConcurrentSet.cs.

◆ ExceptWith()

void QuantConnect.Util.ConcurrentSet< T >.ExceptWith ( IEnumerable< T >  other)

Removes all elements in the specified collection from the current set.

Parameters
otherThe collection of items to remove from the set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 114 of file ConcurrentSet.cs.

◆ SymmetricExceptWith()

void QuantConnect.Util.ConcurrentSet< T >.SymmetricExceptWith ( IEnumerable< T >  other)

Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both.

Parameters
otherThe collection to compare to the current set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 132 of file ConcurrentSet.cs.

◆ IsSubsetOf()

bool QuantConnect.Util.ConcurrentSet< T >.IsSubsetOf ( IEnumerable< T >  other)

Determines whether a set is a subset of a specified collection.

Returns
true if the current set is a subset of other ; otherwise, false.
Parameters
otherThe collection to compare to the current set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 154 of file ConcurrentSet.cs.

◆ IsSupersetOf()

bool QuantConnect.Util.ConcurrentSet< T >.IsSupersetOf ( IEnumerable< T >  other)

Determines whether the current set is a superset of a specified collection.

Returns
true if the current set is a superset of other ; otherwise, false.
Parameters
otherThe collection to compare to the current set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 177 of file ConcurrentSet.cs.

◆ IsProperSupersetOf()

bool QuantConnect.Util.ConcurrentSet< T >.IsProperSupersetOf ( IEnumerable< T >  other)

Determines whether the current set is a proper (strict) superset of a specified collection.

Returns
true if the current set is a proper superset of other ; otherwise, false.
Parameters
otherThe collection to compare to the current set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 200 of file ConcurrentSet.cs.

◆ IsProperSubsetOf()

bool QuantConnect.Util.ConcurrentSet< T >.IsProperSubsetOf ( IEnumerable< T >  other)

Determines whether the current set is a proper (strict) subset of a specified collection.

Returns
true if the current set is a proper subset of other ; otherwise, false.
Parameters
otherThe collection to compare to the current set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 226 of file ConcurrentSet.cs.

◆ Overlaps()

bool QuantConnect.Util.ConcurrentSet< T >.Overlaps ( IEnumerable< T >  other)

Determines whether the current set overlaps with the specified collection.

Returns
true if the current set and other share at least one common element; otherwise, false.
Parameters
otherThe collection to compare to the current set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 252 of file ConcurrentSet.cs.

◆ SetEquals()

bool QuantConnect.Util.ConcurrentSet< T >.SetEquals ( IEnumerable< T >  other)

Determines whether the current set and the specified collection contain the same elements.

Returns
true if the current set is equal to other ; otherwise, false.
Parameters
otherThe collection to compare to the current set.
Exceptions
T:System.ArgumentNullExceptionother is null.

Definition at line 275 of file ConcurrentSet.cs.

◆ Add()

bool QuantConnect.Util.ConcurrentSet< T >.Add ( item)

Adds an element to the current set and returns a value to indicate if the element was successfully added.

Returns
true if the element is added to the set; false if the element is already in the set.
Parameters
itemThe element to add to the set.

Definition at line 295 of file ConcurrentSet.cs.

◆ Clear()

void QuantConnect.Util.ConcurrentSet< T >.Clear ( )

Removes all items from the T:System.Collections.Generic.ICollection`1.

Exceptions
T:System.NotSupportedExceptionThe T:System.Collections.Generic.ICollection`1 is read-only.

Definition at line 305 of file ConcurrentSet.cs.

◆ Contains()

bool QuantConnect.Util.ConcurrentSet< T >.Contains ( item)

Determines whether the T:System.Collections.Generic.ICollection`1 contains a specific value.

Returns
true if item is found in the T:System.Collections.Generic.ICollection`1; otherwise, false.
Parameters
itemThe object to locate in the T:System.Collections.Generic.ICollection`1.

Definition at line 317 of file ConcurrentSet.cs.

◆ CopyTo()

void QuantConnect.Util.ConcurrentSet< T >.CopyTo ( T[]  array,
int  arrayIndex 
)

Copies the elements of the T:System.Collections.Generic.ICollection`1 to an T:System.Array, starting at a particular T:System.Array index.

Parameters
arrayThe one-dimensional T:System.Array that is the destination of the elements copied from T:System.Collections.Generic.ICollection`1. The T:System.Array must have zero-based indexing.
arrayIndexThe zero-based index in array at which copying begins.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionarrayIndex is less than 0.
T:System.ArgumentExceptionThe number of elements in the source T:System.Collections.Generic.ICollection`1 is greater than the available space from arrayIndex to the end of the destination array .

Definition at line 333 of file ConcurrentSet.cs.

◆ Remove()

bool QuantConnect.Util.ConcurrentSet< T >.Remove ( item)

Removes the first occurrence of a specific object from the T:System.Collections.Generic.ICollection`1.

Returns
true if item was successfully removed from the T:System.Collections.Generic.ICollection`1; otherwise, false. This method also returns false if item is not found in the original T:System.Collections.Generic.ICollection`1.
Parameters
itemThe object to remove from the T:System.Collections.Generic.ICollection`1.
Exceptions
T:System.NotSupportedExceptionThe T:System.Collections.Generic.ICollection`1 is read-only.

Definition at line 348 of file ConcurrentSet.cs.

◆ GetEnumerator()

IEnumerator<T> QuantConnect.Util.ConcurrentSet< T >.GetEnumerator ( )

Returns an enumerator that iterates through the collection.

For thread safety will return a snapshot of the collection

Returns
A T:System.Collections.Generic.IEnumerator`1 that can be used to iterate through the collection.

<filterpriority>1</filterpriority>

Definition at line 365 of file ConcurrentSet.cs.

Member Data Documentation

◆ IsReadOnly

bool QuantConnect.Util.ConcurrentSet< T >.IsReadOnly => false

Gets a value indicating whether the T:System.Collections.Generic.ICollection`1 is read-only.

Returns
true if the T:System.Collections.Generic.ICollection`1 is read-only; otherwise, false.

Definition at line 52 of file ConcurrentSet.cs.

Property Documentation

◆ Count

int QuantConnect.Util.ConcurrentSet< T >.Count
get

Gets the number of elements contained in the T:System.Collections.Generic.ICollection`1.

Returns
The number of elements contained in the T:System.Collections.Generic.ICollection`1.

Definition at line 40 of file ConcurrentSet.cs.


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