VisibleListIterator Class Reference

Returns entries in a visible list. More...

#include <uielem.h>

List of all members.

Public Member Functions

VisibleListIteratoroperator++ ()
 Moves on the iterator to the next entry in the VisibleList.
VisibleListIteratoroperator-- ()
 Moves the iterator to the previous entry in the VisibleList.
VisibleListItemoperator * ()
 Allows us to get at the VisibleListItem pointed to by this iterator.
BOOL operator!= (const VisibleListIterator &Other)
 Enables us to determine when an iteration has finished, a la while (Iterator != Container.End()).
 VisibleListIterator (List &Container, VisibleListItemPtr *const pPointer, INT32 *IndexesOfItemsToReturn=NULL)
 This constructor provides two variants of a VisibleListIterator: 1. Returns all entries in the given list. 2. Returns only those items whose indexes are contained in the given INT32 array. (These should probably be two separate classes).
 ~VisibleListIterator ()
 Provides a destructor to delete any array given in the constructor.
 VisibleListIterator (const VisibleListIterator &Other)
 Warns that these have not been implemented (but a destructor has).
const VisibleListIteratoroperator= (const VisibleListIterator &Other)

Private Attributes

VisibleListItemPtrm_VisibleListItemPtr
Listm_Container
INT32 * m_IndexesOfItemsToReturn
UINT32 m_IndexInIndex


Detailed Description

Returns entries in a visible list.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/10/96
See Also: VisibleList::Begin(), End()

Definition at line 176 of file uielem.h.


Constructor & Destructor Documentation

VisibleListIterator::VisibleListIterator List Container,
VisibleListItemPtr *const   pPointer,
INT32 *  IndexesOfItemsToReturn = NULL
 

This constructor provides two variants of a VisibleListIterator: 1. Returns all entries in the given list. 2. Returns only those items whose indexes are contained in the given INT32 array. (These should probably be two separate classes).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Parameters:
Container,: The container of VisibleListItemPtr's [INPUTS] pPointer: The item in the container with which the iteration will begin IndexesOfItemsToReturn: An array of INT32's, representing indexes of items in the Container (starting from 0, in ascending order and terminated by -1)

Definition at line 175 of file uielem.cpp.

00176                                                                        :
00177     m_VisibleListItemPtr(pPointer), 
00178     m_Container(Container), 
00179     m_IndexesOfItemsToReturn(IndexesOfItemsToReturn), 
00180     m_IndexInIndex(0)
00181 {
00182     if (IndexesOfItemsToReturn != NULL)
00183     {
00184         m_VisibleListItemPtr = (VisibleListItemPtr*)m_Container.FindItem(LISTPOS(m_IndexesOfItemsToReturn[0]));
00185     }
00186 }

VisibleListIterator::~VisibleListIterator  ) 
 

Provides a destructor to delete any array given in the constructor.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 199 of file uielem.cpp.

00200 {
00201     if (m_IndexesOfItemsToReturn != NULL)
00202     {
00203         delete [] m_IndexesOfItemsToReturn;
00204     }
00205 }

VisibleListIterator::VisibleListIterator const VisibleListIterator Other  ) 
 

Warns that these have not been implemented (but a destructor has).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 220 of file uielem.cpp.

00220                                                                          : 
00221     m_Container(Other.m_Container)
00222 {   
00223     ERROR3("VisibleListIterator - copy constructor unimplemented\n");   
00224 }


Member Function Documentation

VisibleListItem & VisibleListIterator::operator *  ) 
 

Allows us to get at the VisibleListItem pointed to by this iterator.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Returns:
A reference to the VisibleListItem

Errors: ERROR2's if the iterator's gone off the end of the container.

Definition at line 339 of file uielem.cpp.

00340 {
00341     ERROR3IF(m_VisibleListItemPtr == NULL, "NULL Member");
00342 
00343     return m_VisibleListItemPtr->GetEntry();
00344 }

BOOL VisibleListIterator::operator!= const VisibleListIterator Other  ) 
 

Enables us to determine when an iteration has finished, a la while (Iterator != Container.End()).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Returns:
TRUE if the iterator's are pointing at different VisibleListEntry's FALSE if they're the same

Definition at line 319 of file uielem.cpp.

00320 {
00321     return m_VisibleListItemPtr != Other.m_VisibleListItemPtr;
00322 }

VisibleListIterator & VisibleListIterator::operator++  ) 
 

Moves on the iterator to the next entry in the VisibleList.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Returns:
An iterator pointing at the next entry.

Definition at line 247 of file uielem.cpp.

00248 {
00249     if (m_IndexesOfItemsToReturn == NULL)
00250     {
00251         m_VisibleListItemPtr = (VisibleListItemPtr*)m_Container.GetNext(m_VisibleListItemPtr);
00252     }
00253     else
00254     {
00255         ++m_IndexInIndex;
00256         if (m_IndexesOfItemsToReturn[m_IndexInIndex] == -1)
00257         {
00258             m_VisibleListItemPtr = NULL;
00259         }
00260         else
00261         {
00262             m_VisibleListItemPtr = (VisibleListItemPtr*)m_Container.FindItem(LISTPOS(m_IndexesOfItemsToReturn[m_IndexInIndex]));
00263         }
00264     }
00265 
00266     return *this;
00267 }

VisibleListIterator & VisibleListIterator::operator--  ) 
 

Moves the iterator to the previous entry in the VisibleList.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Returns:
An iterator pointing at the next entry.

Definition at line 282 of file uielem.cpp.

00283 {
00284     if (m_IndexesOfItemsToReturn == NULL)
00285     {
00286         m_VisibleListItemPtr = (VisibleListItemPtr*)m_Container.GetPrev(m_VisibleListItemPtr);
00287     }
00288     else
00289     {
00290         if (m_IndexInIndex == 0)
00291         {
00292             m_VisibleListItemPtr = NULL;
00293         }
00294         else
00295         {
00296             --m_IndexInIndex;
00297             m_VisibleListItemPtr = (VisibleListItemPtr*)m_Container.FindItem(LISTPOS(m_IndexesOfItemsToReturn[m_IndexInIndex]));
00298         }
00299     }
00300 
00301     return *this;
00302 }

const VisibleListIterator & VisibleListIterator::operator= const VisibleListIterator Other  ) 
 

Definition at line 227 of file uielem.cpp.

00228 {   
00229     ERROR3("VisibleListIterator - assignment operator not implemented\n");  
00230 
00231     return *this;
00232 }


Member Data Documentation

List& VisibleListIterator::m_Container [private]
 

Definition at line 193 of file uielem.h.

INT32* VisibleListIterator::m_IndexesOfItemsToReturn [private]
 

Definition at line 194 of file uielem.h.

UINT32 VisibleListIterator::m_IndexInIndex [private]
 

Definition at line 195 of file uielem.h.

VisibleListItemPtr* VisibleListIterator::m_VisibleListItemPtr [private]
 

Definition at line 192 of file uielem.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:03:02 2007 for Camelot by  doxygen 1.4.4