Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CPtrList
◄CObject►                                     ◄Up► ◄Contents► ◄Index► ◄Back►
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  Description
 
  The CPtrList class supports lists of void pointers.
 
  The member functions of CPtrList are similar to the member functions of
  class ◄CObList► Because of this similarity, you can use the CObList
  reference documentation for member function specifics. Wherever you see
  a CObject pointer as a function parameter or return value, substitute a
  pointer to void.
 
  CObject*& CObList::GetHead() const;
 
  for example, translates to
 
  void*& CPtrList::GetHead() const;
 
  CPtrList incorporates the IMPLEMENT_DYNAMIC macro to support run-time
  type access and dumping to a CDumpContext object. If need a dump of
  individual pointer list elements, you must set the depth of the dump
  context to 1 or greater.
 
  Pointer lists may <not> be serialized.
 
  When a CPtrList object is deleted, or when its elements are removed,
  only the pointers are removed, not the entities they reference.
 
  #include <afxcoll.h>
 
  Public Members
 
  Construction/Destruction
 
  ◄CPtrList►   Constructs an empty list for void pointers.
 
  ◄~CPtrList►   Destroys a CPtrList object.
 
  Head/Tail Access
 
  ◄GetHead►   Returns the head element of the list (cannot be empty).
 
  ◄GetTail►   Returns the tail element of the list (cannot be empty).
 
  Operations
 
  ◄RemoveHead►   Removes the element from the head of the list.
 
  ◄RemoveTail►   Removes the element from the tail of the list.
 
  ◄AddHead►      Adds an element (or all the elements in another list) to
                 the head of the list (makes a new head).
 
  ◄AddTail►      Adds an element (or all the elements in another list) to
                 the tail of the list (makes a new tail).
 
  ◄RemoveAll►    Removes all the elements from this list.
 
  Iteration
 
  ◄GetHeadPosition►   Returns the position of the head element of the
                      list.
 
  ◄GetTailPosition►   Returns the position of the tail element of the
                      list.
 
  ◄GetNext►           Gets the next element for iterating.
 
  ◄GetPrev►           Gets the previous element for iterating.
 
  Retrieval/Modification
 
  ◄GetAt►      Gets the element at a given position.
 
  ◄SetAt►      Sets the element at a given position.
 
  ◄RemoveAt►   Removes an element from this list, specified by position.
 
  Insertion
 
  ◄InsertBefore►   Inserts a new element before a given position.
 
  ◄InsertAfter►    Inserts a new element after a given position.
 
  Searching
 
  ◄Find►        Gets the position of an element specified by pointer
                value.
 
  ◄FindIndex►   Gets the position of an element specified by a zero-based
                index.
 
  Status
 
  ◄GetCount►   Returns the number of elements in this list.
 
  ◄IsEmpty►    Tests for the empty list condition (no elements).
 
 
                                     -♦-