Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::MapIterator< T > Class Template Reference

Wraps iteration over a map. More...

#include <OgreIteratorWrappers.h>

List of all members.

Public Methods

 MapIterator (typename T::iterator start, typename T::const_iterator end)
 Constructor.

bool hasMoreElements (void) const
 Returns true if there are more items in the collection.

T::mapped_type getNext (void)
 Returns the next value element in the collection, and advances to the next.

T::mapped_type peekNextValue (void)
 Returns the next value element in the collection, without advancing to the next.

T::key_type peekNextKey (void)
 Returns the next key element in the collection, without advancing to the next.

MapIterator< T > & operator= (MapIterator< T > &rhs)
 Required to overcome intermittent bug.

T::pointer peekNextValuePtr (void)
 Returns a pointer to the next value element in the collection, without advancing to the next afterwards.

void moveNext (void)
 Moves the iterator on one element.


Private Methods

 MapIterator ()
 Private constructor since only the parameterised constructor should be used.


Private Attributes

T::iterator mCurrent
T::const_iterator mEnd


Detailed Description

template<class T>
class Ogre::MapIterator< T >

Wraps iteration over a map.

Remarks:
This class is here just to allow clients to iterate over an internal map of a class without having to have access to the map itself (typically to iterate you need both the iterator and the end() iterator to test for the end condition, which is messy). No updates are allowed through this interface, it is purely for iterating and reading.

Note that like STL iterators, these iterators are only valid whilst no updates are made to the underlying collection. You should not attempt to use this iterator if a change is made to the collection. In fact, treat this iterator as a transient object, do NOT store it and try to use it repeatedly.

Definition at line 110 of file OgreIteratorWrappers.h.


Constructor & Destructor Documentation

template<class T>
Ogre::MapIterator< T >::MapIterator   [private]
 

Private constructor since only the parameterised constructor should be used.

Definition at line 116 of file OgreIteratorWrappers.h.

template<class T>
Ogre::MapIterator< T >::MapIterator typename T::iterator    start,
typename T::const_iterator    end
 

Constructor.

Remarks:
Provide a start and end iterator to initialise.

Definition at line 122 of file OgreIteratorWrappers.h.

References Ogre::MapIterator< T >::mCurrent, and Ogre::MapIterator< T >::mEnd.


Member Function Documentation

template<class T>
T::mapped_type Ogre::MapIterator< T >::getNext void   
 

Returns the next value element in the collection, and advances to the next.

Definition at line 134 of file OgreIteratorWrappers.h.

References Ogre::MapIterator< T >::mCurrent.

template<class T>
bool Ogre::MapIterator< T >::hasMoreElements void    const
 

Returns true if there are more items in the collection.

Definition at line 128 of file OgreIteratorWrappers.h.

References Ogre::MapIterator< T >::mCurrent, and Ogre::MapIterator< T >::mEnd.

template<class T>
void Ogre::MapIterator< T >::moveNext void   
 

Moves the iterator on one element.

Definition at line 162 of file OgreIteratorWrappers.h.

References Ogre::MapIterator< T >::mCurrent.

template<class T>
MapIterator<T>& Ogre::MapIterator< T >::operator= MapIterator< T > &    rhs
 

Required to overcome intermittent bug.

Definition at line 149 of file OgreIteratorWrappers.h.

References Ogre::MapIterator< T >::mCurrent, and Ogre::MapIterator< T >::mEnd.

template<class T>
T::key_type Ogre::MapIterator< T >::peekNextKey void   
 

Returns the next key element in the collection, without advancing to the next.

Definition at line 144 of file OgreIteratorWrappers.h.

References Ogre::MapIterator< T >::mCurrent.

template<class T>
T::mapped_type Ogre::MapIterator< T >::peekNextValue void   
 

Returns the next value element in the collection, without advancing to the next.

Definition at line 139 of file OgreIteratorWrappers.h.

References Ogre::MapIterator< T >::mCurrent.

template<class T>
T::pointer Ogre::MapIterator< T >::peekNextValuePtr void   
 

Returns a pointer to the next value element in the collection, without advancing to the next afterwards.

Definition at line 157 of file OgreIteratorWrappers.h.

References Ogre::MapIterator< T >::mCurrent.


Member Data Documentation

template<class T>
T::iterator Ogre::MapIterator< T >::mCurrent [private]
 

Definition at line 113 of file OgreIteratorWrappers.h.

Referenced by Ogre::MapIterator< T >::getNext(), Ogre::MapIterator< T >::hasMoreElements(), Ogre::MapIterator< T >::MapIterator(), Ogre::MapIterator< T >::moveNext(), Ogre::MapIterator< T >::operator=(), Ogre::MapIterator< T >::peekNextKey(), Ogre::MapIterator< T >::peekNextValue(), and Ogre::MapIterator< T >::peekNextValuePtr().

template<class T>
T::const_iterator Ogre::MapIterator< T >::mEnd [private]
 

Definition at line 114 of file OgreIteratorWrappers.h.

Referenced by Ogre::MapIterator< T >::hasMoreElements(), Ogre::MapIterator< T >::MapIterator(), and Ogre::MapIterator< T >::operator=().


The documentation for this class was generated from the following file:

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:18:02 2004