Skip to content

ConcurrentSet

QuantConnect.Util.ConcurrentSet

Bases: Generic[QuantConnect_Util_ConcurrentSet_T], Object, ISet[QuantConnect_Util_ConcurrentSet_T], Iterable[QuantConnect_Util_ConcurrentSet_T]

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

count

count: int

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

is_read_only

is_read_only: bool

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

__iter__

__iter__() -> Iterator[QuantConnect_Util_ConcurrentSet_T]

add

add(item: QuantConnect_Util_ConcurrentSet_T) -> bool

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

Parameters:

Name Type Description Default
item QuantConnect_Util_ConcurrentSet_T

The element to add to the set.

required

Returns:

Type Description
bool

true if the element is added to the set; false if the element is already in the set.

clear

clear() -> None

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

contains

contains(item: QuantConnect_Util_ConcurrentSet_T) -> bool

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

Parameters:

Name Type Description Default
item QuantConnect_Util_ConcurrentSet_T

The object to locate in the System.Collections.Generic.ICollection`1.

required

Returns:

Type Description
bool

true if item is found in the System.Collections.Generic.ICollection`1; otherwise, false.

copy_to

copy_to(
    array: List[QuantConnect_Util_ConcurrentSet_T],
    array_index: int,
) -> None

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

Parameters:

Name Type Description Default
array List[QuantConnect_Util_ConcurrentSet_T]

The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection`1. The System.Array must have zero-based indexing.

required
array_index int

The zero-based index in array at which copying begins.

required

except_with

except_with(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> None

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

Parameters:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection of items to remove from the set.

required

get_enumerator

get_enumerator() -> (
    IEnumerator[QuantConnect_Util_ConcurrentSet_T]
)

Returns an enumerator that iterates through the collection.

Returns:

Type Description
IEnumerator[QuantConnect_Util_ConcurrentSet_T]

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

intersect_with

intersect_with(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> None

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

Parameters:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection to compare to the current set.

required

is_proper_subset_of

is_proper_subset_of(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> bool

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

Parameters:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection to compare to the current set.

required

Returns:

Type Description
bool

true if the current set is a proper subset of other; otherwise, false.

is_proper_superset_of

is_proper_superset_of(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> bool

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

Parameters:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection to compare to the current set.

required

Returns:

Type Description
bool

true if the current set is a proper superset of other; otherwise, false.

is_subset_of

is_subset_of(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> bool

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

Parameters:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection to compare to the current set.

required

Returns:

Type Description
bool

true if the current set is a subset of other; otherwise, false.

is_superset_of

is_superset_of(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> bool

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

Parameters:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection to compare to the current set.

required

Returns:

Type Description
bool

true if the current set is a superset of other; otherwise, false.

overlaps

overlaps(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> bool

Determines whether the current set overlaps with the specified collection.

Parameters:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection to compare to the current set.

required

Returns:

Type Description
bool

true if the current set and other share at least one common element; otherwise, false.

remove

remove(item: QuantConnect_Util_ConcurrentSet_T) -> bool

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

Parameters:

Name Type Description Default
item QuantConnect_Util_ConcurrentSet_T

The object to remove from the System.Collections.Generic.ICollection`1.

required

Returns:

Type Description
bool

true if item was successfully removed from the System.Collections.Generic.ICollection1; otherwise, false. This method also returns false if item is not found in the original System.Collections.Generic.ICollection1.

set_equals

set_equals(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> bool

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

Parameters:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection to compare to the current set.

required

Returns:

Type Description
bool

true if the current set is equal to other; otherwise, false.

symmetric_except_with

symmetric_except_with(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> None

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:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection to compare to the current set.

required

union_with

union_with(
    other: List[QuantConnect_Util_ConcurrentSet_T],
) -> None

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

Parameters:

Name Type Description Default
other List[QuantConnect_Util_ConcurrentSet_T]

The collection to compare to the current set.

required