CList Class is a class of dynamic list of instances of the CObject class and its derived classes.
Class CList provides the ability to work with a list of instances of CObject and its derived classes. The class allows adding/inserting/deleting array elements, performing an array sorting, and searching in a sorted array. In addition, methods of working with files have been implemented.
There are some subtleties of working with the CList class. The class has a mechanism to control dynamic memory, so be careful when working with elements of the list.
Subtleties of the mechanism of memory management similar to those described in CArrayObj.
class CList : public CObject |
#include <Arrays\List.mqh> |
Inheritance hierarchyCList |
Attributes |
|
|---|---|
Gets the flag of memory management when deleting list elements |
|
Sets the flag of memory management when deleting list elements |
|
Gets the number of elements in the list |
|
Gets sorted list flag |
|
Gets the sorting mode |
|
Create methods |
|
Creates a new list element |
|
Add methods |
|
Adds an element to the end of the list |
|
Inserts an element to the specified position of the list |
|
Delete methods |
|
Removes an element from the current position in the list without deleting it "physically" |
|
Removes the element from the current position in the list |
|
Removes the element from the specified position in the list |
|
Removes all list elements |
|
Navigation |
|
Gets the index of the specified list element |
|
Gets an item with the specified index of the list |
|
Gets the first element of the list |
|
Gets the previous element of the list |
|
Gets the current list element |
|
Gets the next element in the list |
|
Gets the last element in the list |
|
Ordering methods |
|
Sorts the list |
|
Moves the current element in the list to the specified position |
|
Swaps two elements in the list |
|
Compare methods |
|
Compares the list with another one |
|
Search methods |
|
Searches for an element equal to the sample in sorted list |
|
Input/output |
|
virtual Save |
Saves list data in the file |
virtual Load |
Loads list data from the file |
virtual Type |
Gets the list type identifier |
Methods inherited from class CObject Prev, Prev, Next, Next, Compare |