Skip to content

CSortedSet<T>

CSortedSet

CSortedSet is a generic class that implements the ISet interface.

Description

The CSortedSet class is an implementation of the sorted dynamic data set of type T, with the required uniqueness of each value. This class provides basic methods to work with sets and related operations, such as: the union and intersection of sets, definition of strict and non-strict subsets, and others.

Declaration

template<typename T>
   class CSortedSet : public ISet<T>

Header

#include <Generic\SortedSet.mqh>

Inheritance Hierarchy

ICollection

ISet

CSortedSet

Class Methods

MethodDescription
AddAdds an element to a sorted set
CountReturns the number of elements in a sorted set
ContainsDetermines whether a sorted set contains an element with the specified value
ComparerReturns a pointer to the IComparer interface, used to organize a sorted set
TryGetMinGets the minimum element from a sorted set
TryGetMaxGets the maximum element from a sorted set
CopyToCopies all elements of a sorted set to the specified array starting at the specified index
ClearRemoves all elements from a sorted set
RemoveRemoves the occurrence of the specified element from a sorted set
ExceptWithProduces the operation of difference between the current collection and a passed collection (array)
IntersectWithProduces the operation of intersection of the current collection and a passed collection (array)
SymmetricExceptWithProduces the operation of symmetrical difference between the current collection and a passed collection (array)
UnionWithProduces the union of the current collection and a passed collection (array)
IsProperSubsetOfDetermines whether the current sorted set is a proper subset of the specified collection or array
IsProperSupersetOfDetermines whether the current sorted set is a proper superset of the specified collection or array
IsSubsetOfDetermines whether the current sorted set is a subset of the specified collection or array
IsSupersetOfDetermines whether the current sorted set is a superset of the specified collection or array
OverlapsDetermines whether the current sorted set overlaps the specified collection or array
SetEqualsDetermines whether the current sorted set contains all elements of the specified collection or array
GetViewBetweenGets from the current sorted set a subset specified by the minimum and maximum values
GetReverseGets a copy of the current sorted set, in which all the elements are arranged in a reverse order
Last updated on