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

Ogre::VectorIterator< T > Class Template Reference

Wraps iteration over a vector. More...

#include <OgreIteratorWrappers.h>

List of all members.

Public Methods

 VectorIterator (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::value_type getNext (void)
 Returns the next element in the collection, and advances to the next.

T::value_type peekNext (void)
 Returns the next element in the collection, without advancing to the next.

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

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


Private Methods

 VectorIterator ()
 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::VectorIterator< T >

Wraps iteration over a vector.

Remarks:
This class is here just to allow clients to iterate over an internal vector of a class without having to have access to the vector 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 47 of file OgreIteratorWrappers.h.


Constructor & Destructor Documentation

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

Private constructor since only the parameterised constructor should be used.

Definition at line 53 of file OgreIteratorWrappers.h.

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

Constructor.

Remarks:
Provide a start and end iterator to initialise.

Definition at line 59 of file OgreIteratorWrappers.h.

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


Member Function Documentation

template<class T>
T::value_type Ogre::VectorIterator< T >::getNext void   
 

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

Definition at line 71 of file OgreIteratorWrappers.h.

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

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

Returns true if there are more items in the collection.

Definition at line 65 of file OgreIteratorWrappers.h.

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

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

Moves the iterator on one element.

Definition at line 86 of file OgreIteratorWrappers.h.

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

template<class T>
T::value_type Ogre::VectorIterator< T >::peekNext void   
 

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

Definition at line 76 of file OgreIteratorWrappers.h.

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

template<class T>
T::pointer Ogre::VectorIterator< T >::peekNextPtr void   
 

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

Definition at line 81 of file OgreIteratorWrappers.h.


Member Data Documentation

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

Definition at line 50 of file OgreIteratorWrappers.h.

Referenced by Ogre::VectorIterator< T >::getNext(), Ogre::VectorIterator< T >::hasMoreElements(), Ogre::VectorIterator< T >::moveNext(), Ogre::VectorIterator< T >::peekNext(), and Ogre::VectorIterator< T >::VectorIterator().

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

Definition at line 51 of file OgreIteratorWrappers.h.

Referenced by Ogre::VectorIterator< T >::hasMoreElements(), and Ogre::VectorIterator< T >::VectorIterator().


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

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