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

Ogre::VectorIterator Class Template Reference

Wraps iteration over a vector. More...

#include <OgreIteratorWrappers.h>

List of all members.

Public Methods

 VectorIterator ()
 VectorIterator (typename T::iterator start, typename T::iterator end)
 Constructor. More...

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

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

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


Private Attributes

T::iterator mCurrent
T::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.


Constructor & Destructor Documentation

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

template<class T>
Ogre::VectorIterator< T >::VectorIterator typename T::iterator    start,
typename T::iterator    end
[inline]
 

Constructor.

Remarks:
Provide a start and end iterator to initialise.


Member Function Documentation

template<class T>
T::value_type Ogre::VectorIterator< T >::getNext void    [inline]
 

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

template<class T>
bool Ogre::VectorIterator< T >::hasMoreElements void    [inline]
 

Returns true if there are more items in the collection.

template<class T>
T::value_type Ogre::VectorIterator< T >::peekNext void    [inline]
 

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


Member Data Documentation

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

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

Copyright © 2002 by The OGRE Team