CAtlArray Class
This class implements an array object.
template<
typename E,
class ETraits = CElementTraits< E >
>
class CAtlArray
Parameters
E
The type of data to be stored in the array.ETraits
The code used to copy or move elements.
Members
Methods
Call this method to add an element to the array object. |
|
Call this method to add the contents of one array to the end of another. |
|
Call this method to confirm that the array object is valid. |
|
The constructor. |
|
The destructor. |
|
Call this method to copy the elements of one array to another. |
|
Call this method to remove any empty elements from the array. |
|
Call this method to retrieve a single element from the array object. |
|
Call this method to return the number of elements stored in the array. |
|
Call this method to return a pointer to the first element in the array. |
|
Call this method to insert one array into another. |
|
Call this method to insert a new element (or multiple copies of an element) into the array object. |
|
Call this method to test if the array is empty. |
|
Call this method to remove all elements from the array object. |
|
Call this method to remove one or more elements from the array. |
|
Call this method to set the value of an element in the array object. |
|
Call this method to set the value of an element in the array object, expanding the array as required. |
|
Call this method to set the size of the array object. |
Operators
Call this operator to return a reference to an element in the array. |
Typedefs
The data type to use for adding elements to the array. |
|
The data type to use for retrieving elements from the array. |
Remarks
CAtlArray provides methods for creating and managing an array of elements of a user-defined type. Although similar to standard C arrays, the CAtlArray object can dynamically shrink and grow as necessary. The array index always starts at position 0, and the upper bound can be fixed, or allowed to expand as new elements are added.
For arrays with a small number of elements, the ATL class CSimpleArray can be used.
CAtlArray is closely related to MFC's CArray class and will work in an MFC project, albeit without serialization support.
For more information, see ATL Collection Classes.
Requirements
Header: atlcoll.h