home     download     screen shots     bugs     mailing list     example output     generated MFC docs     help     tools and utilities


 Overview   Project   Class   Tree   Index 
MFC Class Library
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

MFC
Class CList

CObject
   |
   +--CList

   in AFXTEMPL.H

template < class TYPE , class ARG_TYPE > class CList
extends CObject

CList


Inner Classes, Typedefs, and Enums
struct CList::CNode
          
 
Field Summary
protected int m_nBlockSize
          
protected int m_nCount
          
protected struct CPlex* m_pBlocks
          
protected CList::CNode* m_pNodeFree
          
protected CList::CNode* m_pNodeHead
          
protected CList::CNode* m_pNodeTail
          
   
Fields inherited from class CObject
classCObject
 
Constructor Summary
CList( int nBlockSize = 10 )
          
~CList()
          
 
Method Summary
 POSITION AddHead( ARG_TYPE newElement )
          
 void AddHead( CList* pNewList )
          
 POSITION AddTail( ARG_TYPE newElement )
          
 void AddTail( CList* pNewList )
          
 POSITION Find( ARG_TYPE searchValue, POSITION startAfter = NULL ) const
          
 POSITION FindIndex( int nIndex ) const
          
 void FreeNode( CList::CNode* pNode )
          
protected void FreeNode( CList::CNode* )
          
 AFX_INLINE TYPE GetAt( POSITION position ) const
          
 AFX_INLINE int GetCount() const
          CList inline functions
 AFX_INLINE TYPE GetHead() const
          
 AFX_INLINE POSITION GetHeadPosition() const
          
 AFX_INLINE TYPE GetNext( POSITION& rPosition ) const
          
 AFX_INLINE TYPE GetPrev( POSITION& rPosition ) const
          
 AFX_INLINE TYPE GetTail() const
          
 AFX_INLINE POSITION GetTailPosition() const
          
 POSITION InsertAfter( POSITION position, ARG_TYPE newElement )
          
 POSITION InsertBefore( POSITION position, ARG_TYPE newElement )
          
 AFX_INLINE BOOL IsEmpty() const
          
protected CList::CNode* NewNode( CList::CNode*, CList::CNode* )
          
 CList< TYPE, ARG_TYPE >::CNode* NewNode( CList::CNode* pPrev, CList::CNode* pNext )
          Node helpers Implementation note: CNode's are stored in CPlex blocks and chained together.
 void RemoveAll()
          
 void RemoveAt( POSITION position )
          
 TYPE RemoveHead()
          
 TYPE RemoveTail()
          
 void Serialize( CArchive& ar )
          
 AFX_INLINE void SetAt( POSITION pos, ARG_TYPE newElement )
          
   
Methods inherited from class CObject
GetRuntimeClass, new, new, delete, IsSerializable, IsKindOf, Serialize
 

Field Detail

m_nBlockSize

protected int m_nBlockSize;

m_nCount

protected int m_nCount;

m_pBlocks

protected struct CPlex* m_pBlocks;

m_pNodeFree

protected CList::CNode* m_pNodeFree;

m_pNodeHead

protected CList::CNode* m_pNodeHead;

m_pNodeTail

protected CList::CNode* m_pNodeTail;


Constructor Detail

CList

public CList( int nBlockSize = 10 );

~CList

public ~CList();


Method Detail

AddHead

public POSITION AddHead( ARG_TYPE newElement );

AddHead

public void AddHead( CList* pNewList );

AddTail

public POSITION AddTail( ARG_TYPE newElement );

AddTail

public void AddTail( CList* pNewList );

Find

public POSITION Find( ARG_TYPE searchValue, POSITION startAfter = NULL ) const;

FindIndex

public POSITION FindIndex( int nIndex ) const;

FreeNode

 void FreeNode( CList::CNode* pNode );

FreeNode

protected void FreeNode( CList::CNode* );

GetAt

public AFX_INLINE TYPE GetAt( POSITION position ) const;

GetCount

public AFX_INLINE int GetCount() const;
CList inline functions

GetHead

public AFX_INLINE TYPE GetHead() const;

GetHeadPosition

public AFX_INLINE POSITION GetHeadPosition() const;

GetNext

public AFX_INLINE TYPE GetNext( POSITION& rPosition ) const;

GetPrev

public AFX_INLINE TYPE GetPrev( POSITION& rPosition ) const;

GetTail

public AFX_INLINE TYPE GetTail() const;

GetTailPosition

public AFX_INLINE POSITION GetTailPosition() const;

InsertAfter

public POSITION InsertAfter( POSITION position, ARG_TYPE newElement );

InsertBefore

public POSITION InsertBefore( POSITION position, ARG_TYPE newElement );

IsEmpty

public AFX_INLINE BOOL IsEmpty() const;

NewNode

protected CList::CNode* NewNode( CList::CNode*, CList::CNode* );

NewNode

 CList< TYPE, ARG_TYPE >::CNode* NewNode( CList::CNode* pPrev, CList::CNode* pNext );
Node helpers Implementation note: CNode's are stored in CPlex blocks and chained together. Free blocks are maintained in a singly linked list using the 'pNext' member of CNode with 'm_pNodeFree' as the head. Used blocks are maintained in a doubly linked list using both 'pNext' and 'pPrev' as links and 'm_pNodeHead' and 'm_pNodeTail' as the head/tail. We never free a CPlex block unless the List is destroyed or RemoveAll() is used - so the total number of CPlex blocks may grow large depending on the maximum past size of the list.

RemoveAll

public void RemoveAll();

RemoveAt

public void RemoveAt( POSITION position );

RemoveHead

public TYPE RemoveHead();

RemoveTail

public TYPE RemoveTail();

Serialize

public void Serialize( CArchive& ar );

SetAt

public AFX_INLINE void SetAt( POSITION pos, ARG_TYPE newElement );

 Overview   Project   Class   Tree   Index 
MFC Class Library
CppDoc v2.4.1
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD