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

Ogre::ConstMapIterator< T > Class Template Reference

Wraps iteration over a const map. More...

#include <OgreIteratorWrappers.h>

List of all members.

Public Types

typedef T::mapped_type MappedType
typedef T::key_type KeyType

Public Member Functions

 ConstMapIterator (typename T::const_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) const
 Returns the next value element in the collection, without advancing to the next.

T::key_type peekNextKey (void) const
 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::const_pointer peekNextValuePtr (void) const
 Returns a pointer to the next value element in the collection, without advancing to the next afterwards.

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


Private Member Functions

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


Private Attributes

T::const_iterator mCurrent
T::const_iterator mEnd


Detailed Description

template<class T>
class Ogre::ConstMapIterator< T >

Wraps iteration over a const 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 255 of file OgreIteratorWrappers.h.


Member Typedef Documentation

template<class T>
typedef T::key_type Ogre::ConstMapIterator< T >::KeyType
 

Definition at line 264 of file OgreIteratorWrappers.h.

template<class T>
typedef T::mapped_type Ogre::ConstMapIterator< T >::MappedType
 

Definition at line 263 of file OgreIteratorWrappers.h.


Constructor & Destructor Documentation

template<class T>
Ogre::ConstMapIterator< T >::ConstMapIterator  )  [private]
 

Private constructor since only the parameterised constructor should be used.

Definition at line 261 of file OgreIteratorWrappers.h.

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

Constructor.

Remarks:
Provide a start and end iterator to initialise.

Definition at line 270 of file OgreIteratorWrappers.h.


Member Function Documentation

template<class T>
T::mapped_type Ogre::ConstMapIterator< T >::getNext void   ) 
 

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

Definition at line 282 of file OgreIteratorWrappers.h.

template<class T>
bool Ogre::ConstMapIterator< T >::hasMoreElements void   )  const
 

Returns true if there are more items in the collection.

Definition at line 276 of file OgreIteratorWrappers.h.

template<class T>
void Ogre::ConstMapIterator< T >::moveNext void   )  const
 

Moves the iterator on one element.

Definition at line 310 of file OgreIteratorWrappers.h.

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

Required to overcome intermittent bug.

Definition at line 297 of file OgreIteratorWrappers.h.

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

template<class T>
T::key_type Ogre::ConstMapIterator< T >::peekNextKey void   )  const
 

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

Definition at line 292 of file OgreIteratorWrappers.h.

template<class T>
T::mapped_type Ogre::ConstMapIterator< T >::peekNextValue void   )  const
 

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

Definition at line 287 of file OgreIteratorWrappers.h.

template<class T>
T::const_pointer Ogre::ConstMapIterator< T >::peekNextValuePtr void   )  const
 

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

Definition at line 305 of file OgreIteratorWrappers.h.


Member Data Documentation

template<class T>
T::const_iterator Ogre::ConstMapIterator< T >::mCurrent [mutable, private]
 

Definition at line 258 of file OgreIteratorWrappers.h.

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

Definition at line 259 of file OgreIteratorWrappers.h.


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

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 13:00:52 2006