Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

DWFCore::DWFIterator< T > Class Template Reference

#include "dwfcore/Iterator.h"

Inheritance diagram for DWFCore::DWFIterator< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
class DWFCore::DWFIterator< T >

An interface template for iterators.
Since:
1.0.1.

This iterator interface is used to return objects that are contained in a collection.

Typically, this interface is used in a for loop. Also, this interface may be returned as a pointer that must be managed by the caller. The following code snippet shows the standard use of these objects:

                DWFIterator* pIterator = function_returning_iterator();
                if (pIterator)
                {
                    for (; pIterator->valid(); pIterator->next())
                    {
                        function_using_object( pIterator->get() );
                    }
                
                    DWFCORE_FREE_OBJECT( pIterator );
                }

Parameters:
T The type of content returned by the iterator.

Definition at line 72 of file Iterator.h.

Public Member Functions

virtual ~DWFIterator () throw ()
virtual void reset ()=0 throw ()
virtual bool valid ()=0 throw ()
virtual bool next ()=0 throw ()
virtual T & get ()=0 throw ( DWFException )

Protected Member Functions

 DWFIterator () throw ()


Constructor & Destructor Documentation

template<class T>
virtual DWFCore::DWFIterator< T >::~DWFIterator  )  throw () [inline, virtual]
 

Destructor

Exceptions:
None 

Definition at line 82 of file Iterator.h.

template<class T>
DWFCore::DWFIterator< T >::DWFIterator  )  throw () [inline, protected]
 

Constructor

Exceptions:
None 

Definition at line 130 of file Iterator.h.


Member Function Documentation

template<class T>
virtual T& DWFCore::DWFIterator< T >::get  )  throw ( DWFException ) [pure virtual]
 

Returns the element at the current position.

Returns:
The current element.
Exceptions:
DWFException 

Implemented in DWFCore::DWFStringVectorIterator, DWFCore::DWFBasicIteratorImpl< T >, DWFCore::DWFSortedList< T, E, L, Z >::Iterator, DWFCore::DWFCharKeyHashList< T, H >::Iterator, and DWFCore::DWFWCharKeyHashList< T, H >::Iterator.

template<class T>
virtual bool DWFCore::DWFIterator< T >::next  )  throw () [pure virtual]
 

Move the iterator forward one element.

Returns:
true if the iterator points to a valid element, false if the end of the iterator has been reached.
Exceptions:
None 

Implemented in DWFCore::DWFStringVectorIterator, DWFCore::DWFBasicIteratorImpl< T >, DWFCore::DWFSortedList< T, E, L, Z >::Iterator, DWFCore::DWFCharKeyHashList< T, H >::Iterator, and DWFCore::DWFWCharKeyHashList< T, H >::Iterator.

template<class T>
virtual void DWFCore::DWFIterator< T >::reset  )  throw () [pure virtual]
 

Reset the iterator back to its initial position

Exceptions:
None 

Implemented in DWFCore::DWFStringVectorIterator, DWFCore::DWFBasicIteratorImpl< T >, DWFCore::DWFSortedList< T, E, L, Z >::Iterator, DWFCore::DWFCharKeyHashList< T, H >::Iterator, and DWFCore::DWFWCharKeyHashList< T, H >::Iterator.

template<class T>
virtual bool DWFCore::DWFIterator< T >::valid  )  throw () [pure virtual]
 

Determines if the iterator points to a valid element.

Returns:
true if get() returns a valid element, false if the end of the iterator has been reached.
Exceptions:
None 

Implemented in DWFCore::DWFStringVectorIterator, DWFCore::DWFBasicIteratorImpl< T >, DWFCore::DWFSortedList< T, E, L, Z >::Iterator, DWFCore::DWFCharKeyHashList< T, H >::Iterator, and DWFCore::DWFWCharKeyHashList< T, H >::Iterator.


The documentation for this class was generated from the following file:
Generated on Tue May 17 12:05:18 2005 for Autodesk DWF Core Library by  doxygen 1.4.1