CAtlList Class
This class provides methods for creating and managing a list object.
template<
typename E,
class ETraits = CElementTraits< E >
>
class CAtlList
Parameters
E
The element type.ETraits
The code used to copy or move elements. See CElementTraits Class for more details.
Members
Public Typedefs
Name |
Description |
---|---|
Public Constructors
Name |
Description |
---|---|
The constructor. |
|
The destructor. |
Public Methods
Name |
Description |
---|---|
Call this method to add an element to the head of the list. |
|
Call this method to add an existing list to the head of the list. |
|
Call this method to add an element to the tail of this list. |
|
Call this method to add an existing list to the tail of this list. |
|
Call this method to confirm the list is valid. |
|
Call this method to search the list for the specified element. |
|
Call this method to obtain the position of an element, given an index value. |
|
Call this method to return the element at a specified position in the list. |
|
Call this method to return the number of objects in the list. |
|
Call this method to return the element at the head of the list. |
|
Call this method to obtain the position of the head of the list. |
|
Call this method to return the next element from the list. |
|
Call this method to return the previous element from the list. |
|
Call this method to return the element at the tail of the list. |
|
Call this method to obtain the position of the tail of the list. |
|
Call this method to insert a new element into the list after the specified position. |
|
Call this method to insert a new element into the list before the specified position. |
|
Call this method to determine if the list is empty. |
|
Call this method to move the specified element to the head of the list. |
|
Call this method to move the specified element to the tail of the list. |
|
Call this method to remove all of the elements from the list. |
|
Call this method to remove a single element from the list. |
|
Call this method to remove the element at the head of the list. |
|
Call this method to remove the element at the head of the list without returning a value. |
|
Call this method to remove the element at the tail of the list. |
|
Call this method to remove the element at the tail of the list without returning a value. |
|
Call this method to set the value of the element at a given position in the list. |
|
Call this method to swap elements in the list. |
Remarks
The CAtlList class supports ordered lists of nonunique objects accessible sequentially or by value. CAtlList lists behave like doubly linked lists. Each list has a head and a tail, and new elements (or lists in some cases) can be added to either end of the list, or inserted before or after specific elements.
Most of the CAtlList methods make use of a position value. This value is used by the methods to reference the actual memory location where the elements are stored, and should not be calculated or predicted directly. If it is necessary to access the nth element in the list, the method CAtlList::FindIndex will return the corresponding position value for a given index. The methods CAtlList::GetNext and CAtlList::GetPrev can be used to iterate through the objects in the list.
For more information regarding the collection classes available with ATL, see ATL Collection Classes.
Requirements
Header: atlcoll.h