DWFCore::DWFIterator< T > Interface Template Reference

#include "dwfcore/Iterator.h"

Inheritance diagram for DWFCore::DWFIterator< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
interface 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 73 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 83 of file Iterator.h.

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

Constructor

Exceptions:
None 

Definition at line 131 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::DWFVectorIterator< T, A >, DWFCore::DWFStringVectorIterator< A >, DWFCore::DWFBasicIteratorImpl< T >, DWFCore::DWFCachingIterator< T >, DWFCore::DWFSkipList< K, V, E, L, Z >::_Node::_Iterator, DWFCore::DWFSkipList< K, V, E, L, Z >::_Node::_ConstIterator, 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::DWFVectorIterator< T, A >, DWFCore::DWFStringVectorIterator< A >, DWFCore::DWFBasicIteratorImpl< T >, DWFCore::DWFCachingIterator< T >, DWFCore::DWFSkipList< K, V, E, L, Z >::_Node::_Iterator, DWFCore::DWFSkipList< K, V, E, L, Z >::_Node::_ConstIterator, 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::DWFVectorIterator< T, A >, DWFCore::DWFStringVectorIterator< A >, DWFCore::DWFBasicIteratorImpl< T >, DWFCore::DWFCachingIterator< T >, DWFCore::DWFSkipList< K, V, E, L, Z >::_Node::_Iterator, DWFCore::DWFSkipList< K, V, E, L, Z >::_Node::_ConstIterator, 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() will return a valid element, false if the end of the iterator has been reached.
Exceptions:
None 

Implemented in DWFCore::DWFVectorIterator< T, A >, DWFCore::DWFStringVectorIterator< A >, DWFCore::DWFBasicIteratorImpl< T >, DWFCore::DWFCachingIterator< T >, DWFCore::DWFSkipList< K, V, E, L, Z >::_Node::_Iterator, DWFCore::DWFSkipList< K, V, E, L, Z >::_Node::_ConstIterator, DWFCore::DWFSortedList< T, E, L, Z >::Iterator, DWFCore::DWFCharKeyHashList< T, H >::Iterator, and DWFCore::DWFWCharKeyHashList< T, H >::Iterator.


The documentation for this interface was generated from the following file:
Generated on Tue Jan 6 22:39:37 2009 for Autodesk DWF Core Library by  doxygen 1.4.5