Skip to content

CLinkedList<T>

CLinkedList

CLinkedList is a generic class that implements the ICollection interface.

Description

The CLinkedList class is an implementation of the dynamic doubly linked data list of the T type. This class provides basic methods to work with doubly linked lists, such as to add, delete, search elements, and others.

Declaration

template<typename T>
   class CLinkedList : public ICollection<T>

Header

#include <Generic\LinkedList.mqh>

Inheritance Hierarchy

ICollection

CLinkedList

Class Methods

MethodDescription
AddAdds an element to a linked list
AddAfterAdds an element after the specified node in the linked list
AddBeforeAdds an element before the specified node in the linked list
AddFirstAdds an element at the beginning of the linked list
AddLastAdds an element at the end of the linked list
CountReturns the number of elements in the linked list
HeadReturns a pointer to the first node of the linked list
FirstReturns a pointer to the first node of the linked list
LastReturns a pointer to the last node of the linked list
ContainsDetermines whether the linked list contains an element with the specified value
CopyToCopies all elements of the linked list to the specified array starting at the specified index
ClearRemoves all elements from a linked list
RemoveRemoves the first occurrence of the specified element from the linked list
RemoveFirstRemoves the first element of the linked list
RemoveLastRemoves the last element of the linked list
FindSearches for the first occurrence of the specified value in the linked list
FindLastSearches for the last occurrence of the specified value in the linked list
Last updated on