DWFCore::DWFConstIterator< T > Interface Template Reference

#include "dwfcore/Iterator.h"

Inheritance diagram for DWFCore::DWFConstIterator< T >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class T>
interface DWFCore::DWFConstIterator< T >

An interface template for const iterators.

Since:
1.2.0
This iterator interface is used to return objects that are contained in a collection, with the added constraint that elements referenced by these iterators cannot be be modified.

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:

                DWFConstIterator* pIterator = function_returning_const_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 167 of file Iterator.h.

Public Member Functions

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

Protected Member Functions

 DWFConstIterator () throw ()


Constructor & Destructor Documentation

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

Destructor

Exceptions:
None 

Definition at line 177 of file Iterator.h.

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

Constructor

Exceptions:
None 

Definition at line 225 of file Iterator.h.


Member Function Documentation

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

Returns the element at the current position.

Returns:
The current element.
Exceptions:
DWFException 

Implemented in DWFCore::DWFVectorConstIterator< T, A >, DWFCore::DWFSortedList< T, E, L, Z >::ConstIterator, DWFCore::DWFCharKeyHashList< T, H >::ConstIterator, and DWFCore::DWFWCharKeyHashList< T, H >::ConstIterator.

template<class T>
virtual bool DWFCore::DWFConstIterator< 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::DWFVectorConstIterator< T, A >, DWFCore::DWFSortedList< T, E, L, Z >::ConstIterator, DWFCore::DWFCharKeyHashList< T, H >::ConstIterator, and DWFCore::DWFWCharKeyHashList< T, H >::ConstIterator.

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

Reset the iterator back to its initial position

Exceptions:
None 

Implemented in DWFCore::DWFVectorConstIterator< T, A >, DWFCore::DWFSortedList< T, E, L, Z >::ConstIterator, DWFCore::DWFCharKeyHashList< T, H >::ConstIterator, and DWFCore::DWFWCharKeyHashList< T, H >::ConstIterator.

template<class T>
virtual bool DWFCore::DWFConstIterator< T >::valid  )  const 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::DWFVectorConstIterator< T, A >, DWFCore::DWFSortedList< T, E, L, Z >::ConstIterator, DWFCore::DWFCharKeyHashList< T, H >::ConstIterator, and DWFCore::DWFWCharKeyHashList< T, H >::ConstIterator.


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