Skip to content

CArrayList<T>

CArrayList

CArrayList is a generic class that implements the IList interface.

Description

The CArrayList class is an implementation of the dynamic data list of the T type. This class provides the basic methods to work with the list, such as to access an element by index, to search and delete elements, sort, and others.

Declaration

template<typename T>
   class CArrayList : public IList<T>

Header

#include <Generic\ArrayList.mqh>

Inheritance Hierarchy

ICollection

IList

CArrayList

Class Methods

MethodDescription
CapacityGets and sets the current capacity of a list
CountReturns the number of elements in the list
ContainsDetermines whether a list contains an element with the specified value
TrimExcessSets the capacity of a list to the actual number of elements
TryGetValueGets an element of the list at the specified index
TrySetValueSets the value of the list element at the specified index
AddAdds an element to the list
AddRangeAdds a collection or an array of elements to the list
InsertInserts an element into the list at the specified index
InsertRangeInserts a collection or an array of elements into the list at the specified index
CopyToCopies all elements of a list to the specified array starting at the specified index
BinarySearchSearches for the specified value in an ascending-sorted list
IndexOfSearches for the first occurrence of a value in a list
LastIndexOfSearches for the last occurrence of a value in a list
ClearRemoves all elements from a collection
RemoveRemoves the first occurrence of the specified element from the list
RemoveAtRemoves an element at the specified index of the list
RemoveRangeRemoves a range of elements from the list
ReverseReverses the order of elements in the list
SortSorts elements in the list
Last updated on